IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT using OUTREC FIELD with CONDITION


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 3:38 pm
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
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
Reply with quote

You can access all of the DFSORT books from:

Use [URL] BBCode for External Links

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top