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
 

 

Update Header using information from Trailer

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

New User


Joined: 24 Jul 2007
Posts: 55
Location: noida

PostPosted: Thu Mar 01, 2012 2:34 pm    Post subject: Update Header using information from Trailer
Reply with quote

Hi,

My requirement is to Split 1 file into 2 files based on Code appearing at last 2 bytes. either A1 or A2. Input file has Header and trailer also.

COUNT of Detail records is appearing in Header and Trailer and is equal.

Below is the Input file
Code:
HEADER20120202FILENAME00000005
1111111111111111111111111111111111111A1
2222222222222222222222222222222222222A1
3333333333333333333333333333333333333A1
4444444444444444444444444444444444444A2
5555555555555555555555555555555555555A2
TRAILER00000005


Here '00000005' appearing in header ad Trailer is the COUNT of detail records.


OutPut Expected

FILE 1
Code:
HEADER20120202FILENAME00000003
1111111111111111111111111111111111111A1
2222222222222222222222222222222222222A1
3333333333333333333333333333333333333A1
TRAILER00000003

FILE2
Code:
HEADER20120202FILENAME00000002
4444444444444444444444444444444444444A2
5555555555555555555555555555555555555A2
TRAILER00000002



I am able to create 2 output file based on Code appearing at 79th and 80th pos (2 char) and write TRAILER as well.


Code:
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  OUTFIL FNAMES=OUT1,                                         
    INCLUDE=(1,6,CH,EQ,C'HEADER',OR,79,2,CH,EQ,C'A1'),       
    TRAILER1=('TRAILER',COUNT-1=(M11,LENGTH=8)),REMOVECC     
                                                             
  OUTFIL FNAMES=OUT2,                                         
    INCLUDE=(1,6,CH,EQ,C'HEADER',OR,79,2,CH,EQ,C'A2'),       
    TRAILER1=('TRAILER',COUNT-1=(M11,LENGTH=8)),REMOVECC     

But unable to Update the COUNT in Header. Information appearing in Header should be same in both Output files, except the COUNT will be updated to indicate no. of records written in each Output File.


Can anyone please help ?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Thu Mar 01, 2012 2:48 pm    Post subject: Reply to: Update Header using information from Trailer
Reply with quote

You got the answer for Your question here ( You started the topic )
http://www.ibmmainframes.com/viewtopic.php?t=57659

the fact that the left part of the data is slightly different should not prevent You
from trying to modify the snippet to suit the new record layout ...

the tricky part is syncronizing the headers and the trailer , and Kolusu took care of that
handling the data part should be easy enough
if You cannot/do not want to do that meditate about Your skills and Your willingness to learn
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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
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


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