Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

COBOL Programming :: RE: To trim spaces in a pipe delimited dataset

$
0
0
Author: Nish84
Posted: Fri Oct 21, 2016 1:00 am (GMT 5.5)

Thank you all for your responses! Sorry for the late reply, I was off sick and had quite a bit of work to catch up on when I got back icon_smile.gif

The destination system receiving the feed from us mentioned later that they would require one space between pipes if a field is empty. So what I finally did was to move the input data to into fixed positions in the output record using a program (used a program instead of a PARSE as there were a few manipulations to be done on some of the fields) and then a SORT SQZ to remove consecutive spaces.

Code:

OPTION COPY                                   
INREC BUILD=(1,3000,SQZ=(SHIFT=LEFT,MID=C' '))


And for the record, I wasn't sitting idle waiting for the forum reply. There were n number of other things being worked upon in parallel icon_biggrin.gif
As I have been out of touch with mainframe for a while, I was only checking if there were methods more efficient than mine to achieve my requirement.

Thank you once again!


Viewing all articles
Browse latest Browse all 9405

Trending Articles