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 Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

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