Page 1 of 1

how to removes spaces in file using sorT?

Posted: Sat Apr 13, 2024 8:34 pm
by Neeraj Mehta
Hi Everyone,

Does anyone know how to removes spaces in file using sort.

I have a file which record length is 2000. I need to trim all the areas which has spaces in the file. For example, if I have data like 'XXXXX   111 YYY' then output should be 'XXXXX111YYY'.

The only thing is we don't know at which position we might have spaces

Re: how to removes spaces in file using sorT?

Posted: Mon Apr 15, 2024 1:34 pm
by Anuj Dhawan
Try, untested:

Code: Select all

SORT FIELDS=COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))
 

Posted: Mon Apr 15, 2024 2:45 pm
by enrico-sorichetti
sorry ...
while the answer might be - at the lowest level of technicalities - correct
it was rushed ...
we do not know anything about the TS environment and the cconsequence of an unconditional shift of all the data

wiser for the ts to repost/clarfify  the question with a few more details ...
for example is the dataset FB vs. VB  ( record length is 2000 )


 

Re: how to removes spaces in file using sorT?

Posted: Tue Apr 16, 2024 10:28 am
by Anuj Dhawan
Agree, it was rushed.

Re: how to removes spaces in file using sorT?

Posted: Thu Apr 18, 2024 11:02 pm
by Neeraj Mehta
Thanks, this has worked for me.