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: 6967
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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