Creating PDS from PS Example


Exmample1 -

Scenario - Create PDS member from PS file.

Input PS File - MATEPK.IEBGENER.INPUTPS

----+----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

Code -

----+----1----+----2----+----3----+----4----+----5----+----6
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*****************************************************
//* COPY FLAT FILE DATA INTO THE NEW MEMBER OF PDS
//*****************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.NEWPDS(BACKUPPS),
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10),RLSE),
//            UNIT=3390,VOL=SER=DEVHD4,DSNTYPE=LIBRARY,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN    DD  DUMMY

Output - MATEPK.IEBGENER.OUTPDS(BACKUPPS)

----+----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 maps the input data set (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD specifies the output file as PDS member MATEPK.IEBGENER.NEWPDS(BACKUPPS).
  • SYSIN DD Specifies the control card as DUMMY to identify no control statements are used.

Exmample2 -

Scenario - Copy sequential file records into a new PDS members.

Input PS File - MATEPK.IEBGENER.INPUTPS

----+----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

Code -

----+----1----+----2----+----3----+----4----+----5----+
//MATEPKM  JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//****************************************************
//* COPY SEQUENTIAL FILE DATA TO PDS MEMBER
//****************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPDS,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10,10),RLSE),
//            UNIT=SYSDA,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN    DD  *
  GENERATE MAXNAME=1
    MEMBER NAME=MEMBER5
/*

Output - MATEPK.IEBGENER.OUTPDS(MEMBER5)

----+----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 maps the input PS file (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD defines the output PDS (MATEPK.IEBGENER.OUTPDS).
  • SYSIN DD defines the control card.
  • GENERATE MAXNAME=1 indicates a maximum of one names in subsequent MEMBER statements.
  • MEMBER NAME=MEMBER5 names the member as MEMBER5 and copies the input file data to the member.