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: 669
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 How to split a file in 2 with hierarchy Dr_Halo SYNCSORT 12 Tue Jan 14, 2020 9:15 pm
No new posts Variable length(Pipe delimter) to Fix... SreekanthMada DFSORT/ICETOOL 8 Mon Jan 06, 2020 4:44 pm
This topic is locked: you cannot edit posts or make replies. VSE COBOL - File Status 46 when readi... dennis larson COBOL Programming 8 Fri Jan 03, 2020 11:46 pm
No new posts File transfer issue with end of line ... VINAY PALLELA TSO/ISPF 4 Thu Nov 14, 2019 12:01 am
No new posts File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm

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