By default, columns 1 through 72 of JCL lines are searched for variables which are then analyzed and resolved. If column 72 contains an asterisk (*), the active range for resolution is columns 1 through 71 (to support continuation lines).
Multiple AutoEdit variables (and constants) can be joined together into a complex term. When a term contains multiple variables, those variables are resolved from right to left.
The methods of joining multiple variables together are described below.
Example 1
Given: |
%%A=1, %%B=2, %%A2=100 |
|
---|---|---|
Resolve: |
%%A%%B |
|
Explanation: |
The process of resolution is as follows: |
|
Initial expression to resolve |
%%A%%B |
|
Resolve %%B |
2 |
|
Replace %%B with value 2 |
%%A2 |
|
(%%A%%B partially resolves to a single variable %%A2) |
||
Resolve %%A2 |
100 |
|
Solution: |
%%A%%B resolves to 100 |
|
Example 2
Given: |
The day is the 3rd of the month. |
---|---|
Resolve: |
//SYSBKP DD UNIT=TAPE,VOL=SER=%%BACKUP_TAPE_%%ODAY, |
Solution: |
This statement partially resolves to: |
//SYSBKP DD UNIT=TAPE,VOL=SER=%%BACKUP_TAPE_03, |
|
%%BACKUP_TAPE_03 is a single user-defined variable. If the value of this variable is known to Control-M as EE1022, the statement would fully resolve to: |
|
//SYSBKP DD UNIT=TAPE,VOL=SER=EE1022, |
Example 1
Given: |
%%A=1, %%B=2, %%A2=100 |
|
---|---|---|
Resolve: |
%%A.%%B |
|
Explanation:
|
The process of resolution is as follows: |
|
Initial expression to resolve |
%%A.%%B |
|
Resolve %%B |
2 |
|
(The partially resolved variable now reads |
%%A.2) |
|
Resolve %%A |
1 |
|
(The partially resolved variable now reads |
1.2) |
|
Final resolution of the two values (based on the rule that two variables joined by a period resolve to a concatenated value) |
12 |
|
Solution: |
%%A.%%B resolves to 12 |
|
Example 2
On the 4th of December, %%ODAY.%%OMONTH resolves to 0412
(If the expression had been written %%ODAY%%OMONTH (without the period), it would have partially resolved to %%ODAY12, which is a user-defined variable requiring further resolution.)
Example 1
Given: |
%%A=1, %%B=2, %%A2=100 |
|
---|---|---|
Resolve: |
%%A..%%B |
|
Explanation:
|
The process of resolution is similar to the resolution of two variables joined by one period: |
|
Initial expression to resolve |
%%A..%%B |
|
Resolve %%B |
2 |
|
(The partially resolved variable now reads |
%%A..2) |
|
Resolve %%A |
1 |
|
(The partially resolved variable now reads |
1..2) |
|
Final resolution of the two values (based on the rule that two variables joined by two periods resolve to two values joined by a period) |
1.2 |
|
Solution: |
%%A..%%B resolves to 1.2 |
|
Example 2
On the 4th of December, %%ODAY..%%OMONTH resolves to 04.12
Without symbol %%., the constant would be treated as part of the variable (for example, expression %%AAUP consists of one variable).
The %%. or %%.. symbol is not required if the constant precedes the variable (for example, UNIT%%AA) since the %% prefix of the variable differentiates it from the constant.
Example
Given: |
%%MODE = PROD |
|
---|---|---|
Resolve: |
CTM.%%MODE%%.01.JCL |
|
Explanation: |
The process of resolution is as follows: |
|
Initial expression to resolve |
CTM.%%MODE%%.01.JCL |
|
Resolve %%MODE |
PROD |
|
(The partially resolved variable now reads CTM.PROD%%.01.JCL) |
|
|
Final resolution (based on the rule that symbol %%. joins a constant to a variable) |
CTM.PROD01.JCL |
|
Solution: |
CTM.%%MODE%%.01.JCL resolves to CTM.PROD01.JCL |
Note: To separate a constant (JCL) from a variable (%%MODE) by a period, specifying the period is sufficient. For example: CTM.%%MODE.JCL would resolve to CTM.PROD.JCL.
Parent Topic |