Do you truly mean "merge"? That implies that the records have some sort
of key field(s) and you want to interleave the records in the two files
together based on the key(s). Or do you mean "concatenate" as in create
a new file will all the records of the first file, in their current
order, followed by all the records of the second file, in their current
order? It seems, to me based on your example JCL, you want to
concatenate with an output of 300 bytes. Do you want to pad the 80 byte
records with blanks or x'00's or some other character? 

You're very close! In the CTL1CNTL use the OUTREC command to make the 80
byte records 300 bytes by padding. Something like:

//CTL1CNTL DD *
 OUTREC FIELDS=(1,80,220X)
/*

On Mon, 2011-07-18 at 07:18 -0500, Hilario G. wrote:
> Hello folks,
> 
> 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 ?
> 
> Kind Regards
> 
> Hilario Garcia
> 
> ----------------------------------------------------------------------
> 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
-- 
John McKown
Maranatha! <><

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