MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
marcovan Beginner Joined: 10 May 2006 Posts: 5 Topics: 3
Posted: Mon Nov 20, 2006 10:25 am Post subject: Syncsort - Replacing Field Values - Error
Hello,
I am new to syncsort and trying to learn from the various examples on this excellent site.
We have a requirement to perform the following data manipulation.
If in position 1 we find 'ABC' then we want to chance the values in position 35 to 'XYZ'
My code is as follows:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'ABC'),
OVERLAY=(35:C'XYZ'))
When I run my job it comes back and it says:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'101'),
*
OVERLAY=(35:C'20X'))
WER268A INREC STATEMENT : SYNTAX ERROR
I've tried OUTREC as well. Any help would be appreciated.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12398 Topics: 75 Location: San Jose
Posted: Mon Nov 20, 2006 10:51 am Post subject:
marcovan ,
You have a version of syncsort which does not support IFTHEN syntax. try this
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
123
DEF
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(01,34,
35:01,03,CHANGE=(3,C'ABC',C'XYZ'),
NOMATCH=(35,03),
38,43)
/*
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
marcovan Beginner Joined: 10 May 2006 Posts: 5 Topics: 3
Posted: Mon Nov 20, 2006 11:18 am Post subject:
Thanks Kolusu!
That worked like a charm.
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum