The SYMLIST parameter specifies which JCL variables (system symbols) should be exported to subsequent jobs or displayed. It is used with the EXPORT statement to control which variables are made available across job boundaries, and with the SYMLIST command to generate debugging output of current variable values.
Key Benefit:
SYMLIST provides precise control over which variables are shared between jobs, enhancing security by limiting exposure of sensitive values and helping with debugging by displaying current variable values.
SYMLIST is used in two distinct contexts in JCL:
123// EXPORT SYMLIST=(var1,var2,var3,...) // EXPORT SYMLIST=* // EXPORT SYMLIST=NONE
Option | Description |
---|---|
(var1,var2,...) | Exports only the specified variables to subsequent jobs |
* | Exports all defined variables to subsequent jobs |
NONE | Prevents any variables from being exported |
123456//JOB1 JOB (ACCT#),'ADMIN',CLASS=A // EXPORT SYMLIST=(TODAY,ENV,STATUS) // SET TODAY=&SYSDATE // SET ENV='PROD' // SET STATUS='NORMAL' // SET INTERNAL='PRIVATE' /* Not exported */
This example exports only three variables (TODAY, ENV, and STATUS) to subsequent jobs. The INTERNAL variable will not be available to other jobs.
1234//JOB2 JOB (ACCT#),'ADMIN',CLASS=A // EXPORT SYMLIST=* // SET VAR1='VALUE1' // SET VAR2='VALUE2'
This example exports all variables defined in the job, including system-defined variables and any variables set within the job.
123//STEP1 EXEC PGM=IEFBR14 //SYMLIST DD SYSOUT=* // SET VAR1='TEST'
The SYMLIST DD statement causes the system to display the values of all defined JCL variables at that point in the job.
12//SYMLIST DD SYSOUT=*, // SYMLIST=(VAR1,VAR2,SYSDATE)
This form displays only the specified variables rather than all defined variables.
12345VARIABLE VALUE -------- ----- VAR1 'TEST' SYSDATE '20230315' SYSUID 'USER123'
This shows the typical format of SYMLIST output in the job log, displaying variable names and their current values.
12345678//JOB1 JOB (ACCT#),'ADMIN',CLASS=A // SET CONFIG='PROD' // SET USERID='ADMIN01' // SET PASSWORD='SECRET' /* Sensitive */ // SET DATAFILE='MASTER.DATA' //* // EXPORT SYMLIST=(CONFIG,USERID,DATAFILE) //* Note: PASSWORD is deliberately not exported for security
This example shows selective export of variables, excluding sensitive information like passwords from being available to subsequent jobs.
12345678910111213141516//DEBUG JOB (ACCT#),'ADMIN',CLASS=A // SET VAR1='ABC' // SET VAR2=123 //* //DISPLAY1 EXEC PGM=IEFBR14 //SYMLIST DD SYSOUT=* /* Display all variables */ //* //STEP1 EXEC PGM=PROCESS //INPUT DD DSN=&VAR1..DATA,DISP=SHR //* // SET VAR1='XYZ' // SET VAR3='NEW' //* //DISPLAY2 EXEC PGM=IEFBR14 //SYMLIST DD SYSOUT=*, // SYMLIST=(VAR1,VAR3) /* Display specific variables */
This example demonstrates using SYMLIST at different points in a job to track variable values during execution, first displaying all variables and later checking only specific ones that have changed.
1234567891011121314151617//JOB1 JOB (ACCT#),'ADMIN',CLASS=A // SET TODAY=&SYSDATE // SET MODE='BATCH' // SET COUNT=0 //* //SYMLIST DD SYSOUT=* /* Display before export */ //* // EXPORT SYMLIST=(TODAY,MODE) /* Only export some */ //* //STEP1 EXEC PGM=PROGRAM1 // SET COUNT=100 /* Modified after EXPORT */ //* //JOB2 JOB (ACCT#),'ADMIN',CLASS=A //SYMLIST DD SYSOUT=* /* Check what was imported */ //* //STEP1 EXEC PGM=PROGRAM2 //DD1 DD DSN=FILE.&TODAY..&MODE,DISP=SHR
This example shows how SYMLIST can be used to verify which variables are available to a job that follows one using the EXPORT statement. Note that COUNT would not be available to JOB2 because it wasn't in the EXPORT SYMLIST.
Issue | Possible Causes | Solutions |
---|---|---|
SYMLIST showing incomplete variables |
|
|
Exported variables not available |
|
|
Syntax error in SYMLIST |
|
|