Page 1 of 1

How to Use Environment Variable into the UtilityRunJob routi

Posted: Fri Sep 05, 2008 12:00 am
by Vivek Vazarkar
Hi All,

I'm trying to call the the datastage job through UtilityRunJob routine and passing Enviroment variable as a parameter. But the called datastage job doesnot referencing the actual enviroment variable value. The called datastage job considering the enviroment variable as a value.

Posted: Fri Sep 05, 2008 12:10 am
by ray.wurlod
Show us precisely the call you are making, and describe where you are making it from. If an expression is involved, did you build this using the keyboard or the expression editor?

Posted: Fri Sep 05, 2008 1:03 am
by Vivek Vazarkar
ray.wurlod wrote:Show us precisely the call you are making, and describe where you are making it from. If an expression is involved, did you build this using the keyboard or the expression editor? ...
Hi,

Thanks for your replay. Below is the scenario.


ParamFile---> Transformer---->Staging_File


If DSLink9.JOBTYPE= 'TD' Then UtilityRunJob("Teradata_Login","UId=":DSLink9.ID:"|Password=":DSLink9.WORD :"|Server=":DSLink9.SERVER,0,0) Else @NULL



I have maintained the list of enviromnet variable into the param file, and I'm using that file into the datastage server job. I'm reading Enviroment variable name from the param file one by one and trying to call another datastage job i.e. Teradata_Login using UtilityRunJob routine and passing the enviroment variable in the transformer. The Teradata_Login job confirms/check the userid having access rights.

In the above UtilityRunJob routine example the DSLink9.ID, DSLink9.WORD and DSLink9.SERVER are the columns and contains enviroment variable name. Consider the DSLink9.ID column having content $LegacyUserID, the DSLink9.WORD having a content $LegacyPWD and DSLink9.SERVER having content $DBServer20.

In the project the enviroment variable having a content
$LegacyUserID=Dev_Legacy_User
$LegacyPWD=Legacy
$DBServer20=Tddev.

The called datastage i.e. Teradata_Login doesnot referencing the actual enviroment variable value which is we defined in the project. Teradata_Login job consider the $LegacyUserID as a value etc.


If you have any idea, how to resolve this issue. Please share with me.

Thanks,
Vivek

Posted: Fri Sep 05, 2008 1:29 am
by ray.wurlod
Can you get it to work using regular job parameters? Take the parameters file out of the picture for a moment, for the purposes of diagnosis.

Second, ought you not to be passing the environment variable value rather than the environment variable name?

Posted: Fri Sep 05, 2008 1:59 am
by Vivek Vazarkar
ray.wurlod wrote:Can you get it to work using regular job parameters? Take the parameters file out of the picture for a moment, for the purposes of diagnosis.

Second, ought you not to be passing the environment va ...

The following command working fine.

If DSLink9.JOBTYPE= 'TD' Then UtilityRunJob("Teradata_Login","UId=":$LegacyUserID:"|Password=":$LegacyPWD:"|Server=":$DBServer20,0,0) Else @NULL

But whenever I use a variable like DSLink9.ID, DSLInk9.WORD and DSLink9.SERVER which points to the enviroment variable, that time the called job gets aborted.

Posted: Fri Sep 05, 2008 2:20 am
by ray.wurlod
Show us how these "variables" (which look suspiciously like input column references) "point to" environment variables.

Posted: Mon Sep 08, 2008 11:13 am
by Vivek Vazarkar
ray.wurlod wrote:Show us how these "variables" (which look suspiciously like input column references) "point to" environment variables. ...
Thanks..
The content of the variable is the name of the Environment variable. Here I'm just trying to implement Pointer to Pointer C++ concept. If you have any idea please share with me.

Posted: Mon Sep 08, 2008 3:32 pm
by ray.wurlod
DSLink9.ID, DSLInk9.WORD and DSLink9.SERVER are not variables. They are references to columns on input link DSLink9.