Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Can we merge these two sort cards int... abdulrafi JCL & VSAM 2 Thu Mar 08, 2018 4:03 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us