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
 

 

Need help to sort

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

New User


Joined: 03 Aug 2007
Posts: 19
Location: Naperville

PostPosted: Wed Jul 01, 2009 4:28 am    Post subject: Need help to sort
Reply with quote

I want to sort the followin data and get the output as below. I tried muliple ways but couldn't get the results. Can somebody cast some help.

Code:
Input--

11073444177q  ?048 ?           10040000001073444010629027704
11073444177q  ?049 "           10040000001073444010629027704
11073444177q  ?050             10040000001073444010629DB7705
11881838138    027 "           10040000001881838 10620133802
12052637129q  ?001             10040000002052637010630022900
12052637129q  ?002             10040000002052637010630022900
12052637129q  ?003             10040000002052637010630022900
12052637129q  ?004 |           10040000002052637010630022900
12052637129q  ?005 ¬           10040000002052637010630022900
12052637129q  ?006 ?           10040000002052637010630022900
12094308143q  "001             10040000002094308010628024300
12094308143q  "002             10040000002094308010628024300
12094308143q  "003             10040000002094308010628024300
51073444177q  ?999             50049800001073444010629067700
51881838138    999             50040000001881838 10620163800
52052637129q  ?999             50049800002052637010630062900



Code:
Output--

51073444177q  ?999             50049800001073444010629067700
11073444177q  ?048 ?           10040000001073444010629027704
11073444177q  ?049 "           10040000001073444010629027704
11073444177q  ?050             10040000001073444010629DB7705
51881838138    999             50040000001881838 10620163800
11881838138    027 "           10040000001881838 10620133802
52052637129q  ?999             50049800002052637010630062900
12052637129q  ?001             10040000002052637010630022900
12052637129q  ?002             10040000002052637010630022900
12052637129q  ?003             10040000002052637010630022900
12052637129q  ?004 |           10040000002052637010630022900
12052637129q  ?005 ¬           10040000002052637010630022900
12052637129q  ?006 ?           10040000002052637010630022900
12094308143q  "001             10040000002094308010628024300
12094308143q  "002             10040000002094308010628024300
12094308143q  "003             10040000002094308010628024300


I tried sort 2 18 but I got all groups beginning with '1' and then '5' for that. whereas here we want a group that has '5' and then '1's
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: Wed Jul 01, 2009 5:02 am    Post subject:
Reply with quote

You need to explain the "rules" for how you want to sort the records.

How do you determine which records are in a group? By the second and third positions (e.g. 10, 18, 20) or by some other positions (which?).

Which positions do you want to sort by?

Also, what is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
avinashgup

New User


Joined: 03 Aug 2007
Posts: 19
Location: Naperville

PostPosted: Wed Jul 01, 2009 5:59 am    Post subject:
Reply with quote

The RECFM is FB and RECLEN is 430. I have just shown a sample of the records above.

What is expected is to sort the records from 1 to 18 in such a way that for instance record type '5' followed by the number 1073444177 should be on top and then bunch of '1' record types for 1073444177. Similary '5' record type for 1881838138 should be on top and then '1' record types for 1881838138 and so on..

SORT ( 2, 18, A, CH) brings them into a group where '1' record type for 1073444177 comes first followed by '5' record type. Because at location 16 we have the sequence numbers 001 ,002,,etc and this sequence number is always 099 for '5' record type.
But this doesnt solve my purpose.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jul 01, 2009 6:36 am    Post subject:
Reply with quote

Hello,

Try sorting from pos 2 for a length of 10 ascending, from pos 1 for a length of 1 descending, and from pos 16 for a length of 3 ascending.

This will put the "5" first and the others in order by the sequence number within the "control" number.

This will only work if pos 1 is limited to 1 and 5. . .
Back to top
View user's profile Send private message
avinashgup

New User


Joined: 03 Aug 2007
Posts: 19
Location: Naperville

PostPosted: Wed Jul 01, 2009 7:48 am    Post subject:
Reply with quote

Thanks.. that worked like magic...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jul 01, 2009 8:50 am    Post subject: Reply to: Need help to sort
Reply with quote

You're welcome - good to hear it is working icon_smile.gif

Thanks for letting us know,

d
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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