How to merge USADDR rule set's output field?

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
stevenzhangshen
Premium Member
Premium Member
Posts: 32
Joined: Fri Sep 26, 2003 3:45 am

How to merge USADDR rule set's output field?

Post by stevenzhangshen »

As we know the output layout of USADDR standardize rule set as:
HN C 10 S HouseNumber
HS C 10 S HouseNumberSuffix
PD C 3 S StreetPrefixDirectional
PT C 20 S StreetPrefixType
SN C 25 S StreetName
ST C 5 S StreetSuffixType
SQ C 5 S StreetSuffixQualifier
SD C 3 S StreetSuffixDirectional
RT C 3 S RuralRouteType
RV C 10 S RuralRouteValue
BT C 7 S BoxType
BV C 10 S BoxValue
FT C 5 S FloorType
FV C 10 S FloorValue
UT C 5 S UnitType
UV C 10 S UnitValue
MT C 5 S MultiUnitType
MV C 10 S MultiUnitValue
BN C 30 S BuildingName
AA C 50 S AdditionalAddressInformation
AT C 1 S AddressType
NS C 8 X NYSIISofStreetName
SS C 4 Z ReverseSoundexofStreetName
UP C 30 S UnhandledPattern
UD C 50 S UnhandledData
IP C 30 S InputPattern
ED C 50 S ExceptionData
UO C 6 S UserOverrideFlag
In general, how do we use this standardized results? If we want to output the standardized result for getting connective address, can we merge these output bucket as 'HN:HS:PT:PD:SN:ST....' ? If results can be used as this way, how about the order of the merging?
I don't know how tho make use of the standardized results after USADDR rule set. Hope someone can help me.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's probably easiest to reformat using a DataStage job.

This will stand you in good stead for the future, when QualityStage is much more tightly integrated with DataStage, and operators such as FFC disappear from QualityStage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
stevenzhangshen
Premium Member
Premium Member
Posts: 32
Joined: Fri Sep 26, 2003 3:45 am

Post by stevenzhangshen »

Thanks for your mention and I know use the DataSatge for merging the job easily. Maybe I didn't say clearly about my question.
I hope to know whether we oftern use the USADDR output like this way? What else way for make use of the USADDR output resulte? Because I am a freshman of Qualitystage.

Thanks a lot!
vairus
Participant
Posts: 52
Joined: Thu Feb 07, 2008 8:02 am
Location: Johannesburg

Re: How to merge USADDR rule set's output field?

Post by vairus »

Yes you can do!

Create a new field in dictionary file
I.E.
FullAddress C 100 S merging_all_address_fields


in the pattern file... inside the Post_process subroutine
make this rule as the first one.Dont add return command at the end


[ {HN} != "" | {HS} != ""] ; if any value populated in HN or HS then the below rule will be executed
copy {HN} temp
concat " " temp
concat {HS} temp
concat " " temp
concat {FullAddress} temp
copy temp {FullAddress}

you will get result as value of HN :HS
if you want to add any other value ,you can add in above rule.

I tested and it works..


stevenzhangshen wrote:As we know the output layout of USADDR standardize rule set as:
HN C 10 S HouseNumber
HS C 10 S HouseNumberSuffix
PD C 3 S StreetPrefixDirectional
PT C 20 S StreetPrefixType
SN C 25 S StreetName
ST C 5 S StreetSuffixType
SQ C 5 S StreetSuffixQualifier
SD C 3 S StreetSuffixDirectional
RT C 3 S RuralRouteType
RV C 10 S RuralRouteValue
BT C 7 S BoxType
BV C 10 S BoxValue
FT C 5 S FloorType
FV C 10 S FloorValue
UT C 5 S UnitType
UV C 10 S UnitValue
MT C 5 S MultiUnitType
MV C 10 S MultiUnitValue
BN C 30 S BuildingName
AA C 50 S AdditionalAddressInformation
AT C 1 S AddressType
NS C 8 X NYSIISofStreetName
SS C 4 Z ReverseSoundexofStreetName
UP C 30 S UnhandledPattern
UD C 50 S UnhandledData
IP C 30 S InputPattern
ED C 50 S ExceptionData
UO C 6 S UserOverrideFlag
In general, how do we use this standardized results? If we want to output the standardized result for getting connective address, can we merge these output bucket as 'HN:HS:PT:PD:SN:ST....' ? If results can be used as this way, how about the order of the merging?
I don't know how tho make use of the standardized results after USADDR rule set. Hope someone can help me.
vairamuthu
stevenzhangshen
Premium Member
Premium Member
Posts: 32
Joined: Fri Sep 26, 2003 3:45 am

Post by stevenzhangshen »

Great! I'll try.

Thanks a lot!
stevenzhangshen
Premium Member
Premium Member
Posts: 32
Joined: Fri Sep 26, 2003 3:45 am

Post by stevenzhangshen »

I created a new field in USADDR.DCT dictionary file:
FA C 100 S merging_all_address_fields

I add the action in USADDR.PAT as following:

\POST_START
NYSIIS {SN} {NS}
RSOUNDEX {SN} {SS}

COPY {SN} temp
CONCAT " " temp
CONCAT {ST} temp
CONCAT " " temp
CONCAT {UV} temp
COPY temp {FA}
\POST_END

But it couldn't work. Can it write in /POST_START?

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why bother? Why not create your FA field with the starting position of the first field you need and the ending position of the last field you need?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
stevenzhangshen
Premium Member
Premium Member
Posts: 32
Joined: Fri Sep 26, 2003 3:45 am

Post by stevenzhangshen »

Sure!

We can do it as you said.

I only want to test the suggestion of vairus. I think it's a good idea and it will be useful for further using.

But I don't understand clearly:
varirus said: inside the Post_process subroutine

Is it means in /POST_START? Or I need to write another subroutine for the merging.
vairus
Participant
Posts: 52
Joined: Thu Feb 07, 2008 8:02 am
Location: Johannesburg

Post by vairus »

hi,

you have to create a subroutine .Sorry i forgot to mention

make post_process call as last subroutine call in pattern action file after unhandled_modification

make it like below

CALL Post_Process
EXIT ;It will end the whole process.so you should make as last call

then you can place your subroutine code at last of your Pattern action file

\SUB Post_Process

;paste your code here

\end_sub

Regards
Vairus
vairamuthu
stevenzhangshen
Premium Member
Premium Member
Posts: 32
Joined: Fri Sep 26, 2003 3:45 am

Post by stevenzhangshen »

Hi Vairus,

Thanks very much!

I use your suggestion and now the pattern action can work.
Great idea!



Joyce
vairus
Participant
Posts: 52
Joined: Thu Feb 07, 2008 8:02 am
Location: Johannesburg

Post by vairus »

thats great joyce...

could you Make this thread as resolved...

vairamuthu
vairamuthu
Post Reply