Page 1 of 1

Removing variable string

PostPosted: Thu Apr 16, 2020 4:02 pm
by collie
Hi all,
Need your help/advice please…
how do I remove the data(variable) before and including the ‘=’ symbol from this line of text with DFSORT/ICETOOL/ICEMAN? The data resides in PDS member.

before change
XXXXXXXXXX=QQQQQQQ AAAAAAAAA | 9999999999

after change
QQQQQQQ AAAAAAAAA | 9999999999

Re: Removing variable string

PostPosted: Thu Apr 16, 2020 4:49 pm
by NicC
Is the data to be removed variable or is the length of the data variable (or both)?

Re: Removing variable string

PostPosted: Thu Apr 16, 2020 5:21 pm
by collie
Hi Nic, both the data and the length is variable.

Re: Removing variable string

PostPosted: Thu Apr 16, 2020 7:32 pm
by NicC
Use PARSE to assign the first field to %0 and the rest to %1 and use %1 to create your output dataset.

Re: Removing variable string

PostPosted: Thu Apr 16, 2020 7:36 pm
by collie
Thank you Nic, let me try that

Re: Removing variable string

PostPosted: Fri Apr 17, 2020 5:32 pm
by sergeyken
NicC wrote:Use PARSE to assign the first field to %0 and the rest to %1 and use %1 to create your output dataset.

In order just to skip any unneeded part of data in PARSE the dummy option '%=(. . .)' can be used, rather than parameter '%n=(. . .)'

Re: Removing variable string

PostPosted: Fri Apr 17, 2020 6:24 pm
by NicC
But then I would have to look up the manual to see if the first named %x starts at 0 or 1 (or maybe it can be another number)!

Re: Removing variable string

PostPosted: Fri Apr 17, 2020 6:28 pm
by collie
thank you very much guys...
I managed to get my desired result by using the following...

INREC PARSE=(%0=(STARTAFT=C'=',FIXLEN=80),
%1=(ENDAT=BLANKS,FIXLEN=80)),
BUILD=(%0,%1)
SORT FIELDS=COPY

Re: Removing variable string

PostPosted: Sat Apr 18, 2020 1:24 am
by sergeyken
NicC wrote:But then I would have to look up the manual to see if the first named %x starts at 0 or 1 (or maybe it can be another number)!

The number(s) %n used in PARSE must be used also in BUILD, exactly as is. Any number(s) can be used: %9, %03, %0, %01, ...

Dummy parameters %=(...) are used ONLY to parse across unneeded parts of input data.

There is no need to look up the manual to find out the used number.

 INREC PARSE=(%=(ENDAT=C'='),
                %1=(ENDAT=BLANKS,FIXLEN=80)),
                BUILD=(%1)
SORT FIELDS=COPY    

Re: Removing variable string

PostPosted: Sat Apr 18, 2020 1:56 am
by NicC
I was saying to "look up the manual to get the correct syntax". If they had DFSort for the PC then I may have played further. I do most things from (failing!) memory now that I am retired.