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 

Sorted output in single step

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


Joined: 22 Sep 2005
Posts: 11
Topics: 5
Location: WI,US

PostPosted: Sun Aug 06, 2006 11:57 pm    Post subject: Sorted output in single step Reply with quote

Hi,
I want to sort the records in single step of Syncsort ( not synctool). Here is the input and output :-

Input dataset - (LRECL -1200, RECFM -FB)

Field F1 - 1 char- 158
Field F2 - 8 char- 166-173
The value of Field F1 can be 0,2,3,4,8. For every unique F2, the values of F1 should be in the order 0,3,4,8,then 2.
I have the liberty of using the field 181-188 to achieve the sort output. Input dataset records are as below :

F1 F2
158 166-173
---- ----------
0 11111111
2 11111111
4 11111111
3 11111111
8 11111111
0 22222222
3 22222222
2 22222222
0 33333333
2 33333333
4 33333333

Output dataset (LRECL-1200 , RECFM - FB) will look like :

F1 F2
158 166-173
---- ----------
0 11111111
3 11111111
4 11111111
8 11111111
2 11111111
0 22222222
3 22222222
2 22222222
0 33333333
4 33333333
2 33333333

Could you please let me know if this can be done in one step,

Thanks,
Pranabesh
Back to top
View user's profile Send private message
Jaya
Beginner


Joined: 02 Sep 2005
Posts: 77
Topics: 10
Location: Cincinnati

PostPosted: Mon Aug 07, 2006 3:53 am    Post subject: Reply with quote

Pranabesh,

Please try this jcl...

Code:
//STEP01   EXEC PGM=SORT                                           
//SYSOUT   DD  SYSOUT=*                                           
//SORTIN   DD  *                                                   
0 11111111                                                         
2 11111111                                                         
4 11111111                                                         
3 11111111                                                         
8 11111111                                                         
0 33333333                                                         
3 33333333                                                         
2 33333333                                                         
0 22222222                                                         
2 22222222                                                         
4 22222222                                                         
//SORTOUT  DD  DSN=JAYA.TESTOUT,DISP=(NEW,CATLG,DELETE),     
//            SPACE=(CYL,(10,10),RLSE)                             
//*                                                               
//SYSIN    DD *                       
  SORT FIELDS=(3,8,CH,A,1,1,AQ,A)     
  ALTSEQ CODE=(F2F9)                 
/*                                   
//                                   


Output:
Quote:
0 11111111
3 11111111
4 11111111
8 11111111
2 11111111
0 22222222
4 22222222
2 22222222
0 33333333
3 33333333
2 33333333


The above code works fine for DFSORT..
Hope it will work for SYNSORT too...(I can't test SYNCSORT)..

Thanks,
Jaya.
_________________
"Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein
Back to top
View user's profile Send private message
Pranabesh
Beginner


Joined: 22 Sep 2005
Posts: 11
Topics: 5
Location: WI,US

PostPosted: Tue Aug 15, 2006 7:36 pm    Post subject: Reply with quote

Thanks a lot Jaya!!
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