jimsnow
New User
Joined: 20 Feb 2023 Posts: 9 Location: us
|
|
|
|
I need to combine 3 separate files into 1:
HEADER.FILE.IN: a single FB 3200 byte record (delimited column headers)
DETAIL.FILE.IN: contains many (millions) 850 byte records, defined as FB, but actual LREL ranges from 400-700 bytes after SQZ (delimited fields)
TRAILER.FILE.IN: a single FB 28 byte record (containing the date & record count)
My goal is to combine these to a single VB file using DFSORT/ICETOOL. Can be a single or multiple steps, only "requirement" is the header record is first and the trailer record is last (order of detail records is not important).
Any help/suggestions are greatly appreciated. I have used FTOV with VLTRIM previously, but am challenged with the 3 different input files.
Thank you! |
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Try this snippet:
Code: |
//ICETOOL EXEC PGM=ICETOOL
//HDR DD DISP=SHR,DSN=&SYSUID..HDR <* FB;3200
//DTL DD DISP=SHR,DSN=&SYSUID..DTL <* FB;850
//TRL DD DISP=SHR,DSN=&SYSUID..TRL <* FB;28
//OUT DD DSN=&SYSUID..OUT, <* VB;3204
// DISP=(MOD,CATLG,DELETE),UNIT=SYSALLDA,
// SPACE=(TRK,(2,1),RLSE),
// DSORG=PS,RECFM=VB,LRECL=3204,BLKSIZE=0
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(HDR) USING(FTOV)
COPY FROM(DTL) USING(FTOV)
COPY FROM(TRL) USING(FTOV)
/*
//FTOVCNTL DD *
OPTION COPY
OUTFIL FNAMES=(OUT),
FTOV
END
/* |
Alternative, just copy the DTL records and recreate HDR/TRL records with HEADER1 and TRAILER1 statements. |
|