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 

Seqnum Help

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


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu Dec 16, 2010 11:52 am    Post subject: Seqnum Help Reply with quote

Hello Gurus,

Could you help me out on this please?

There are multiple block headers with detail records in my file. I need some information from the header onto its detail records.

Quote:
INPUT:

HDR1.......34
HDR2...
Det1
Det2
Det3
EOF2
EOF1
HDR1........45
HDR2...
Det1
Det2
Det3
EOF2
EOF1


Quote:
Output:
HDR1.......34
HDR2...
Det134
Det234
Det334
EOF2
EOF1
HDR1........45
HDR2...
Det145
Det245
Det345
EOF2
EOF1

Regards,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 16, 2010 11:58 am    Post subject: Reply with quote

relaxing,

Assuming your input is FB and LRECL of 80, the following DFSORT JCL will give you the desired results. I also assumed that your each group is identified by 'hdr1' in first 4 bytes.
Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
----+----1----+----2----+----3----+----4----+----5----+----6---
HDR1.......34                                                 
HDR2...                                                       
DET1                                                           
DET2                                                           
DET3                                                           
EOF2                                                           
EOF1                                                           
HDR1.......45                                                 
HDR2...                                                       
DET1                                                           
DET2                                                           
DET3                                                           
EOF2                                                           
EOF1                                                           
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  INREC IFOUTLEN=80,                                           
  IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'HDR1'),PUSH=(81:12,2)),
  IFTHEN=(WHEN=(1,3,SS,NE,C'HDR,EOF'),OVERLAY=(5:81,2))       
//*

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


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu Dec 16, 2010 12:16 pm    Post subject: Reply with quote

Thanks a lot Kolusu...I was not even aware of GROUP and PUSH !
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 16, 2010 12:28 pm    Post subject: Reply with quote

relaxing wrote:
Thanks a lot Kolusu...I was not even aware of GROUP and PUSH !


Well WHEN=GROUP feature was introduced in July, 2008, it is not new at all. You need to keep up with the latest enhancements. There are 2 new PTF's after that.

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242

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


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu Dec 16, 2010 12:30 pm    Post subject: Reply with quote

Thanks Kolusu.
Back to top
View user's profile Send private message
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu Dec 23, 2010 1:27 pm    Post subject: Reply with quote

Kolusu, my second step is to extract only detail records. I have done a simple include condition to do this but was wondering if it could be done in the same step
Back to top
View user's profile Send private message
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Thu Dec 23, 2010 1:42 pm    Post subject: Reply with quote

Kolusu, I just realized we could use outfil include to do this in one step.
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