Multiple variables not working

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Multiple variables not working

Post by hitmanthesilentassasin »

Hi,

I am not able to get the below one working whereas the one below is working just fine. The issue here is that the first dictionary field OrgName is being populated as expected but the second dictionary column Supressedsub is not working. what am I doing incorrectly?

Code: Select all

+ | + [ {} != "OF" "ON" ] | ,  | B | B | $ [ {multisuburb} = "Y" ]
COPY      [1] temp
CONCAT    " " temp
CONCAT    [2] temp
COPY temp {OrgName}
COPY      [4] tmp ; Not working
CONCAT    " " tmp ; Not working
CONCAT    [5] tmp ; Not working
COPY tmp {Supressedsub} ; Not working
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0
EXIT

Code: Select all

+ | + [ {} != "OF" "ON" ]  | B  | B | $ [ {multisuburb} = "Y" ]
COPY      [1] temp
CONCAT    " " temp
CONCAT    [2] temp
COPY [3] {Supressedsub}
COPY temp {OrgName}
RETYPE [3] 0
EXIT
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try escaping the comma in the first pattern.

Code: Select all

+ | + [ {} != "OF" "ON" ] | \, | B | B | $ [ {multisuburb} = "Y" ] 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

I have already tried that but still doesnt seem to be working.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is Supressedsub the actual name in the file dictionary, rather than (for example) SuppressedSub, Suppressedsub or SupressedSub?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

Yes, Supressedsub is exactly the same name(matches case) from dictionary.

Perhaps, I tried copying directly into Supressedsub without tmp variable. Still the result is same.

I have realized that when I am concatenating multiple classification tokens, I am getting this issue.
boxtoby
Premium Member
Premium Member
Posts: 138
Joined: Mon Mar 13, 2006 5:11 pm
Location: UK

Post by boxtoby »

It might be that the comma is in the separator list (SEPLIST) or strip list (STRIPLIST) at the top of the pattern action.

If it is you may need to remove it bit that might have an effect on other patterns.

Also, are you sure that your new pattern is working at all? Could Orgname be populated from another pattern?


Cheers,
Bob.
Bob Oxtoby
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

I am completely sure that the pattern is working fine because the unknown tokens(+) are getting extracted perfectly. The issue is with the concatenation of the classifications tokens. whenever, I am trying to concatenate classifications tokens the entire string is getting lost hence its not coming up. this includes orgname variable as well. When I try to populate with a simple copy command the dictionary fields and variables are getting populated but when I am trying to concatenate they are getting truncated to null and hence nothing is coming up. I am yet to investigate the retype at the end of the pattern and see if that is causing this issue. Ill check that tomorrow. However, do you reckon anything else that I could investigate upon?

Thanks for your help!!
rjdickson
Participant
Posts: 378
Joined: Mon Jun 16, 2003 5:28 am
Location: Chicago, USA
Contact:

Post by rjdickson »

Hi,

Can you please post some examples of data and Pattern Action Language you are using? There are so many possibilities that a specific example should help us help you.
Regards,
Robert
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

Hi Robert - here is the sample.

Code: Select all

&
PATTERN {modpattern}

Code: Select all

+ | + [ {} != "OF" "ON" "FOR" "AT" ]  | B | O   | O  | $
COPY      [1] temp
CONCAT    " " temp
CONCAT    [2] temp
COPY      [3] {Supressedsub}
CONCAT    " " temp
CONCAT  [4] temp
CONCAT    " " temp
CONCAT  [5] temp
COPY temp {OrgName}
RETYPE [3] 0
EXIT

+ | + [ {} != "OF" "ON" "FOR" "AT" ]  | B | B | O | O | $ [ {multisuburb} = "Y" ]
COPY      [1] temp
CONCAT    " " temp
CONCAT    [2] temp
COPY      [3] tmp
CONCAT " " tmp
CONCAT [4] tmp
CONCAT    " " temp
CONCAT  [5] temp
CONCAT    " " temp
CONCAT  [6] temp
COPY temp {OrgName}
COPY tmp {Supressedsub}
RETYPE [3] 0
RETYPE [4] 0
EXIT
Just before pattern matching I am capturing the modified patterns in modpattern. Following modpattern population I am capturing a pattern(my first 2 patterns) to handle strings like the below example. I have verified multisuburb is getting the value Y

Code: Select all

INPUT: "ABC ABC WASHINGTON PVT LTD" 
OUTPUT Orgname: ABC ABC PVT LTD 
            Supressedsub: WASHINGTON
INPUT:  " ABC ABC NEW YORK PVT LTD" 
OUTPUT: Orgname:"ABC ABC PVT LTD" 
             Supressedsub is not at all getting populated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Check the classification of PVT. (It doesn't occur in USNAME out of the box, but PTY is classified as W.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

ray.wurlod wrote:Check the classification of PVT. (It doesn't occur in USNAME out of the box, but PTY is classified as W.) ...
Its a custom ruleset like a preprocessor Ray. I have defined PVT as "O"
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

Are New and York both classified as B?
Could it be getting caught by another pattern (or default handling)you have that just pushes the + + O O to OrgName?

It's not a 5-minute task, but I once went through AUNAME and AUADDR and put a DBG field in with a corresponding function that appended a code for every pattern that was ever hit on the way through the PAT.
Proved invaluable for times like this when stuff just doesn't make sense. Most times I wasn't hitting the pattern I thought I was.
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

yes, both New and york are classified as B in previous step and also at the same point where the tokens are classified as B, multisuburb is set to "Y" so that I can identify the retyped tokens and source tokens.

There is no chance of other pattern catching in between because this is happening with the first pattern and same thing is repeating till the last one. By the way what is DBG field?
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

I added my own field into the DCT file.
Then I wrote a subroutine to append a string to it.
I called that subroutine as the first line of every pattern in the PAT file (unless it called a subroutine, in which case I had to manually append the pattern code).

Can you show us the bit where you re-classified them as B?
hitmanthesilentassasin
Participant
Posts: 150
Joined: Tue Mar 13, 2007 1:17 am

Post by hitmanthesilentassasin »

Stuart - your question about the retyping solved my problem. I had retyped the operands with empty variable hence it was getting empty values in the field.

Thanks you all for your help here
Post Reply