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

Conditional OUTREC in SORT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Tue Nov 18, 2014 7:01 pm
Reply with quote

I need to modify the input file for selected records. I tried using OUTREC but its not working.

JCL:
Code:
//STEP001  EXEC PGM=SORT                                       
//SORTIN   DD *                                                 
A12                                                             
A34                                                             
A56                                                             
B78                                                             
B90                                                             
//SORTOUT  DD SYSOUT=*                                         
//SYSOUT   DD SYSOUT=*                                         
//SYSIN    DD *                                                 
    SORT FIELDS=COPY                                           
    OUTREC IFTHEN=(WHEN=(1,1,EQ,C'A'),BUILD=(1:1,1,2:3,1,3:2,1))
/*                                                             


Logic: If the 1st character is 'A', exchange 2nd and 3rd character of the records. Else, copy the record as is.

Expected Output:
Code:
A21
A43
A65
B78
B90


Error received:
Code:
SYSIN :                                                         
    SORT FIELDS=COPY                                           
    OUTREC IFTHEN=(WHEN=(1,1,EQ,C'A'),BUILD=(1:1,1,2:3,1,3:2,1))
                              *                                 
WER251A  INCLUDE/OMIT INVALID FORMAT                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                   
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Tue Nov 18, 2014 7:12 pm
Reply with quote

You've missed the field-type. 1,1,CH,EQ....
Back to top
View user's profile Send private message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Tue Nov 18, 2014 7:33 pm
Reply with quote

Thanks Bill... It worked icon_biggrin.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Nov 19, 2014 1:07 am
Reply with quote

You also have Syncsort - not DFsort.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Building a sort key DFSORT/ICETOOL 3
No new posts Very Large Sort failed - Seeking reco... DFSORT/ICETOOL 7
No new posts Date conversion using SORT SYNCSORT 4
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
Search our Forums:

Back to Top