hello guys,
I am having troubles to understand INREC PARSING using Dictionary fields created.
I have a fixed length file with the first part of the records are fixed.
The last part of the records contain variable length fields.
But I decided to use dictionary.
and because of this I am running into issues.
I believe the issue is INREC PARSE I am using, but I don't understand why.
can someone tell me what am I missing?
here is the example
Code:
SYSIN :
INREC PARSE=(TIMR=(ABSPOS=1,FIXLEN=7),
LOQD=(ADDPOS=01,FIXLEN=7),
REQI=(ADDPOS=01,FIXLEN=6),
TDLI=(ADDPOS=01,ENDBEFR=PIP),
PRLI=(ADDPOS=01,ENDBEFR=BLK)),
BUILD=(1:PRLA,5:LIQD,12:TMAR,19:TDLP,22:REQU)
SORT FIELDS=(PRLA,A,LIQD,A,TMAR,A)
OMIT COND=(TDLP,EQ,C'OPN')
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INREC PARSE=(1,7,ZD=(ABSPOS=1,FIXLEN=7),9,7,CH=(ADDPOS=01,FIXLEN=7),17,6,CH=(ADD
*
POS=01,FIXLEN=6),%00=(ADDPOS=01,ENDBEFR=C'|'),%01=(ADDPOS=01,ENDBEFR=C' ')),BUIL
D=(1:1,4,5:5,7,12:12,7,19:19,3,22:22,6)
SORT FIELDS=(1,4,CH,A,5,7,CH,A,12,7,ZD,A)
OMIT COND=(19,3,CH,EQ,C'OPN')
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A INREC STATEMENT : SYNTAX ERROR
here are the dictionary items I am using
Code:
*-----------------------PARM USED IN BOTH-----------------------------*
*----------------TRLXSXXX JS0010 TMR USER REQUEST --------------------*
*----------------TRLXSXXX JS0020 VER STAT REQUEST --------------------*
*---------------------------------------------------------------------*
PRLA,001,04,CH 001 - 004
LIQD,005,07,CH 005 - 011
TMAR,012,07,ZD 012 - 018
TDLP,019,03,CH 019 - 021
REQU,022,06,CH 022 - 027
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Code:
TIMR,1,7,ZD
LOQD,9,7,CH
REQI,17,6,CH
I think your problem lies here. You might want to define these PARSE fields as %n OR %nn to fix your syntax error (similar to what you have already done for TDLI and PRLI).
Refer the Syncsort/MFX manual or the PARSE examples in this forum to get familiar with the PARSE syntax.
Quote:
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INREC PARSE=(1,7,ZD=(ABSPOS=1,FIXLEN=7)
Hi Arun,
I did that as a test before, but the failing field is moving.
let me tell you that the %03 field is missing most times. So we have two field separators '|' together indicating a missing field. Is that something to be of a concern?
here he the new test...
Code:
SYSIN :
INREC PARSE=(TIMR=(ABSPOS=1,FIXLEN=7),
LOQD=(ADDPOS=01,FIXLEN=7),
REQI=(ADDPOS=01,FIXLEN=6),
TDLI=(ADDPOS=01,ENDBEFR=PIP),
PRLI=(ADDPOS=01,ENDBEFR=BLK)),
BUILD=(1:PRLA,5:LIQD,12:TMAR,19:TDLP,22:REQU)
SORT FIELDS=(PRLA,A,LIQD,A,TMAR,A)
OMIT COND=(TDLP,EQ,C'OPN')
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INREC PARSE=(%00=(ABSPOS=1,FIXLEN=7),%01=(ADDPOS=01,FIXLEN=7),%02=(ADDPOS=01,FIX
LEN=6),%03=(ADDPOS=01,ENDBEFR=C'|'),%04=(ADDPOS=01,ENDBEFR=C' ')),BUILD=(1:1,4,5
*
:5,7,12:12,7,19:19,3,22:22,6)
SORT FIELDS=(1,4,CH,A,5,7,CH,A,12,7,ZD,A)
OMIT COND=(19,3,CH,EQ,C'OPN')
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A INREC STATEMENT : SYNTAX ERROR
Hi Arun,
I did that as a test before, but the failing field is moving.
let me tell you that the %03 field is missing most times. So we have two field separators '|' together indicating a missing field. Is that something to be of a concern?
here he the new test...
FIXLEN= subparameter is mandatory for PARSE... (except dummy case %=...)
If you want to get varying size value, in the following statements/parameters you can use subparameter SQZ=, or JFY=, or other ways of "truncation".