IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sorting a Batch of Records using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

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

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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top