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

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

$
0
0
Author: Rohit Umarjikar
Posted: Mon Oct 10, 2016 10:38 pm (GMT 5.5)

1.
Quote:
My query was to check if the coding can be done in a simpler way, using something like the INSPECT statement.
of course, read yourself
Code:
MOVE FUNCTION REVERSE(INPUT) TO INPUT-R.
INSPECT INPUT-R TALLYING CNTR FOR LEADING SPACES.
COMPUTE INP-LEN = LENGTH OF INPUT-R - CNTR.
INPUT-TRIM = MOVE INPUT(1:INP-LEN)

2. Tell us the source of the data under the pipes?
3.Answer to 2 is DB2 then you can do in the select itself else let us know if you can make this cobol-db2 program as in one select from sysibm.sysdummy1 you can make all 60 in good shape.
4.use SORT SQZ/PARSE as told by Enrico.

In short there are many simple ways, so that beg me to only question; How far you willing to move your legs?
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif


Viewing all articles
Browse latest Browse all 8500

Trending Articles