View previous topic :: View next topic
|
Author |
Message |
RedDevil711
New User
Joined: 04 Jun 2010 Posts: 25 Location: Pune
|
|
|
|
Sample specific user data
Record is as follows:
L145757377737
L24575737783DEFG
L3457573772916200101
L3457573780536200102
L3457573779476200103
L145757377
L245757377811ABCD
L3457573779646200105
L3457573779646200104
L3457573779646200106
Now we have a request to sort only records beginning with notifier L3 in ascending based on record position 17-3..ie.e
for record L3457573779646200106
sort based on last 3 digits '106'
is such specific sorting possible ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Show the actual output you want from the posted sample input.
Mention the recfm and lrecl of the files. |
|
Back to top |
|
|
RedDevil711
New User
Joined: 04 Jun 2010 Posts: 25 Location: Pune
|
|
|
|
Hi,
Provided with such an input file record data:
L145757377737
L24575737783DEFG
L3457573772916200101
L3457573780536200102
L3457573779476200103
L145757377
L245757377811ABCD
L3457573779646200105
L3457573779646200104
L3457573779646200106
The actual output file data should be as follows :
L145757377737
L24575737783DEFG
L3457573772916200101
L3457573780536200102
L3457573779476200103
L145757377
L245757377811ABCD
L3457573779646200104
L3457573779646200105
L3457573779646200106
note how the part of record highlighted in red changes in order
based on the value of the last three digits from input file
The file is of LRECL = 80 , RECFM is FB
and the last three fields are populated only for a record whose qualifier begins with "L3".Let me know if u need any other inputs |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
Hi, what i wanna know is whether you just need a inner sort for each group of 'L3' records, or a global sort for all 'L3' records and dispose the ordered 'L3' records in the original 'L3' positions.
e.g.
input file records:
L145757377737
L24575737783DEFG
L3457573772916200101
L3457573779646200104
L3457573780536200102
L145757377
L245757377811ABCD
L3457573779646200105
L3457573779476200103
L3457573779646200106
output file records:
L145757377737
L24575737783DEFG
L3457573772916200101
L3457573780536200102
L3457573779476200103
L145757377
L245757377811ABCD
L3457573779646200104
L3457573779646200105
L3457573779646200106 |
|
Back to top |
|
|
RedDevil711
New User
Joined: 04 Jun 2010 Posts: 25 Location: Pune
|
|
|
|
Hi ,
I need an sort on individual 'L3' group of records under one 'L2'
Not the entire global sort on 'L3' group |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Did you read and follow the "how to" that Skolusu provided for you?
If not, why not. . .
If you did, what happened? |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
Hi, dick, I think there's some diference between this trick and Devil's problem, since we must keep non-L3 records in order...
Hi, Devil, can you make sure the 17-3 content of non-L3 records are spaces, if so, I think we can add a high value to this positions temporarily(change it back after sort with IFTHEN) and then employ the 'Sort groups of records' to fulfill that, don't forget OPTION EQUALS! |
|
Back to top |
|
|
|