How to extract GDG G0000v00 number from %ESPTRDSN symbolic variable
search cancel

How to extract GDG G0000v00 number from %ESPTRDSN symbolic variable

book

Article ID: 135075

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

When using DSTRIG and creating a GDG dataset, how can I retrieve the generation number, and use it as a variable in the JCL of the triggered jobs? 

 

 

Environment

Release : 11.4

Component : ESP WORKLOAD AUTOMATION

Resolution

1) Add the following to ESP Proc:

INTEGER X

X=LENGTH(ESPTRDSN)

GEN='%ESPTRDSN(%X-7:%X-0)'

 

2) Update JCL with symbolic variable GEN created above:




//STEP1 EXEC PGM=IEBGENER,REGION=4000K
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=HLQ.GDG.DATASET.ONE.%GEN   
//SYSIN DD DUMMY
//SYSUT2 DD DISP=(NEW,CATLG,DELETE),
// DSN=HLQ.GDG.DATASET.TWO(+1),
// SPACE=(CYL,(1,1),RLSE),
// UNIT=SYSDA,
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY     


EXAMPLE of OUTPUT when job executed:

 

//STEP1 EXEC PGM=IEBGENER,REGION=4000K  
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=HQL.GDG.DATASET.ONE.G0021V00   
//SYSIN DD DUMMY
//SYSUT2 DD DISP=(NEW,CATLG,DELETE),
// DSN=HLQ.GDG.DATASET.TWO(+1),
// SPACE=(CYL,(1,1),RLSE),
// UNIT=SYSDA,
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY