How to Use Userdefine Environment Variables into the Dsjob c

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, 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 Userdefine Environment Variables into the Dsjob c

Post by Vivek Vazarkar »

Hi,

I want to use userdefined environment variable into the dsjob command.

Consider I declared 3 userdefined environment variables into the project
ex:- 1) $LegacyDBUserID 2) $LegacyDBPwd 3) $DBServer20.

They are having content userid, password and server name respectively.

I want pass these 3 userdefined environment variables with dsjob command for my Teradata_Login job.

I'm using following command, but it's not working.

dsjob -run -mode NORMAL -param UId=$LegacyDBUserID -param Password=$LegacyDBUserID -param Server=$LegacyDBUserID Datawarehouse Teradata_Login

If anybody having idea. Let's share with me !

Thanks,
Vivek
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
mahadev.v
Participant
Posts: 111
Joined: Tue May 06, 2008 5:29 am
Location: Bangalore

Post by mahadev.v »

Set these variable values to "$PROJDEF" in the job. Then you dont have to specify them in dsjob command. Every time the job is run the project level value of the variable is taken.
"given enough eyeballs, all bugs are shallow" - Eric S. Raymond
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What does "not working" mean in this context?

What error message is generated?

Why are you setting $LegacyDBUserID for each of the three parameters? That's almost certain not to be correct.

Have you proven that each of these environment variables is set?
For example

Code: Select all

echo $LegacyDBUserID 
Have you tried isolating the environment variables?
For example
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:What does "not working" mean in this context?

What error message is generated?

Why are you setting $LegacyDBUserID for each of the three parameters? That's almost certain not to be correct.

...
Hi,

I made few changes. Now I'm trying to use these Userdefined environment variables with dsjob command.

I want to use userdefined environment variable into the dsjob command.

Consider I declared 3 userdefined environment variables into the project
ex:- 1) $LegacyDBUserID 2) $LegacyDBPwd 3) $DBServer20.

They are having content userid, password and server name respectively.

I want pass these 3 userdefined environment variables with dsjob command for my Teradata_Login job.

I'm using following command, but it's not working.

dsjob -run -mode NORMAL -param UId=$LegacyDBUserID -param Password=$LegacyDBPwd -param Server=$DBServer20 Datawarehouse Teradata_Login

Also I want to change these userdefined environment variables for each run. in the next run I will use $SalesDBUserID, $SalesDBPwd & $DBServer20.


If anybody having idea. Let's share with me !

Thanks,
Vivek
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

Post by Vivek Vazarkar »

mahadev.v wrote:Set these variable values to "$PROJDEF" in the job. Then you dont have to specify them in dsjob command. Every time the job is run the project level value of the variable is taken.
Thanks for your replay.

In the next run I want to use $SalesDBUserID, $SalesDBPwd & $DBServer20 with Teradata_Login Job.

The Teradata_Login job just login into the database and verfiying the userid for access rights ! Similary in the next run It will pickup another userdefined environment variable example $ProductDBUserID, $ProductDBPwd, $DBServer20.
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 »

The only way you can specify different environment variable names IS to specify different environment variable names.

Otherwise you'd need to create a reference to something that contains the new environment variable name, and a means of evaluating that reference so as to decode the environment variable.

And if I showed you how to do that, you'd demand yet another level of abstraction! And that way leads to insanity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Vivek Vazarkar wrote:
ray.wurlod wrote:What does "not working" mean in this context? What error message is generated?
<snip>
I'm using following command, but it's not working.
<snip>
If anybody having idea. Let's share with me !
The first idea to share with you is to answer Ray's first two questions. All you've done here is repeat the fact that "it's not working" which doesn't help us help you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply