IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Conditional OUTREC


 
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: 7312
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: 2429
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 All times are GMT + 6 Hours
Forum Index -> SYNCSORT
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts SEQNUM with TRA=ETOA in OUTREC SYNCSORT 5
No new posts Outrec IFTHEN builds data in wrong po... DFSORT/ICETOOL 6
No new posts Conditional step execution based on P... JCL & VSAM 9
No new posts Summing records conditional statements. SYNCSORT 13
No new posts Divide and edit the sum - OutRec DFSORT/ICETOOL 5

Back to Top