When Control-M/Analyzer performs commands (such as DO, IF), the contents of certain parameters are scanned for special symbols (starting with %%). These parameters are analyzed and the contents are automatically replaced by the resolved values. The modified command is then activated. To determine which commands and fields accept AutoEdit variables, see the parameter descriptions in this chapter.
Rules that use the AutoEdit facility are clear and simple, yet they enable any kind of action to be taken. For example:
You can use a DO SET statement to define your own AutoEdit variables and assign values to them. These values can be used in subsequent DO statements of the rule.
Using DO GETMEM, DO ADDSYM, and DO PUTMEM statements, AutoEdit variables are read from and written to PDS library members. Therefore, AutoEdit variables can be used:
A DO GETMEM statement reads an AutoEdit member into memory, making its AutoEdit variables available to the rule.
A DO ADDSYM statement adds new AutoEdit variables to a new or existing AutoEdit member.
A DO PUTMEM statement writes to disk all changes made to an AutoEdit member.
To add a new AutoEdit variable to a member, use a DO GETMEM statement (to read the member into memory), a DO ADDSYM statement (to add the variable), and a DO PUTMEM statement (to write the changes to disk).
To modify an existing AutoEdit variable, use a DO GETMEM statement (to read the AutoEdit variables of the member into memory), a DO SET statement (to change the value of the variable), and a DO PUTMEM statement (to write the changes to disk).
Note: If a rule refers to an AutoEdit variable through a DO ADDSYM statement , the variable is created even if the associated MEM member was not read (by a DO GETMEM statement). Consider the following when using a DO PUTMEM statement:
For an example of how the %%LOCAL_CURRENCY and %%ROUND_CURRENCY AutoEdit variables can be used for currency conversions, see Euro Support.
The Rule Definition screen illustrated in Figure 129 displays examples of AutoEdit Variables.
Figure 129 Examples of the Auto Edit Variables
LIBRARY : CTB.PROD.RULES RULE :BANKDAYS
COMMAND ===> SCROLL===> CRSR
+-----------------------------------------------------------------------------+
===========================================================================
EXECUTE INIT UPON C
ON DATA
ALWAYS
DO GETMEM = LSTBNKDY
LIBSYM CTB.PROD.SYMBOLS
DO
(ENTER "ALWAYS", "IF")
===========================================================================
EXECUTE GETDATES UPON C
ON SYSOUT PROCST PGMST STEP01 DDNAME BANKDAYS JOBNM
MODE PG LINECT 0000 DATASTAMP
WHEN LINE 001 - 060 COL 001 - 132 STOP AND/OR
STRING = |
EXTRACT = MONTH
LEVEL LINE +000 COL +002 - +005 PROCESS TYP
ADDSYM = %%LAST_BANKING_DAY_%%MONTH MEM LSTBNKDY
LIBSYM CTB.PROD.SYMBOLS
DO EXTRACT = %%LAST_BANKING_DAY_%%MONTH
LEVEL 0 LINE +000 COL +002 - +007 PROCESS TYP
DO
WHEN LINE - COL - STOP AND/OR
STRING =
DO
===========================================================================
EXECUTE FINISH UPON C
ON DATA
ALWAYS
DO PPUTMEM = LSTBNKDY
LIBSYM CTB.PROD.SYMBOLS
DO
(ENTER "ALWAYS", "IF")
===========================================================================
EXECUTE UPON C
ON
======= >>>>>>>>>>>>>>> END OF RULE DEFINITION PARAMETERS <<<<<<<<<<<<<<< =====
PLEASE FILL IN RULE DEFINITION. 17.07.34
Each rule can reference (read) more than one AutoEdit member. Other AutoEdit members can be accessed with a DO GETMEM statement. AutoEdit members can be written to disk using a DO PUTMEM statement. For additional information see DO ADDSYM: Automated Balancing Statement, DO GETMEM: Automated Balancing Statement, and DO PUTMEM: Automated Balancing Statement.
Note: No rollback mechanism is available for AutoEdit members. It is your responsibility to handle changes to AutoEdit members.
Parent Topic |