Retrieving the value of a Stage Variable

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
wwalker
Premium Member
Premium Member
Posts: 40
Joined: Thu Mar 30, 2006 6:30 am
Location: Near Geneva, Switzerland
Contact:

Retrieving the value of a Stage Variable

Post by wwalker »

Hi, all,

I am trying to figure out how to retrieve the value/formula contained in a Stage Variable.

I am using Stage Variables for Reject logic, and I would like to use the logic I have entered to populate a table for supplementary information for error reporting.

I would like to end up with a file like:

VariableName Value
--------------- ------
V1Name If not(isnull(<field1>)) then....
V2Name fieldx <=50
V3Name ....etc

DSGetJobInfo returns the List of Stage Variables...but how can I get the VALUE of the SV?
sjhouse
Premium Member
Premium Member
Posts: 43
Joined: Tue Nov 02, 2004 12:11 pm
Location: Minneapolis, MN

Post by sjhouse »

All you would need to do is create a output link to a sequential file, set up the constraints appropriately and put the stage variables in the derivation for the appropriate columns in your file.

Also, the formulas can be stored in columns as varchars.
wwalker
Premium Member
Premium Member
Posts: 40
Joined: Thu Mar 30, 2006 6:30 am
Location: Near Geneva, Switzerland
Contact:

Post by wwalker »

sjhouse wrote:All you would need to do is create a output link to a sequential file, set up the constraints appropriately and put the stage variables in the derivation for the appropriate columns in your file.

Also, the formulas can be stored in columns as varchars.

I have tried that solution already, but when I put the Stage Variable name into the transformer, it only results in the VALUE of the formula (0 or 1), not the formula itself.

Any other ideas would be welcome...

thanks

W
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The DSGetStageInfo() call will only give you the stage variable names but not the formula/derivations thereof. This metadata is not exposed via any of the APIs. The values are stored in the DS_JOBOBJECTS table but are not meant to be accessed.
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

Hi Wade,

See <a href="viewtopic.php?t=97949"><b>this post</b></a> on the same topic.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Post Reply