Help with the logic

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Help with the logic

Post by Hope »

I have to convert source data by applying the abbreviation rules.

My Source Data is .

Source
2343 South Bay Street
1899 Ranch Building
345 North McArthur Road

target
2978 S Bay ST
1899 Ranch BLDG
345 North McArthur RD

Please help me with the logic
Sreedhar
Participant
Posts: 187
Joined: Mon Oct 30, 2006 12:16 am

Post by Sreedhar »

There are two says to do this.

1) Use Quality Stage and use Address Standardization.
2) Use a look up to substitute
South with S
Building with BLDG
Road with RD

Let me know if you need more information on the same.

I have recently implemented it with lookup stage in my project.
Regards,
Shree
785-816-0728
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can find official standarization lists out on the Internet if you don't already have your hands on them, including this pdf from the USPS.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You might investigate the Trans() function for your lookups against a hashed file. This allows you to specify fourth argument of "C" that returns the original code if the reference value is not found. It will save you coding a number of If..Then..Else constructs.

You will also, of course, have to parse your address into individual tokens. The Field() function is recommeded for this task.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

I did use the standardization stage and it worked.

Sreedhar,
Out of curiousity,could you please explain me how I can use a lookup stage?.
If I put the values
North,N
South,S
Suite,STE
in lookup file
how do I match part of the string ex: I have 2343 South Bay Street with the values in the lookup file.

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

Post by ray.wurlod »

QualityStage would do that parsing for you.

If you choose not to use QualityStage (maybe because you don't have it) then the parsing operation is something you have to do. I would recommend Field() functions into stage variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is this a server job (as posted) or a parallel job (as marked)?
:?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

This is a parllel job
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then ignore my suggestion about Trans() function.

Moderator: please move to Enterprise Edition (parallel) forum
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSShishya
Premium Member
Premium Member
Posts: 37
Joined: Tue Oct 27, 2009 9:43 pm

Post by DSShishya »

@Sreedhar

Can you please explain how did you implement this using lookup stage?
Post Reply