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
 
Sorting a Batch of Records using DFSORT

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

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Thu May 31, 2007 7:31 pm    Post subject: Sorting a Batch of Records using DFSORT
Reply with quote

I have the following requirement. Can you please tell me how to sort the records to get the desired output.

I have an input file, in the following format:


1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 3010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 3010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

Each set is a Batch. I need to sort the records in batch wise to the following output .

The sort should be done based on the header(Position 6 to 9 ex. 1010 and 3010)

The output should be as follows,



1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
1AAA 1010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 3010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER

1AAA 3010HEADER
2AAA DETAIL1
2AAA DETAIL2
0AAA TRAILER



Sankar
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 31, 2007 9:14 pm    Post subject:
Reply with quote

You can use the technique discussed in the "Sort groups of records" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm
No new posts batch cobol/db2 paragraph fall thru a... alois eisshofer COBOL Programming 5 Wed Mar 14, 2018 12:21 am

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