IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL requirement to sort data of two different columns


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
er_vinodh

New User


Joined: 08 Jul 2005
Posts: 3
Location: Chennai

PostPosted: Fri Sep 21, 2007 4:09 pm
Reply with quote

hi all

I have a requirement to sort data of two different columns, which have similar data and must be sorted together as a single field.

eg: Input file

Code:

user  field1_emp......      fieldn_emp
1-10  11-18                 51-58
--------------------------------------
aaaa  00111222
bbbb  00111555
aaaa  00111333
aaaa                        00111222
aaaa                        00111666
cccc  00111444



Output file must be like (first sort it in user, then field 1 and fieldn in same level) :

Code:

user  field1_emp......      fieldn_emp
1-10  11-18                 51-58
--------------------------------------
aaaa  00111222
aaaa                        00111222
aaaa  00111333
aaaa                        00111666
bbbb  00111555
cccc  00111444


thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Sep 21, 2007 9:43 pm
Reply with quote

You can use a DFSORT job like this to do what you want:

Code:

//S1    EXEC  PGM=ICEMAN                                       
//SYSOUT    DD  SYSOUT=*                                       
//SORTIN DD *                                                 
aaaa      00111222                                             
bbbb      00111555                                             
aaaa      00111333                                             
aaaa                                              00111222     
aaaa                                              00111666     
cccc      00111444                                             
//SORTOUT DD SYSOUT=*                                         
//SYSIN    DD    *                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:11,8)),                 
    IFTHEN=(WHEN=(11,8,CH,EQ,C' '),OVERLAY=(81:51,8))         
  OPTION EQUALS                                               
  SORT FIELDS=(1,10,CH,A,81,8,CH,A)                           
  OUTREC BUILD=(1,80)                                         


SORTOUT will have:

Code:

aaaa      00111222                                           
aaaa                                              00111222   
aaaa      00111333                                           
aaaa                                              00111666   
bbbb      00111555                                           
cccc      00111444                                           
Back to top
View user's profile Send private message
er_vinodh

New User


Joined: 08 Jul 2005
Posts: 3
Location: Chennai

PostPosted: Mon Sep 24, 2007 12:58 pm
Reply with quote

hi Frank

i tried this with DFSORT and it worked well icon_smile.gif

thank u
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts SCOPE PENDING option -check data DB2 2
No new posts Remote Unload of CLOB Columns DB2 6
Search our Forums:

Back to Top