Stage Variable Question

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mail2krishna79
Charter Member
Charter Member
Posts: 56
Joined: Fri Apr 21, 2006 9:53 am

Stage Variable Question

Post by mail2krishna79 »

I have a requireent like this:

Old Value : ABCD
New Value: ABCDEF

we must keep both values. There will be a period of time that we will see both because some records will be in the pipeline. So we need to account for both naming conventions.

I created a Stage Variable for this. I did almost coding part but how do i keep both the values in the mart?

Can you guys help me in coding part
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Your example isn't good enough. What are the business rules that govern the change?

We could play "guess the rules" all day long...

For example:
- do both have to be kept for more than one run?
- When do you need to use one or the other?
- What do you mean by "keep both values in the mart"? Are you trying to implement a slowly changing dimension?
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Post by swapnilverma »

your requirement is bit unclear ....
I assume you want to keep two values current and previous
if this is the case you can have two stage variable and use swap logic

A=B
B=C
C=A

this way you can keep both...

if i have misunderstood ur query ... plz provide more info
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
mail2krishna79
Charter Member
Charter Member
Posts: 56
Joined: Fri Apr 21, 2006 9:53 am

Post by mail2krishna79 »

- do both have to be kept for more than one run?
Ans : yes. I have a scenario like this.
File contains old values as "Customer/details
They decide to change that value as "Customer of Details"
Over a period of time old value might come or new value might come or both at once. we have accountable both old and new value.

Please ignore "keep both values in the mart". Assume the file is getting loading into a table.

asorell, Thank you so much for your reply
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

To me this sounds like a basic data validation rule: If field = old_form or field = new_form then 'OK' else 'BAD'

If you have a set of known values, both old and new, perhaps you can place them into a table to be used with a lookup stage. If the difference is more of a format change (such as 11 Jan 2011 vs 2011-01-11), then maybe logic in one stage variable checks for the old format, logic in another checks for the new format and if either matches then the field is ok.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply