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
 
OMIT first and last column of a pipe-delimited VB file

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

New User


Joined: 01 Nov 2019
Posts: 1
Location: United States of America

PostPosted: Fri Nov 01, 2019 8:24 pm    Post subject: OMIT first and last column of a pipe-delimited VB file
Reply with quote

I have requirement wherein I have to exclude the first and last column of a pipe-delimited VB file. The position of the first and last column is not fixed, it can vary from one record to the other. The file is RECFM=VB and LRECL=2000

I thought of using the below SORT card to exclude the first and last column:
OUTREC PARSE=(%=(ENDBEFR=C'|'),
%01=(ENDBEFR=C'|',FIXLEN=10),
%72=(ENDBEFR=C'|',FIXLEN=20),
%=(FIXLEN=35)),
BUILD=(1,4, * RDW
%01 and so on)

But the problem with this is that I have to give FIXLEN to each field I declare in the PARSE which I don't want to as it will add trailing spaces towards the end of each column. As each column can contain spaces in between also, so removing only the trailing spaces through SQZ wouldn't be an option.

The sample input data is below:
First_Col|Second_Col|..............and so on|Last_Col
0123456789|Test Rec1|..............and so on|9876543210
9876543210|Test Record 2|..............and so on|0123456789
623452132333|T e s t R e c 3|..............and so on|865685611

So is there any way in SORT, SPLICE or ICETOOL to remove just the first and last column and then extract all the other fields in between without touching the data in any of the intermediate columns?

Thanks for your help!
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 607
Location: Maryland

PostPosted: Fri Nov 01, 2019 10:57 pm    Post subject: Re: OMIT first and last column of a pipe-delimited VB file
Reply with quote

karthikb_itpro wrote:
Code:
OUTREC PARSE=(%=(ENDBEFR=C'|'),
                      %01=(ENDBEFR=C'|',FIXLEN=10),
                      %72=(ENDBEFR=C'|',FIXLEN=20),
                          %=(FIXLEN=35)),
             BUILD=(1,4,                          * RDW
                        %01 and so on) . . .


But the problem with this is that I have to give FIXLEN to each field I declare in the PARSE which I don't want to as it will add trailing spaces towards the end of each column. As each column can contain spaces in between also, so removing only the trailing spaces through SQZ wouldn't be an option.

I would assume that normally "spaces between" must be all converted to a single space each.

If so then use the Option VL after each %-variable field:
Code:
 BUILD=(. . . %1,SQZ=(VL,MID=C' '), . . .


Would make sense also to replace ENDBEFR= parameter with ENDAT=, to simplify the final BUILD= list
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 File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm
No new posts How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am
No new posts Need help in parsing record in VBA file guptae DFSORT/ICETOOL 4 Fri Oct 11, 2019 2:31 pm
No new posts Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm
No new posts What 'EF' in the CAFC command REGION,... vrkratheesh CICS 2 Wed Sep 18, 2019 4:52 pm

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