I am working on an automation and I have a validation step ,where operation team manually validate few set of GDG file for example Diggi.ax0.tictoc.f1(0) ,Diggi.ax0.tictoc.f2(0),Diggi.ax0.tictoc.f3(0)...Opration team manually check that these files creation data is today date it means current date if it creation date matches the current date operation team take further action. Can anyone help me how we can achieve this using sort or any way.?? I want to automate the one process and this one is one of the validation step that we have to automate.
1) Use a JCL step with PGM=IDCAMS, and LISTCAT control statement.
2) Direct it's output //SYSPRINT into a temporary dataset.
3) Use the temporary dataset as //SORTIN for the PGM=SORT step, to parse the listing from IDCAMS, extract the creation date, and to handle it in any manner.
********************************* TOP OF DATA ********************
TEST.AAA.BBB.EEE.SSS.REPORT 2023164 20230613
TEST.BBB.AAA.REPORT 2018093 20180403
******************************** BOTTOM OF DATA ******************
One must also ensure that only true ACTIVE GDS are being processed, not ROLLED-OFF or DEFERRED ones.
Step by step.
First of all, one needs to understand: how to get the required info by using the standard utilities only. (No need to write any code, though it might be possible as well)
I am able to achieve that but my code length is too I mean my jcl has many steps I want to cut it short. Currently the challeng i am facing is that I only want to know the current version of gdg creation date nothing else and I have 10 files likes that.
Step 2:
//*******************************************************************
//* GET CURRENT VERSION OF THE FILE AND DATE
//*******************************************************************
//SORT03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=VST0.DIGGI.LISTCAT.SORT01
//SORTOUT DD DSN=VST0.DIGGI.LISTCAT.SORT02,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(2,1),RLSE),UNIT=SYSDA,
// DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB)
//SYSIN DD *
INCLUDE COND=(04,7,CH,EQ,C'NONVSAM',OR,37,8,CH,EQ,C'CREATION')
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:17,44),
BEGIN=(1,8,CH,EQ,C'GDG BASE',OR,4,7,CH,EQ,C'NONVSAM'))
SORT FIELDS=(55,8,UFF,D,81,44,CH,D)
OUTFIL ENDREC=1,BUILD=(1:C'DATE=',6:DATE1-1,C' DSN=',81,44,
C' ',80:X)
/*
step 3:
Once i have the current version of gdg name from above step which looks like below
ENV.CQP0045.SORT.STMTRCD1.G1610V00
I use my sorting step to get the current date created on
//*BELOW STEP WILL FETCH OUT THE CREATION DATE OF THE FILE ++**
//***+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&L,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(01,8,CH,EQ,C'GDG BASE',OR,
04,7,CH,EQ,C'NONVSAM',OR,
37,8,CH,EQ,C'CREATION')
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(125:X'01',55,6,UFF,PD,LENGTH=3)),
IFTHEN=(WHEN=(53,2,ZD,LT,20),OVERLAY=(125:X'00'))
OUTFIL INCLUDE=(37,8,CH,EQ,C'CREATION'),
BUILD=(81,44,C' IS CREATED ON : ',125,4,DT1,EDIT=(TTTT-TT-TT))
//*
above step output looks like in spool.
COMMAND ===> SCROLL ==
FILE> DCSQRFSH.JOB02.JOB11048.D0000104.?,2025.111,07:19:57
IS CREATED ON : 2024-04-15
I have challenge to make this whole code short and i want the created date of all the gdg file curretn verison in one file