Page 1 of 1

Standardize multiple date columns

Posted: Fri Dec 24, 2010 1:44 pm
by D0n1117
I am trying to standardize multiple date columns (and other multiple columns) from custom rules sets. When I try to add 5 vDate standizations (one for each date), I get an error that says "Cannot add the same process twice". When adding all the dates into the vDate rule set, i only get one set of standardization outputs.

Is there a way I can apply a rule set to multiple columns (meaning to check each column) without adding five standization components in my case back to back?

Posted: Fri Dec 24, 2010 2:22 pm
by rjdickson
Each rule set can only be used once in a STN stage. This is because the output column is formed based on the rule set name. If you were able to use the same rule set more than once, you would get the duplicate column names, and that is not allowed in DataStage/QualityStage.

You can copy VDATE four times (VDATE2, VDATE3, etc), and then use those rule sets in one STN job.

You can also copy and modify VDATE to accept five date columns, but what would require Pattern Action Language knowledge. You might be better off with the first option :D

Posted: Fri Dec 24, 2010 2:23 pm
by rjdickson
Each rule set can only be used once in a STN stage. This is because the output column is formed based on the rule set name. If you were able to use the same rule set more than once, you would get the duplicate column names, and that is not allowed in DataStage/QualityStage.

You can copy VDATE four times (VDATE2, VDATE3, etc), and then use those rule sets in one STN job.

You can also copy and modify VDATE to accept five date columns, but what would require Pattern Action Language knowledge. You might be better off with the first option :D

Posted: Fri Dec 24, 2010 2:34 pm
by D0n1117
rjdickson wrote:Each rule set can only be used once in a STN stage. This is because the output column is formed based on the rule set name. If you were able to use the same rule set more than once, you would get the duplicate column names, and that is not allowed in DataStage/QualityStage.

You can copy VDATE four times (VDATE2, VDATE3, etc), and then use those rule sets in one STN job.

You can also copy and modify VDATE to accept five date columns, but what would require Pattern Action Language knowledge. You might be better off with the first option :D
Yes, I was thinking about just duplicating the rule sets too. Only problem is then if you have to update it, then you have to update them all.

You'd think IBM could just append a number to the end of the name and use a loop to support this feature. Maybe the next release.

That is a good idea to modify vDate, but I'd still have to update however many dates I allowed if something changed. I had to modify vDate anyway, since it doesn't accept the CCYYMMDD date format as input even though it outputs only that format.

I think I'm going to go with copying the rule set. Thanks for the help.

Posted: Fri Dec 24, 2010 4:34 pm
by stuartjvnorton
You can definitely do it that way, but it seems a little messy to maintain.

Why not just copy the PK and relevant date into 4 streams and full list of fields into the 5th, put the 5 STAN stages in parallel and use the PK to join it back up while renaming the output fields?

Posted: Mon Dec 27, 2010 8:05 am
by rjdickson
Yep, there are many ways to solve the problem, and one persons messy is another's clean :)

In this case, the change is to a rule set that is unlikely to change again (it's just dates :lol:) , so one change, 4 copies, one STN and you're done.

No 'right' answer, just many possible solutions :lol: