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: 7309
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 How to split large record length file... DFSORT/ICETOOL 7
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
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top