MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple header and trailer update

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Wed Feb 15, 2012 9:03 am    Post subject: Multiple header and trailer update Reply with quote

I have file with below format
Code:

00 AAAAAA
01 123456
01 123457
01 123458
99 AAAAAA
00 BBBBBB
01 987654
01 987653
99 BBBBBB

The firts two bytes shows the record type
Code:

00 - Header
01 - Detail record
99 - Trailer

I want to update each subsequent set of header and trailer with same sequence number.
like as shown below
Code:

00 AAAAAA001
01 123456
01 123457
01 123458
99 AAAAAA001
00 BBBBBB002
01 987654
01 987653
99 BBBBBB002

Please let me know how can this be done through Dfsort.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Feb 15, 2012 11:18 am    Post subject: Reply with quote

psmadhusudhan,

You can use the following DFSORT control cards

Code:

//SYSIN    DD *                                                 
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'00'),OVERLAY=(10:SEQNUM,3,ZD)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'99'),OVERLAY=(10:SEQNUM,3,ZD))
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Mon Feb 20, 2012 8:09 am    Post subject: Reply with quote

Thanks kolusu
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group