The PGP option will not create all the ++OPTION OUTPUT and ++WRITE statements to be written out to a PDS per member with ++INCLUDES expanding.

Document ID : KB000049686
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

How can I copy all the members from my panlib to a PDS where each member is separated with the ++INCLUDES expanded in one single batch job run? The ++INCLUDES are expanded, but all the members are combined into one temp member name within the PDS.

Solution:

PGP will generate the ++WRITE cards, however right now there is not a way to automate the ++OPTION OUTPUT card.

The work around to accomplish this is to create a sequential file containing the ++OPTION OUTPUT along with the ++WRITE WORK statements.

  1. The following REXX routine will take the sequential file from the PGP execution with the +-WRITE WORK, * input statement and generate all the necessary ++OPTION OUTPUT and ++WRITE WORK cards for all the members.
    Below is the REXX routine called PGPOUT:

    "ALLOC DA(" || INPNAME || ") F(SYSTSIN) SHR REU"
    "ALLOC DA(" || OUTNAME || ") F(OUTPUT) OLD REU"
    'MAKEBUF'
    'EXECIO * DISKR SYSTSIN ( finis ) '
    DO QUEUED()
    PARSE PULL LINE
    PARSE VAR LINE 1 17 MEMBER 10.
    WORK='++WRITE WORK,'
    MEMBER=MEMBER
    OPT='++OPTION OUTPUT,PDSOUT,'
    TYP='0'
    TYPE='E'
    OUTLINE=LEFT(OPT,23) || LEFT(MEMBER,48) || LEFT(TYP,8)
    LINE=LEFT(WORK,13) || LEFT(MEMBER,58) || LEFT(TYPE,8)
    'EXECIO * DISKR SYSTSIN ( finis ) '
    PUSH OUTLINE /* PUSH ONTO STACK */
    EXECIO 1 DISKW OUTPUT
    PUSH LINE /* PUSH ONTO STACK */
    EXECIO 1 DISKW OUTPUT
    END
    'EXECIO 0 DISKW OUTPUT ( finis ) '

  2. Then run the three step sample batch job below that will create the PGP sequential file, execute the REXX routine that creates all the ++OPTION OUTPUT and ++WRITE WORK cards for all the members to a new sequential file which is input to the step that executes the actual copy from your panlib library to your PDS.

    //STEP1 EXEC PGM=PAN#2
    //SYSPRINT DD SYSOUT=*
    //PANDD1 DD DISP=SHR,DSN=YOUR.PANLIB.LIBRARY
    //SYSPUNCH DD DSN=YOUR.SEQUENTIAL.FILE,DISP=(,CATLG,DELETE),
    // UNIT=SYSDA,DCB=LRECL=80,SPACE=(CYL,(75,5)),VOL=SER=XXXXXX
    //SYSIN DD *
    ++USING PGP
    +-WRITE WORK,*
    ++PRINT 0-UP
    //STEP2 EXEC PGM=IRXJCL,PARM='PGPOUT' <=== The name of the REXX routine ===>
    //SYSPROC DD DUMMY
    //SYSEXEC DD DSN=YOUR.REXX.LIB,DISP=SHR <=== The location of the REXX routine ===>
    //SYSTSIN DD DSN=YOUR.SEQUENTIAL.FILE,DISP=SHR <=== The name of the sequential file created in step1 ===>
    //OUTPUT DD DSN=YOUR.SEQUENTIAL.FILE,DISP=(,CATLG,DELETE), <== Name of the new sequential file created in the REXX routine ==>
    // UNIT=SYSDA,DCB=LRECL=80,SPACE=(CYL,(75,5)),VOL=SER=XXXXXX
    //SYSPRINT DD TERM=TS,SYSOUT=X
    //SYSTSPRT DD TERM=TS,SYSOUT=X
    //SYSTERM DD TERM=TS,SYSOUT=X
    //STEP3 EXEC PGM=PAN#1
    //PANDD1 DD DSN=YOUR.PANLIB.LIBRARY,DISP=SHR
    //PDSOUT DD DSN=YOUR.PDS.LIBRARY.PDS,DISP=SHR
    //SYSPRINT DD SYSOUT=*
    //SYSPUNCH DD SYSOUT=*
    //SYSIN DD DSN=YOUR.SEQUENTIAL.FILE,DISP=SHR <== Name of the sequential file created in the REXX routine step ==>
    //