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
 
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: 10327
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Information About the Equifax Securit... Rohit Umarjikar PC Guides & IT News 6 Mon Sep 11, 2017 9:10 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts retrieving envelope information out o... VintageReceiver TSO/ISPF 6 Thu Aug 10, 2017 8:13 pm

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