View previous topic :: View next topic |
Author |
Message |
js_praveen Beginner
Joined: 09 Jan 2003 Posts: 20 Topics: 7
|
Posted: Wed Jun 11, 2003 8:49 pm Post subject: Change in Record sequence |
|
|
Hi,
I have the following input file
Code: |
Rec type Rec seq
1111 A
1111 B
1111 C
1111 D
1111 E
2222 A
2222 B
2222 C
2222 D
2222 E
|
I have the following output after the sorting it with Rec type acending and Rec seq descending
Code: |
1111 E
1111 D
1111 C
1111 B
1111 A
2222 E
2222 D
2222 C
2222 B
2222 A
|
But I want the output file to be like
Code: |
1111 E
1111 B
1111 D
1111 C
1111 A
2222 E
2222 B
2222 D
2222 C
2222 A
|
I want the records with record seq 'B' to come after record seq 'E' all the time. The rest of the records should follow the sorted order of record seq descending. Is it possible to sort this way? All suggestions are welcome.
Thank you
JSP |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Thu Jun 12, 2003 3:22 am Post subject: |
|
|
JSP,
You can use the following code. (Change the column position for the Record sequence).
Code: |
//STEP EXEC PGM=SORT
//SYSIN DD *
ALTSEQ CODE=(C4C2,C2C4)
SORT FIELDS=(1,1,AQ,D)
/*
//SORTIN DD *
A 1
B 2
C 3
D 4
E 5
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
|
The ALTSEQ will temporarily override the collating sequence. Thus, C4 (D) will 'become' C2 (B) and vice versa. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
js_praveen Beginner
Joined: 09 Jan 2003 Posts: 20 Topics: 7
|
Posted: Thu Jun 12, 2003 2:49 pm Post subject: |
|
|
Thank you Cogito
JSP |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Fri Jun 13, 2003 4:23 am Post subject: |
|
|
You are welcome, JSP. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|