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
 

 

Conditional OUTREC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Conditional OUTREC
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Tue Nov 18, 2014 7:12 pm    Post subject: Reply to: Conditional OUTREC
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    Post subject:
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: 1715
Location: UK

PostPosted: Wed Nov 19, 2014 1:07 am    Post subject: Reply to: Conditional OUTREC
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts OUTREC RDW NOT INCLUDED krsenthil85 SYNCSORT 10 Fri May 06, 2016 3:22 am
No new posts Help needed in Conditional statement ... vinu78 DB2 5 Tue Sep 15, 2015 10:14 am
No new posts OUTREC on OUTFIL error rocky_balboa DFSORT/ICETOOL 4 Thu Aug 27, 2015 10:26 am


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