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: jasorn
Posted: Sat Nov 19, 2016 6:25 pm (GMT 5.5)

This is how I do this, too.

Rohit Umarjikar wrote:
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?


Viewing all articles
Browse latest Browse all 8500

Trending Articles