Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Merge Header and trailer Records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vsrao_2k

New User


Joined: 12 Dec 2005
Posts: 13

PostPosted: Tue Jan 26, 2010 12:11 am    Post subject: Merge Header and trailer Records
Reply with quote

Hi Frank,

I am having a flat file of length 80(LRECL). I am having Header,Trailer and detailed records in the file of same length. I want the date from header record + No.of records from the trailer record. How to do this using ICETOOL?

I have included INCLUDE COND(1,3,CH,EQ,C'PID',OR,
1,3,CH,EQ,C'TRL') which will filter Header and trailer records.

But I want header record date which is at 10,6 + Total no.of records from trailer record 10,6 in the same record in the output file.

Please suggest me.

Thanks
Sreenivas.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Jan 26, 2010 12:39 am    Post subject:
Reply with quote

Please post a sample of your input and what you want the output to look like.
Please post lrecl and recfm of the input and output.
Back to top
View user's profile Send private message
vsrao_2k

New User


Joined: 12 Dec 2005
Posts: 13

PostPosted: Tue Jan 26, 2010 1:05 am    Post subject: Reply to: Merge Header and trailer Records
Reply with quote

Input file: LRECL=80 and RECFM=FB
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+-
PID=STCA 100122 START   3.0.0                   -->header record
S0000990390011350006 428418102   ASUPVS4111111111111111   
S0000990390011350006 428418102   ASUPVS4111111111111111   
S0000990390017580002 968189005   ASUPVS5111111111111111   
S0000990390001780000 132618703   ASUPVS8111111111111111   
S0000990390011350006 528418102   ASUPVS4111111111111111   
S0000990390017580002 111189005   ASUPVS5111111111111111   
S0000990390001780000 132618703   ASUPVS7111111111111111   
S0000990390011350006 428434321   AsUPVS4111111111111111   
S0000990390017580002 968189005   ASUPVS5111111111111111   S0000990390001780000 192618703   AsUPVS6111111111111111--->detailed records
TRL=ENDS 000010 ------------->trailer record   

OUTPUT file: LRECL=80 and RECFM=FB
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+-
100122 000010
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Jan 26, 2010 1:40 am    Post subject:
Reply with quote

Will there be multiple sets of HDR/DETAIL/TRL groups in a single input?
Back to top
View user's profile Send private message
vsrao_2k

New User


Joined: 12 Dec 2005
Posts: 13

PostPosted: Tue Jan 26, 2010 2:05 am    Post subject: Reply to: Merge Header and trailer Records
Reply with quote

No. There is be always only header and one trailer record will be available in the file. But Detailed records will be N.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 26, 2010 2:45 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
   OPTION COPY
   INCLUDE COND=(1,3,SS,EQ,C'PID,TRL')
   INREC IFOUTLEN=80,
    IFTHEN=(WHEN=(1,3,CH,EQ,C'PID'),
     BUILD=(10,6)),
    IFTHEN=(WHEN=NONE,BUILD=(8:10,6))
   OUTREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,6))
   OUTFIL STARTREC=2,ENDREC=2
/*
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Jan 26, 2010 3:24 am    Post subject:
Reply with quote

Even this sort card will do too
Code:

//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INCLUDE COND=(1,3,SS,EQ,C'PID,TRL')                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'PID'),PUSH=(81:10,6))   
  OUTFIL BUILD=(81,6,X,10,6),INCLUDE=(1,3,CH,EQ,C'TRL')               
/*                                                                     
Back to top
View user's profile Send private message
vsrao_2k

New User


Joined: 12 Dec 2005
Posts: 13

PostPosted: Tue Jan 26, 2010 3:15 pm    Post subject: Reply to: Merge Header and trailer Records
Reply with quote

Thank you. Both solutions are working good. Thanks once again.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us