SW005

Return Module Parameter Record

Last Revised: 01/31/15

This program is used to return a parameter record from a parameter file or from global memory.

Parameter files are files named XXMM00 where XX is the company code, and MM is the module code.  Parameter files contain a single templated record with a key of MM.  They contain fields that can control application program execution, enabling different options as needed for different installations.  They permit the same program to exhibit different behavior based on the values of the parameter fields.

Because many programs need to access the parameter record, the SW005 program can be used to read the parameter record from the disc, and store it in global memory for use by subsequent calls to SW005.  The global variable is named XXMM00 and its template is named XXMM00.tpl.  Note that if a parameter record is changed, then applications need to logoff, or change company codes, or enter XX at the menu to flush the global memory fields so that the next call to SW005 will access the disc file with the revised records.  There is also a parameter you can pass to SW005 to ignore any global template or data variables if present.

Operator will receive prompt: "Please run MM Parameter Maintenance before this option" if parameter file or record does not exist.

CALL "SW005", ERR=XXXX, Y$, MODULE$, XX00$, {DISC, MSG$}

SW005
Argument In/Out Usage
XXXX   Branch to line XXXX if unable to open module file or parameter record does not exist.
Y$ In Pass the standard task control variable or a two letter company code to be used as the starting characters of the parameter file.  Can also be passed as null to use the standard task control variable.
MODULE$ In Two letter module code (MM).
XX00$ Out The templated module record as retrieved from the disc or global memory.
DISC In Optional parameter.  Remove from call list or pass as 0 to use global memory variables to improve performance.  Pass as 1 to retrieve template and data from disc and ignore global values when the template or data was recently changed.  The template and data globals will be reset so subsequent calls to SW005 will not need the DISC parameter unless the template or data is changed again.
MSG$ In Optional prompt message to operator if module record is not on file.
Example - Retrieve the GL00$ parameter record, used with General Ledger applications.  Branch to EOJERR if parameter file or record does not exist.
0130 CALL "SW005",ERR=EOJERR,Y$,"GL",GL00$
Example - Retrieve the AP00$ parameter record, used with Accounts Payable applications.  Branch to EOJ if parameter file or record does not exist.
0160 CALL "SW005",ERR=EOJ,Y$,"AP",AP00$
Example - Retrieve the SO00$ parameter record and template from disc and not global memory, used with Sales Order Processing.  Branch to EOJ if parameter file or record does not exist.
0160 CALL "SW005",ERR=EOJ,Y$,"SO",SO00$,1
Example - Retrieve the DD00$ parameter record, which contains company name, address, deprecated menu specific dates, prefix list, etc.  The data in DD00$ is maintained used Company Information Maintenance (SMC).
0160 CALL "SW005",Y$,"DD",DD00$