IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

INREC PARSING and dictionary items


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Fri Jun 02, 2017 8:02 pm
Reply with quote

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                   

and
Code:

TIMR,1,7,ZD     
LOQD,9,7,CH     
REQI,17,6,CH     
TDLI,%00         
PRLI,%01         
PIP,'|'         
BLK,' '         


thanks in advance
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jun 02, 2017 8:11 pm
Reply with quote

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)
The asterisk shows exactly where your problem is.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Fri Jun 02, 2017 8:17 pm
Reply with quote

The syntax of your PARSE parameter (after substitution of dictionary values) is wrong/incorrect/not allowed.

PARSE= is not allowed without first character as '%'. Period.
What is not clear in this sample, or SYNCSORT error message?

Everything is clearly explained. RTFM.
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Fri Jun 02, 2017 8:43 pm
Reply with quote

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                                         


Code:

TIMR,%00     
LOQD,%01     
REQI,%02     
TDLI,%03     
PRLI,%04     
PIP,'|'     
BLK,' '     
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Fri Jun 02, 2017 8:45 pm
Reply with quote

Thanks for your explanation, Sergey.
Sometimes people with obtuse minds like me, fail to understand manuals... or missing the point.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Fri Jun 02, 2017 9:15 pm
Reply with quote

migusd wrote:
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".

RTFM
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Fri Jun 02, 2017 9:22 pm
Reply with quote

that was the issue, Sergey!
Thanks guys,
you are awesome!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Parsing Large JSON file using COBOL COBOL Programming 4
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts parsing with startat and endbefr SYNCSORT 10
No new posts INREC PARSE used to sort a CSV file DFSORT/ICETOOL 2
No new posts XML Parsing in COBOL creating "h... COBOL Programming 0
Search our Forums:

Back to Top