Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

JCL & VSAM :: RE: LISTCAT on a dataset with symbolic parameters

$
0
0
Author: Marso
Posted: Sun Apr 09, 2017 6:43 pm (GMT 5.5)

This is also an option:
Code:
//*-------------------------------------------
//STEP01   EXEC  PGM=SORT                     
//SORTIN   DD    *                           
  LISTCAT LEVEL(ABC.D????)                   
//SORTOUT  DD    DISP=(NEW,PASS),DSN=&LSTC,   
// SPACE=(TRK,(1,1)),UNIT=VIO
//SYSOUT   DD    SYSOUT=*                     
//SYSIN    DD    *                           
  SORT     FIELDS=COPY                       
  INREC    IFTHEN=(WHEN=(22,4,CH,EQ,C'????'),
           OVERLAY=(82:&DATE2,22:84,4))       
  OUTREC   BUILD=(1,80)                       
//*-------------------------------------------
//STEP02   EXEC  PGM=IDCAMS                   
//SYSPRINT DD    SYSOUT=*                     
//SYSIN    DD    DISP=(OLD,DELETE),DSN=&LSTC 
//*-------------------------------------------

1. No need to have a date hardcoded.
2. I didn't find how to get the date as YYMM, so I had to use column 82 trick.
3. It is possible to calculate previous month if necessary.


Viewing all articles
Browse latest Browse all 8500

Trending Articles