Removing variable string



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Removing variable string

Postby collie » Thu Apr 16, 2020 4:02 pm

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
collie
 
Posts: 4
Joined: Thu Apr 16, 2020 3:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing variable string

 

Re: Removing variable string

Postby NicC » Thu Apr 16, 2020 4:49 pm

Is the data to be removed variable or is the length of the data variable (or both)?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3004
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Removing variable string

Postby collie » Thu Apr 16, 2020 5:21 pm

Hi Nic, both the data and the length is variable.
collie
 
Posts: 4
Joined: Thu Apr 16, 2020 3:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing variable string

Postby NicC » Thu Apr 16, 2020 7:32 pm

Use PARSE to assign the first field to %0 and the rest to %1 and use %1 to create your output dataset.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3004
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Removing variable string

Postby collie » Thu Apr 16, 2020 7:36 pm

Thank you Nic, let me try that
collie
 
Posts: 4
Joined: Thu Apr 16, 2020 3:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing variable string

Postby sergeyken » Fri Apr 17, 2020 5:32 pm

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=(. . .)'
sergeyken
 
Posts: 100
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 2 times
Been thanked: 10 times

Re: Removing variable string

Postby NicC » Fri Apr 17, 2020 6:24 pm

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 problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3004
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Removing variable string

Postby collie » Fri Apr 17, 2020 6:28 pm

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
collie
 
Posts: 4
Joined: Thu Apr 16, 2020 3:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing variable string

Postby sergeyken » Sat Apr 18, 2020 1:24 am

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    
sergeyken
 
Posts: 100
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 2 times
Been thanked: 10 times

Re: Removing variable string

Postby NicC » Sat Apr 18, 2020 1:56 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3004
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post