Page 1 of 1

Does DataStage BASIC programming support variable lists?

Posted: Tue Feb 17, 2009 11:19 pm
by sbass1
Hi,

I have stage variables used for data validation like so:

C1 = If IsNull(Foo) Then "Null Foo;" Else ""
C2 = If IsNull(Bar) Then "Null Bar;" Else ""
C3 = If IsNull(Blah) Then "Null Blah;" Else ""
...
Cn = more data validation
...

Then...

Audit = C1:C2:C3:...:Cn
InvalidRecord = Len(Audit) gt 0

For code maintenance and readability, does DS support the concept of variable lists, i.e. something like:

Audit = cat(C1--Cn) (i.e. some function to concatenate all variables with prefix C and numeric suffix 1-n).

From reading the doc, I assume "No", but thought I'd ask.

Note: we haven't licensed the QualityStage product. If there's a better approach to the above in Server jobs, I'm open to it, but that's not really my question.

Thanks...

Posted: Wed Feb 18, 2009 1:32 am
by ray.wurlod
The answer is, indeed, no but meaningfully named stage variables can make this much more maintainable. For example instead of C1 use IsNullFoo, etc; so that your final test expression has the form IsNullFoo : IsNullBar : IsNullBlah

Remove the final semi-colon using an appropriate substring.

In another place I used true/false values for these (as well as maintaining the text).