Copy PS Data to fixed-length ESDS Example


Scenario - Copy the data from the PS file to fixed-length ESDS.

Input - MATEGJ.TEST.DATA

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//MATEGJR JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//************************************************
//* LOADING DATA TO ESDS
//************************************************
//STEP01   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//INPUT    DD   DSNAME=MATEGJ.TEST.DATA,DISP=SHR
//OUTPUT   DD   DSNAME=MATEGJ.TEST.ESDS,DISP=SHR
//SYSIN    DD   *
      REPRO    -
           INFILE(INPUT)   -
           OUTFILE(OUTPUT)
/*

In the above JCL, MATEGJ.TEST.DATA is the flat file and MATEGJ.TEST.ESDS is the ESDS file.

Output -

Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, ESDS successfully loaded with data from PS.

loading ESDS Output

Verify the ESDS in 3.4 (Dataset List utility) or any File management tools.

loading ESDS Output

Explaining Example -

In the above example, all the records from the MATEGJ.TEST.DATA (flat file of length 47) file copied to MATEGJ.TEST.ESDS(ESDS file of length 47) file.