Example: using system symbols

Suppose you want to start a task whose source JCL is in the DUMPCHK member of a partitioned data set. You can specify system symbols for the task in one of the following two ways:
On the START command:
Suppose you enter the following command to start the DUMPCHK task:
 START DUMPCHK,SG=ALL,JDATE=93119,DAY=THURSDAY,SUB=CICS&SYSNAME
If the substitution text for the &SYSNAME system symbol is SYS1 on the system that processes the START command, the system substitutes the text SYS1 for the &SYSNAME system symbol. The equivalent source JCL is:
//DUMPCHK  JOB  MSGLEVEL=1
//STARTING EXEC DUMPCHK,SG=ALL,JDATE=93119,DAY=THURSDAY,SUB=CICSSYS1
In the source JCL:
You can also specify system symbols in the source JCL for started tasks. Keep in mind that system symbols in the source JCL are resolved during JCL processing, rather than command processing.
For example, suppose you code the following JCL in the DUMPCHK procedure:
//DUMPCHK  PROC
//S1       EXEC PGM=DUMPPROG,PARM=CICS&SYSNAME
As in the previous example for the START command, if the substitution text for the &SYSNAME system symbol is SYS1 on the system that processes the JCL, the system substitutes the text SYS1 for the &SYSNAME system symbol. The equivalent JCL is:
//DUMPCHK  PROC
//S1       EXEC PGM=DUMPPROG,PARM=CICSSYS1

The DUMPCHK procedure can also include system symbols on other statements. For example, you might specify system symbols in DD statements that must specify data sets with unique names on different systems.

Suppose that two systems, named SYS1 and SYS2, are to process a DUMPCHK procedure that contains the following statement:
//LOG   DD  DSN=&SYSNAME..LOG,DISP=......
When each system processes the statement, the following data set names result:
SYS1.LOG on system SYS1
SYS2.LOG on system SYS2
You can include a substring of a system symbol on a JCL statement. For example, you might specify system symbols in DD statements that must specify data sets with unique names on different systems, but only have two characters to use. Suppose that two systems, named SYS1 and SYS2, are to process a procedure that contains the following statement:
 //DD1 DD DSN=SYS1.PARMLIB.SYSTEM&SYSNAME(-2:2).,DISP=....    
When each system processes the statement, the following data set names result:
SYS1.PARMLIB.SYSTEMS1 on system SYS1
SYS1.PARMLIB.SYSTEMS2 on system SYS2