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
 

 

SORT using OUTREC FIELD with CONDITION

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
xenomorph

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Thu Aug 23, 2007 3:21 pm    Post subject: SORT using OUTREC FIELD with CONDITION
Reply with quote

Hi all !

Can you help me with this ? I've to change all char from position 6 from 'D' -> 'C' and 'U' -> 'C' when the record starts with 'BBBB'.
So I tried :
Code:

//SORTIN   DD  *
AAAA
BBBBPU
CCCC U
BBBBZD         
/*           
//SYSIN DD *                                                         
 SORT FIELDS=COPY                                                   
 OUTREC FIELDS=(1:1,5, 6:6,1,CHANGE(1,C'U',C'C',C'D',C'C'),NOMATCH=(6,1))
 INCLUDE COND=(1,4,CH,EQ,C'BBBB')                                           
/*


I was expecting:
AAAA
BBBBPC
CCCC U
BBBBZC

No luck, in this case, it drops all records except 'BBBB'

Thanks for your help !

BTW where can I find the spec for the SORT command ?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 3:38 pm    Post subject:
Reply with quote

xenomorph,
Check the following -

Code:
//SORTIN   DD  *                                               
AAAA                                                           
BBBBPU                                                         
CCCC U                                                         
BBBBZD                                                         
BBBBZA                                                         
/*                                                             
//SORTOUT DD SYSOUT=*                                         
//SYSIN DD *                                                   
 SORT FIELDS=COPY                                             
 OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'BBBB',AND,(6,1,CH,EQ,C'D',   
                OR,6,1,CH,EQ,C'U')),                           
                OVERLAY=(6:C'C'))                             
/*                                                             


Output:

Code:
AAAA   
BBBBPC 
CCCC U 
BBBBZC 
BBBBZA 
Back to top
View user's profile Send private message
xenomorph

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Thu Aug 23, 2007 6:39 pm    Post subject:
Reply with quote

Thank you murmohk1, it works great.
I wouldn’t want to abuse but is there a document explaining all the functionality of the SORT command ? Couldn't find anything on IBM web site.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 23, 2007 6:55 pm    Post subject:
Reply with quote

You can access all of the DFSORT books from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

you can always use the 'Manuals' quicklink at the top of every page on this website.
Back to top
View user's profile Send private message
xenomorph

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Fri Aug 24, 2007 2:14 pm    Post subject: Reply to: SORT using OUTREC FIELD with CONDITION
Reply with quote

Thanks !
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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