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...
Does DataStage BASIC programming support variable lists?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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).
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.