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

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

New User


Joined: 24 Apr 2011
Posts: 23
Location: USA

PostPosted: Sun Jul 27, 2014 10:09 am    Post subject: PARSE question re: ABSPOS
Reply with quote

I hope someone can show me the error of my ways...

I'm using INREC PARSE to parse a VB pipe-delimited dataset. My goal is to produce a VB output file in which the first few output fields are the parsed fields, followed by the original pipe-delimited record.

E.g., if the input file is LRECL=30 and consists of these two records:
Code:

AAA|BB|C| 
DD|E|FFFF|

Then I would like the output records to be:
Code:

AAA      BB       C        AAA|BB|C| 
DD       E        FFFF     DD|E|FFFF| 


My control statements are:
Code:

 OPTION COPY                               
 INREC PARSE=(%01=(ENDBEFR=C'|',FIXLEN=9),
              %02=(ENDBEFR=C'|',FIXLEN=9),
              %03=(ENDBEFR=C'|',FIXLEN=9),
              %99=(ABSPOS=5,FIXLEN=30)),   
       BUILD=(1,4,%01,%02,%03,%99)         

But my output file reads:
Code:

AAA      BB       C                                       
DD       E        FFFF                                   

I had thought that by specifying ABSPOS=5, that I would be setting the parse pointer back to column 5 (i.e., the start of the data in the original VB record), and therefore %99 would contain 30 bytes starting at that position (which would be the original pipe-delimited record). But I'm getting blanks in those columns. I've obviously misunderstood something... can anyone help?

Thanks so much,

David
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Sun Jul 27, 2014 12:54 pm    Post subject: Reply to: PARSE question re: ABSPOS
Reply with quote

I'd go with:

Code:
  BUILD=(1,4,%01,%02,%03,5) 


That single 5 at the end will say "from position five of the current record to the end of the current record" which should give you what you want.
Back to top
View user's profile Send private message
David Sde

New User


Joined: 24 Apr 2011
Posts: 23
Location: USA

PostPosted: Sun Jul 27, 2014 4:49 pm    Post subject: Reply to: PARSE question re: ABSPOS
Reply with quote

Bill,

That worked perfectly; thank you! It's also much more straightforward than my approach.

If anyone has time, I'm curious to know where I went wrong in my approach re: ABSPOS (i.e., I love to know why my solution produced blanks instead of the original pipe-delimited record).

Thanks,

David
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 Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am
No new posts PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm
No new posts JES2 EXIT 6 QUESTION Randy Horowitz All Other Mainframe Topics 30 Tue Feb 06, 2018 5:47 pm
No new posts question about dfsms management clas... Hervey Martinez IBM Tools 3 Tue Oct 10, 2017 6:19 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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