Hilario G. at IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu> wrote on
07/18/2011 05:18:02 AM:
> I need to obtain an output file of 300 bytes from two differents files:
>
> - FILE1 with a lenght of 80
> - FILE2 with a lenght of 300
>
> I need to merge both files, first FILE1 and after FILE2.
>
> I have several tested but I don't find the correct solution.
>
> The last one  JCL that I used, I only obtain FILE2:
>
> //STEP0001  EXEC  PGM=ICETOOL
> //TOOLMSG  DD SYSOUT=*
> //DFSMSG     DD SYSOUT=*
> //IN1            DD DSN=FILE1,DISP=SHR
> //IN2            DD DSN=FILE2,DISP=SHR
> //OUT           DD DSN=FILE3,SPACE=(CYL,(10,1),RLSE),
> //                 DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
> //                 DCB=(LRECL=300,RECFM=FB)
> //TOOLIN DD *
> COPY  FROM(IN1) TO(OUT) USING(CTL1)
> COPY  FROM(IN2) TO(OUT) USING(CTL2)
> //CTL1CNTL DD *
>   INREC FIELDS=(1,80)
> //CTL2CNTL DD *
>   INREC FIELDS=(1,300)
> /*
>
> Where is the error or how to obtain FILE3 with the combination of
> two different files ?

The correct DFSORT JCL would be:

//STEP0001  EXEC  PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=FILE1,DISP=SHR
//IN2 DD DSN=FILE2,DISP=SHR
//OUT DD DSN=FILE3,SPACE=(CYL,(10,1),RLSE),
//    DISP=(MOD,CATLG,DELETE),UNIT=SYSDA
//TOOLIN DD *
COPY  FROM(IN1) TO(OUT) USING(CTL1)
COPY  FROM(IN2) TO(OUT)
//CTL1CNTL DD *
  INREC OVERLAY=(300:X)
/*

Note the use of MOD for // OUT.  Note also that this is not a "merge" - it
is a "copy".
"Merge" implies that the input files are already in sorted order and the
output
file should be in sorted order.

Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to