Does DataStage BASIC programming support variable lists?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Does DataStage BASIC programming support variable lists?

Post 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...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply