Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
PARSE using REPEAT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jerryte

Active User


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

PostPosted: Tue Jun 23, 2020 1:58 am    Post subject: PARSE using REPEAT
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

Active User


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

PostPosted: Wed Jun 24, 2020 3:46 am    Post subject: Re: PARSE using REPEAT
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need to loop & extract from varia... pkmurali CLIST & REXX 2 Thu Jan 10, 2019 11:42 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us