View previous topic :: View next topic
Author
Message
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi,
Following sort control card is used to replace double quotes & remove comma from input file
Code:
OPTION COPY
INREC FINDREP=(IN=C'"',OUT=C''),
PARSE=(%01=(ABSPOS=4,ENDBEFR=C',',FIXLEN=11),
%02=(ENDBEFR=C',',FIXLEN=02),
%03=(ENDBEFR=C',',FIXLEN=02),
%04=(ENDBEFR=C',',FIXLEN=02),
%05=(ENDBEFR=C',',FIXLEN=09),
%06=(ENDBEFR=C',',FIXLEN=17)),
BUILD=(1,4,
5:%05,
14:%06,SFF,TO=ZD,LENGTH=17)
But i get the following error
Code:
OPTION COPY
INREC FINDREP=(IN=C'"',OUT=C''),
PARSE=(%01=(ABSPOS=4,ENDBEFR=C',',FIXLEN=11),
$
ICE107A F DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT OPERANDS
%02=(ENDBEFR=C',',FIXLEN=02),
$
Could you please help me in fixing this syntax error?
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Quote:
ICE107A F DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT OPERANDS
I can't seem to locate it, but it appears that PARSE and FINDREP are mutually exclusive......
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi
Please ignore my question. I have modified it & worked fine
Thanks
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
suyerasi wrote:
Please ignore my question. I have modified it & worked fine
OK, could you please post the "modified" control cards?
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You can use FINDREP and PARSE in the same INREC statement by putting them in separate IFTHEN clauses.
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi Frank,
Following is what i coded before you gave your comments. Let me know if this is correct.
Code:
OPTION COPY
INREC FINDREP=(INOUT=(C'"',C''))
OUTREC PARSE=(%01=(ABSPOS=5,ENDBEFR=C',',FIXLEN=11),
%02=(ENDBEFR=C',',FIXLEN=02),
%03=(ENDBEFR=C',',FIXLEN=02),
%04=(ENDBEFR=C',',FIXLEN=02),
%05=(ENDBEFR=C',',FIXLEN=09),
%06=(ENDBEFR=C',',FIXLEN=17)),
BUILD=(1,4,
5:%05,
14:%06,SFF,TO=ZD,LENGTH=17)
After your suggestion , i modified it as follows
Code:
OPTION COPY
INREC IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C'"',C''))),
IFTHEN=(WHEN=(5,3,CH,NE,C' '),
PARSE=(%01=(ABSPOS=5,ENDBEFR=C',',FIXLEN=11),
%02=(ENDBEFR=C',',FIXLEN=02),
%03=(ENDBEFR=C',',FIXLEN=02),
%04=(ENDBEFR=C',',FIXLEN=02),
%05=(ENDBEFR=C',',FIXLEN=09),
%06=(ENDBEFR=C',',FIXLEN=17)),
BUILD=(1,4,
5:%05,
14:%06,SFF,TO=ZD,LENGTH=17))
I have a question
a) Is IFTHEN should always be followed by 'WHEN ". In the above control statement i dont want to use "WHEN=(5,3,CH,NE,C' ')," & wanted to just parse the input after double quotes were replaced.
b) Also How do i convert the input file from VB (lrecl=1000 ) to FB (lrecl=80) in this example?.
Thanks in advance for your help.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Using INREC and OUTREC as you did will work.
Using just INREC, you can use IFTHEN=(WHEN=INIT twice:
Code:
INREC IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C'"',C''))),
IFTHEN=(WHEN=INIT,
PARSE=(%01=(ABSPOS=5,ENDBEFR=C',',FIXLEN=11),
....
To convert from VB/1000 to FB/80 you can use:
Code:
OUTFIL VTOF,BUILD=(5,80)
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Dear Frank,
Thanks for your prompt response.
Regards.
Suyerasi
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi Frank,
If i code "when=init", in the following control card , the job is failing .
Code:
OPTION COPY
INREC IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C'"',C''))),
IFTHEN=(WHEN=INIT, ===> Replaced (5,3,CH,NE,C' '),
PARSE=(%01=(ABSPOS=5,ENDBEFR=C',',FIXLEN=11),
%02=(ENDBEFR=C',',FIXLEN=02),
%03=(ENDBEFR=C',',FIXLEN=02),
%04=(ENDBEFR=C',',FIXLEN=02),
%05=(ENDBEFR=C',',FIXLEN=09),
%06=(ENDBEFR=C',',FIXLEN=17)),
BUILD=(1,4,
5:%01,
16:%02,
18:%03,
20:%04,
22:%05,
31:%06,SFF,TO=ZD,LENGTH=17))
OUTFIL VTOF,BUILD=(5,80)
Below is the error,i got . Could you plz correct me?
Code:
ICE027A 9 END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
The second WHEN=INIT clause in your INREC statement creates a reformatted record with a length of 47 bytes, but your OUTFIL statement is trying to use bytes beyond that (80 > 47). 5,80 for OUTFIL requires an 84 byte INREC record. Thus, you get the ICE027A message. You need to create an 84 byte record with INREC.
You can change your last INREC BUILD line to:
Code:
31:%06,SFF,TO=ZD,LENGTH=17,84:X))
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi Frank,
It worked fine after i made the change.
Thanks
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi Frank,
In the example given below , i would like to suppress leading zeroes for the field#5 and the data type is character. Could you plz give the solution for this?
Code:
OPTION COPY
INREC IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C'"',C''))),
IFTHEN=(WHEN=(5,3,CH,NE,C' '),
PARSE=(%01=(ABSPOS=5,ENDBEFR=C',',FIXLEN=11),
%02=(ENDBEFR=C',',FIXLEN=02),
%03=(ENDBEFR=C',',FIXLEN=02),
%04=(ENDBEFR=C',',FIXLEN=02),
%05=(ENDBEFR=C',',FIXLEN=09),
%06=(ENDBEFR=C',',FIXLEN=17)),
BUILD=(1,4,
5:%05,
14:%06,SFF,TO=ZD,LENGTH=17))
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Please show an example of the records in your input file and what you expect for output.
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Hi Frank,
Please find below the input
Code:
"03/27/2009","","","","000123456",3.673050000
"03/27/2009","","","","000000006",3.673050000
"03/27/2009","","","","000000456",3.673050000
Expected output
Code:
03/27/2009bbbbbb 1234563.673050000
03/27/2009bbbbbb 63.673050000
03/27/2009bbbbbb 4563.673050000
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Your expected output doesn't match your control statements, so I'm not sure if you're asking me for the complete control statements to go from your input to your output, or just how to edit the %05 field.
You could use something like this to edit the %05 field:
Code:
5:%05,UFF,M10,LENGTH=n,
where n is the length you want for the field.
Back to top
suyerasi New User Joined: 05 Apr 2007Posts: 38 Location: india
Frank,
It worked fine . I was trying to supress the leading zeroes while formatting the input. Thanks for the solution
Regards
Suyerasi
Back to top
Please enable JavaScript!