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

Update Header using information from Trailer


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 01, 2012 2:48 pm
Reply with quote

You got the answer for Your question here ( You started the topic )
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
Search our Forums:

Back to Top