How to Use Environment Variable into the UtilityRunJob routi

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
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

How to Use Environment Variable into the UtilityRunJob routi

Post 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.
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

Post 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
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

Post 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.
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Show us how these "variables" (which look suspiciously like input column references) "point to" environment variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

Post 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.
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DSLink9.ID, DSLInk9.WORD and DSLink9.SERVER are not variables. They are references to columns on input link DSLink9.
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