V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 216 Location: USA
|
|
|
|
Hi,
My input file attributes are LRECL=80,RECFM=FB. My input data is as below.
111ABC12345ED111
222FADL7435BE222
33334A65DE7CF333
Now, I need to scan thru the bytes from position 4 thru 10 bytes and change A,B,C, to number 2 and D,E,F to number 3. Also I need to build the output record as below.
OUTREC FIELDS=(1,3,14,3,Original 4,10 and Converted 4,10)
I tried to do the below, but it isn't working.
we are using sync sort product version 1.4.0. I am getting the below error.
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=4,ENDPOS=13,IN='A',OUT='2')),
*
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=4,ENDPOS=13,IN='B',OUT='2')),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=4,ENDPOS=13,IN='C',OUT='2')),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=4,ENDPOS=13,IN='D',OUT='3')),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=4,ENDPOS=13,IN='E',OUT='3')),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=4,ENDPOS=13,IN='F',OUT='3')),
OUTREC FIELDS=(1,3,14,3,3,4,10)
WER268A INREC STATEMENT : SYNTAX ERROR |
Can someone please help in this regard?
Also, is there a smart way to simplify the code as I might have more conditions like 'G' thru 'I' to number 4, 'J' thru 'L' to number 5 and so on...
Regards
Amar |
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You are not specifying the constants correctly: C'A' not 'A'.
Have a look in your documentation for INOUT, where you specify the input and output contants in pairs, In1,Out1,In2,Out2,In3,Ouit3 etc. |
|