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
 

 

Sort header records keeping the details constant

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

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Wed Jun 20, 2012 6:10 pm    Post subject: Sort header records keeping the details constant
Reply with quote

Hi,

I have the requirement as below.

REC FM - FB, LRECL = 80

the input records will be like this. Header is located as '04500' starting (2,5) for all these records the key is located at (42,11). The corresponding detail records will have '04510' in second position

Here for first header the key is 06001014683.

Code:


|04500|00001|2012-06-18 21:09:43|A|00312|06001014683|2012-06-18|00415|0
|04510|00001|2012-06-18 21:09:43|A|00411|000000001043464342|00000000104
|04510|00001|2012-06-18 21:09:43|A|00411|000000001043464412|00000000104
|04510|00001|2012-06-18 21:09:43|A|00411|000000001043462145|00000000104
|04500|00001|2012-06-18 21:09:44|A|00312|06001014674|2012-06-18|00201|0
|04510|00001|2012-06-18 21:09:44|A|00411|000000001043464275|00000000104
|04510|00001|2012-06-18 21:09:44|A|00411|000000001043464279|00000000104
|04510|00001|2012-06-18 21:09:44|A|00411|000000001043462092|00000000104
and so on...


I need to sort the headers on its key (42,11) and the corresponding detail records should not be changed in either order and the link between the original header its detail records should be the same.

Can someone please try to help on this?

Regards
Amar
Back to top
View user's profile Send private message

Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed Jun 20, 2012 6:19 pm    Post subject:
Reply with quote

Hello Amar,

What did you try and where did you fail (if you tried)?

Hint #1: Search the forum. This is recently discussed and who knows you might get a custom-made solution.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Wed Jun 20, 2012 6:27 pm    Post subject:
Reply with quote

Hi,

I got this by the below try after reading thru the manual. Thank you.

INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,5,CH,EQ,C'04500'),
PUSH=(80:42,11))
SORT FIELDS=(80,11,CH,A),EQUALS
OUTFIL BUILD=(1,80)

Regards
Amar
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed Jun 20, 2012 6:36 pm    Post subject:
Reply with quote

Thats a good try... Thanks for letting us know.

FYI, you have LRECL=80, so PUSH the key to position '81'.

I hope that helps.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Wed Jun 20, 2012 7:05 pm    Post subject:
Reply with quote

Hi,

Thank you. I actually had it 81 in my code. Here I posted it wrong.

But thanks for the correction.

Regards
Amar
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jun 20, 2012 9:38 pm    Post subject:
Reply with quote

V S Amarendra Reddy,

"Sort groups of records" is one of the many Smart DFSORT tricks shown here

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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