Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

JCL requirement to sort data of two different columns

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL requirement to sort data of two different columns
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 Moderator


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

PostPosted: Fri Sep 21, 2007 9:43 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us