Page 1 of 1
How to merge USADDR rule set's output field?
Posted: Wed Jul 23, 2008 1:07 am
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.
Posted: Wed Jul 23, 2008 1:29 am
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.
Posted: Wed Jul 23, 2008 3:46 am
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!
Re: How to merge USADDR rule set's output field?
Posted: Mon Jul 28, 2008 6:16 am
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.
Posted: Tue Aug 12, 2008 12:44 am
by stevenzhangshen
Great! I'll try.
Thanks a lot!
Posted: Tue Aug 26, 2008 2:43 am
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
Posted: Tue Aug 26, 2008 2:45 am
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?
Posted: Tue Aug 26, 2008 3:00 am
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.
Posted: Tue Aug 26, 2008 6:43 am
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
Posted: Tue Aug 26, 2008 10:14 pm
by stevenzhangshen
Hi Vairus,
Thanks very much!
I use your suggestion and now the pattern action can work.
Great idea!
Joyce
Posted: Wed Aug 27, 2008 7:51 am
by vairus
thats great joyce...
could you Make this thread as resolved...
vairamuthu