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: 200
Location: USA

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: 200
Location: USA

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: 200
Location: USA

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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


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