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 Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location Arun Raj DFSORT/ICETOOL 12 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm


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