Thursday, September 7, 2023

How to use Symbolic parameter in JCL SYSIN card and in-stream datasets

 Symbolic parameters can be used in the in-stream datasets. Unlike symbolic substitution in the JCL stream of a job, which is performed by the JCL converter during processing of JCL statements, in-stream symbolic substitution is performed by JES when an in-stream data set is read.

This is achieved by “EXPORT SYMLIST”, “SYMBOLS=JCLONLY” parameters.

Example 1


//TESTJOB JOB….
//*
// EXPORT SYMLIST=*
// SET HLQ1=PG05419
//*
//DELETES EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=JCLONLY
 DELETE &HLQ1..DSN1
 DELETE &HLQ1..DSN2
/*

Example 2

//REALLOC  JOB 1,TESTJOB,    
//          MSGLEVEL=(1,1),CLASS=A
//E1  EXPORT SYMLIST=(DSNAME) 
//E2  EXPORT SYMLIST=(VOLSER)     
//S1  SET    DSNAME=HASP.TEST.MACLIB
//S2  SET    VOLSER=J2COM1
//DEALLIB EXEC PGM=IDCAMS,REGION=300K 
//DD1       DD UNIT=3390,DISP=OLD,VOL=SER=&VOLSER
//SYSPRINT  DD SYSOUT=* 
//SYSIN     DD *,SYMBOLS=JCLONLY 
            DELETE  &DSNAME  
            NONVSAM PURGE SCRATCH FILE(DEVICE)
//*               
//REALLIB EXEC PGM=IKJEFT01,REGION=300K  
//SYSTSPRT  DD SYSOUT=*        
//SYSTSIN   DD *,SYMBOLS=JCLONLY 
            ALLOCATE DSNAME('&DSNAME.') 
            UNIT(3390) VOLUME(&VOLSER.) 
            NEW CATALOG DSNTYPE(LIBRARY)
            SPACE(65,15)  DIR(56)   TRACKS
/*

More information about this facility can be found in  

https://www.ibm.com/docs/en/zos/2.3.0?topic=symbols-using-in-jes-in-stream-data


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.