Copy file from Tape to Disk Example


Scenario - Copy a dataset from a tape volume to a new file on disk.

Input PS File on tape - MATEPK.IEBGENER.INPTAPE

Code -

----+----1----+----2----+----3----+----4----+----5----+
//MATEPKE  JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//******************************************************
//* Copy PS file from Tape to disk
//******************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPTAPE,
//            UNIT=TAPE,LABEL=(,SL),DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPS,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10),RLSE),
//            VOL=SER=DEVHD4,UNIT=3390
//SYSIN    DD DUMMY

Output - MATEPK.IEBGENER.OUTPS

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
E0001    EMPLOYEE1           DIR                 LOC1      0000100000   
E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000   
E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000   
E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000   
E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000   
E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000   
E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000

Explaining Example -

  • SYSUT1 DD specifies the input data set which is on tape (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD specifies the output PS file on disk (MATEPK.IEBGENER.OUTPS).
  • SYSIN DD DUMMY defines the control card as DUMMY.