View previous topic :: View next topic
|
Author |
Message |
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
Hi,
I have a key file.
Code: |
Key1 Name City
AAB1 XCVB NewJ
AAB1 XCVB Aust
AAB1 XACB India
AAB1 XACB Aust
AAC1 XCVA Engl
AAC1 XCVD Aust
AAC1 XACC Cert
I have sort the file based on Name and City inside each key.
For Example for the key (AAB1) the name should be sorted first and then based on city.
Output should be:
Key1 Name City
AAB1 XACB Aust
AAB1 XACB India
AAB1 XCVB Aust
AAB1 XCVB NewJ
AAC1 XACC Cert
AAC1 XCVA Engl
AAC1 XCVD Aust
|
Thanks in Advance,
Venkat |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Specify three fields in your sort key. If that does not get it for you, you'll have to do a btter job of explaining. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
actually you only need one field in the sort key - the field length would would be the total length of key1 + Name + City
since the fields are contiguous. |
|
Back to top |
|
|
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
Hi,
If I give just the sort key i will get the output as. I have to sort records for a key1 (which can occur multiple time) and then based on Name and City for each record.
Code: |
Key1 Name City
AAB1 XACB Aust
AAB1 XACB India
AAC1 XACC Cert
AAC1 XCVA Engl
AAB1 XCVB Aust
AAB1 XCVB NewJ
AAC1 XCVD Aust
|
Thanks,
Venkat B.
[/code] |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you show the control cards, jcl and sysout which produced your file in that order please? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Quote: |
think of this comment as post which should be deleted.
_________________
Dick Brenholtz |
patched back in from erroneously deleted post d
Considered so, dbz.
If you don't get it, venkatatcts, we just don't believe you. We think you have your own idea about what DFSORT would do with your data, and then you expect us to provide a solution for how you think it works, not for how it actually works.
Read, code and test with the earlier advice. If you still have problems, show all the stuff previously asked for what you have tried. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I should have read thru to the end before deleting the post from DBZ. . .
It has been patched back into Bill's reply. . .
Quote: |
If I give just the sort key i will get the output as. |
Post where you found this in some IBM manual or post the jcl/sort control statements and the informational messages printed for the running of this. Show the actual output file created from this test data.
Your input data fields Are contiguous, right? |
|
Back to top |
|
|
|