IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

3 files concatenated to 1


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jimsnow

New User


Joined: 20 Feb 2023
Posts: 9
Location: us

PostPosted: Fri Nov 15, 2024 6:19 am
Reply with quote

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!
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Fri Nov 15, 2024 10:36 am
Reply with quote

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. icon_idea.gif
Back to top
View user's profile Send private message
jimsnow

New User


Joined: 20 Feb 2023
Posts: 9
Location: us

PostPosted: Fri Nov 15, 2024 7:10 pm
Reply with quote

Thank you, Joerg - this worked perfectly. I appreciate this forum, and I appreciate you!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files and write Matched/Unm... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top