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

PARSE using REPEAT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 202
Location: Toronto, ON, Canada

PostPosted: Tue Jun 23, 2020 1:58 am
Reply with quote

The below statement fails with error "DUPLICATE PARSED FIELD DEFINITION" on the second "REPEAT=2":
Code:
OUTREC PARSE=(%=(ENDBEFR=TAB,REPEAT=4),
  %01=(ENDBEFR=TAB,FIXLEN=15),
  %=(ENDBEFR=TAB,REPEAT=2),
  %02=(ENDBEFR=TAB,FIXLEN=20)),
  BUILD=(%01,X,
    %02,X)


The below works using the same statment twice:
Code:
OUTREC PARSE=(%=(ENDBEFR=TAB,REPEAT=4),
  %01=(ENDBEFR=TAB,FIXLEN=15),
  %=(ENDBEFR=TAB),
  %=(ENDBEFR=TAB),
  %02=(ENDBEFR=TAB,FIXLEN=20)),
  BUILD=(%01,X,
    %02,X)


The reference manual does not state a limit to how many times a REPEAT can be used. Any ideas why this fails? I want to skip some parsed fields to get to the ones that I want.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1252
Location: Bamberg, Germany

PostPosted: Wed Jun 24, 2020 3:46 am
Reply with quote

jerryte wrote:
I want to skip some parsed fields to get to the ones that I want.

Use larger increments for your parsed fields as a workaround. Sample:
Code:
OPTION COPY                               
OUTREC PARSE=(%=(ENDBEFR=BLANKS,REPEAT=4),
  %00=(ENDBEFR=BLANKS,FIXLEN=2),         
  %=(ENDBEFR=BLANKS,REPEAT=2),           
  %10=(ENDBEFR=BLANKS,FIXLEN=2),         
  %=(ENDBEFR=BLANKS,REPEAT=9),           
  %20=(ENDBEFR=BLANKS,FIXLEN=2)),         
  BUILD=(..)                               
END
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts Repeat a DD line- comment and insert ... CA Products 3
No new posts SORT - To repeat a string in same col... SYNCSORT 3
No new posts JCL - To repeat a string in same colu... JCL & VSAM 2
Search our Forums:

Back to Top