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
 

 

Sorting a file with different record layouts

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

New User


Joined: 08 Sep 2005
Posts: 16

PostPosted: Mon Jun 30, 2008 2:11 pm    Post subject: Sorting a file with different record layouts
Reply with quote

I have to sort one file , but it has 2 type of record layout in a file.
One has record indent (602), account number.(other fields are no impt)
The second has record indent (603), account number and date.(other fields are no impt)

I have to sort in the below format :
602 1234567 AAAAAA
603 1234567 20080503
602 1234568 AAAAAA
603 1234568 20080504


But the problem is since there is no date field in 602, if the account numbers and record indent are same then the output file will have a different output.
Please let me know if you have any sort utility in JCL which can solve this problem.
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jun 30, 2008 3:20 pm    Post subject:
Reply with quote

Quote:
I have to sort in the below format :
602 1234567 AAAAAA
603 1234567 20080503
602 1234568 AAAAAA
603 1234568 20080504


Is this what the output should look like? If so, a simple sort on ident within account no. should do. Assuming that there are no spaces -

SORT FIELDS=(4,7,CH,A,1,3,CH,A)

Regards,
Garry.
Back to top
View user's profile Send private message
Prathap Pillai P

New User


Joined: 08 Sep 2005
Posts: 16

PostPosted: Mon Jun 30, 2008 4:04 pm    Post subject: Sorting a file with different record layouts
Reply with quote

Hi Garry Carroll,

In Sorting on account number and record ident , the problem is when the account number and record ident are same then out put will be wrong

That is
if the input is :
602 1234567 AAAAAA
603 1234567 20080504
602 1234567 AAAAAA
603 1234567 20080503

The desired output is :
602 1234567 AAAAAA
603 1234567 20080503
602 1234567 AAAAAA
603 1234567 20080504

But if i sort it on account number & record ident
602 1234567 AAAAAA
602 1234567 AAAAAA
603 1234567 20080504
603 1234567 20080503
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jun 30, 2008 4:36 pm    Post subject:
Reply with quote

Where you have the same account and ident for different dates, how can you tell which 602 relates to which 603? I don't think this can be done as outlined.

Garry.
Back to top
View user's profile Send private message
Prathap Pillai P

New User


Joined: 08 Sep 2005
Posts: 16

PostPosted: Mon Jun 30, 2008 5:09 pm    Post subject: Sorting a file with different record layouts
Reply with quote

Hi Garry Carroll,

For every occurence of 602 , there will be one 603.
But if the 602 has the same account number more than once, then sorting is an issue.
If you have any solution for this please let me know
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jun 30, 2008 5:27 pm    Post subject:
Reply with quote

As I said, unless you can show some way to show which 602 relates to which 603 , I don't think this can be done.

Is there a 603 for every 602 (and vice-versa)? Does the 603 always follow its related 602 in the input? If so, you might add sequence numbers (SEQNUM) for purposes of the sort, removing them after sorting. This way, you establish a relationship between the 602 and 603. The sort would then sort on account, seqnum and ident.


Regards,
Garry.[/code]
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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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