MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Change in Record sequence

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
js_praveen
Beginner


Joined: 09 Jan 2003
Posts: 20
Topics: 7

PostPosted: Wed Jun 11, 2003 8:49 pm    Post subject: Change in Record sequence Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jun 12, 2003 3:22 am    Post subject: Reply with quote

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
View user's profile Send private message
js_praveen
Beginner


Joined: 09 Jan 2003
Posts: 20
Topics: 7

PostPosted: Thu Jun 12, 2003 2:49 pm    Post subject: Reply with quote

Thank you Cogito

JSP
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jun 13, 2003 4:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group