IBM Z and LinuxONE Software

Software

Software

In order to compete you have to be trusted. System software delivers high-performing system and database management, faster insights, secure cloud and agile DevOps, plus the reliability, flexibility and protection you expect from the mainframe.

 View Only
  • 1.  JCL/ICETOOL - Concatenate Datasets

    Posted Fri October 04, 2024 07:59 PM

    Hi,

    Is there any way to use the output files generated in a step to be also used as input in the same step?

    I had to create two steps as following:

    //PS040    EXEC PGM=ICETOOL
    //TOOLMSG  DD SYSOUT=*
    //DFSMSG   DD SYSOUT=*
    //MAXLRECF DD DSN=&&MAXLRECF,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //DSNAMEO  DD DSN=&&DSNAMEO,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //UNQKEYO  DD DSN=&&UNQKEYO,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))

    //PS050    EXEC PGM=ICETOOL,
    //             PARM='JP0"&PFIX"'
    //TOOLMSG  DD SYSOUT=*
    //DFSMSG   DD SYSOUT=*
    //INFILE   DD DSN=&&DSNAMEO,
    //            DISP=(OLD,DELETE)
    //         DD DSN=&&MAXLRECF,
    //            DISP=(OLD,DELETE)
    //         DD DSN=&&UNQKEYO,
    //            DISP=(OLD,DELETE)
    //OUTFILE  DD DSN=&&OUTFILE,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))

    Thank you for any assistance with this matter.



    ------------------------------
    Girish Sajja
    ------------------------------


  • 2.  RE: JCL/ICETOOL - Concatenate Datasets

    Posted Mon October 07, 2024 01:25 AM
    Edited by Sri Hari Kolusu Mon October 07, 2024 01:25 AM

    Hi Girish,

    It is quite simple to refer to the same output datasets as input datasets within the same step using VOL=REF, however you also are risking loss of data.   See the example below as to how to concatenate the datasets.

    However you also need to pay attention to this 2nd bullet point 

    https://www.ibm.com/docs/en/zos/3.1.0?topic=limitations-general-considerations

    Be aware that, in some cases, if a DD statement specifies a data set for output that is extended to a second or subsequent volume, and another DD statement within the same step requests the same data set, only the records on the first volume will be read, and incorrect output will result.

    So if you had shown your toolin statements then may be we could suggest you an alternative way to get the desired results without having to concatenate the datasets.  (No Promises though)

    //PS040    EXEC PGM=ICETOOL
    //TOOLMSG  DD SYSOUT=*
    //DFSMSG   DD SYSOUT=*
    //MAXLRECF DD DSN=&&MAXLRECF,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //DSNAMEO  DD DSN=&&DSNAMEO,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //UNQKEYO  DD DSN=&&UNQKEYO,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //*
    //CONCAT   DD DSN=*.DSNAMEO,VOL=REF=*.DSNAMEO,DISP=(OLD,PASS)
    //         DD DSN=*.MAXLRECF,VOL=REF=*.MAXLRECF,DISP=(OLD,PASS)
    //         DD DSN=*.UNQKEYO,VOL=REF=*.UNQKEYO,DISP=(OLD,PASS)
    



    ------------------------------
    Sri Hari Kolusu
    ------------------------------



  • 3.  RE: JCL/ICETOOL - Concatenate Datasets

    Posted Mon October 07, 2024 07:57 PM
    Edited by Venkatachalapathi . Tue October 08, 2024 12:29 AM





  • 4.  RE: JCL/ICETOOL - Concatenate Datasets

    Posted Fri October 11, 2024 06:27 PM

    Hi,

    The suggestion did work.   The following is the modified JCL:

    //PS040    EXEC PGM=ICETOOL,
    //             PARM='JP0"&PFIX"'
    //TOOLMSG  DD SYSOUT=*
    //DFSMSG   DD SYSOUT=*
    //AIXDATA  DD DSN=&&SYSPRINT,
    //            DISP=(OLD,DELETE)
    //AIXOUT   DD DSN=&&AIXOUT,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //MAXLRECL DD DSN=&&MAXLRECL,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //MAXLRECF DD DSN=&&MAXLRECF,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //DSNAMEO  DD DSN=&&DSNAMEO,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //UNQKEYO  DD DSN=&&UNQKEYO,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //TOOLIN   DD DSN=&CTLFILE(BTBAIX03),
    //            DISP=SHR
    //         DD DSN=&CTLFILE(BTBAIX09),
    //            DISP=SHR
    //AIXDCNTL DD DSN=&CTLFILE(BTBAIX04),
    //            DISP=SHR
    //MAXLCNTL DD DSN=&CTLFILE(BTBAIX05),
    //            DISP=SHR
    //MAXFCNTL DD DSN=&CTLFILE(BTBAIX06),
    //            DISP=SHR
    //DSNFCNTL DD DSN=&CTLFILE(BTBAIX07),
    //            DISP=SHR
    //UNIFCNTL DD DSN=&CTLFILE(BTBAIX08),
    //            DISP=SHR
    //OUTFCNTL DD DSN=&CTLFILE(BTBAIX10),
    //            DISP=SHR
    //FMNOCNTL DD DSN=&CTLFILE(BTBAIX11),
    //            DISP=SHR
    //JCLICNTL DD DSN=&CTLFILE(BTBAIX16),

    //            DISP=SHR
    //INFILE   DD DSN=*.DSNAMEO,
    //            VOL=REF=*.DSNAMEO,
    //            DISP=(OLD,PASS)
    //         DD DSN=*.MAXLRECF,
    //            VOL=REF=*.MAXLRECF,
    //            DISP=(OLD,PASS)
    //         DD DSN=*.UNQKEYO,
    //            VOL=REF=*.UNQKEYO,
    //            DISP=(OLD,PASS)
    //OUTFILE  DD DSN=&&OUTFILE,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //AIXDATA2 DD DSN=&&AIXDATA2,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15))
    //AIXDATAP DD SYSOUT=*
    //STEPCNT  DD SYSOUT=*

    //FMNOUTPT DD DSN=&&FMNOUTPT,
    //            DISP=(,PASS),
    //            SPACE=(TRK,(255,15)),
    //            DATACLAS=COMPZEDC

    The following are the TOOLIN inputs:

    * BTBAIX03
      COPY    FROM(AIXDATA)  TO(AIXOUT)        USING(AIXD)

      COPY    FROM(AIXOUT)   TO(MAXLRECL)      USING(MAXL)

      COPY    FROM(MAXLRECL) TO(MAXLRECF)      USING(MAXF)

      COPY    FROM(AIXOUT)   TO(DSNAMEO)       USING(DSNF)

      COPY    FROM(AIXOUT)   TO(UNQKEYO)       USING(UNIF)

    * BTBAIX09
      COPY    FROM(INFILE)   TO(OUTFILE)   USING(OUTF)

      SPLICE FROM(OUTFILE) WITHANY       -
             ON(1,3,ZD)                  - ID
             WITH(50,7)                  - MAXLRECL
             WITH(58,10)                 - NONUNIQKEY
        TO(AIXDATA2)

      COPY    FROM(AIXDATA2) TO(AIXDATAP)

      COPY    FROM(AIXDATA2) TO(FMNOUTPT)  USING(FMNO)

      COUNT   FROM(FMNOUTPT) WRITE(STEPCNT)      USING(JCLI)   -
        TEXT('TOTAL JOB STEPS ') DIGITS(3) RC4 HIGHER(255) ADD(4)

    Thank you very much.



    ------------------------------
    Girish Sajja
    ------------------------------



  • 5.  RE: JCL/ICETOOL - Concatenate Datasets

    Posted Tue October 15, 2024 08:23 AM

    Girish,

    Glad to hear that you got it working , but remember if your intermediate data flows to more than volume, then you will risk lose of data. 

    SPLICE is an older technique to match as you can use Joinkeys to match and merge the files. This will eliminate the need for concatenating the temp datasets. 

    Apart from your toolin statements I would also need the XXXXCNTL  datasets which prepare the data to be spliced to convert them to joinkeys job. 

    send me an offline email if you do not want to share them in a public forum





    ------------------------------
    Sri Hari Kolusu
    ------------------------------



  • 6.  RE: JCL/ICETOOL - Concatenate Datasets

    Posted Mon October 07, 2024 07:57 PM
    Edited by Venkatachalapathi . Tue October 08, 2024 12:31 AM