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: 205
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: 1442
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Denomination counts by using PARSE in... DFSORT/ICETOOL 8
No new posts Writing next records after a match an... Compuware & Other Tools 5
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts Repeat n times by substuting SEQNUM i... DFSORT/ICETOOL 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:


Back to Top