Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us