Page 1 of 1

How to Use Userdefine Environment Variables into the Dsjob c

Posted: Mon Sep 01, 2008 3:37 am
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

Posted: Mon Sep 01, 2008 3:45 am
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.

Posted: Mon Sep 01, 2008 3:45 am
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

Posted: Mon Sep 01, 2008 4:02 am
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

Posted: Mon Sep 01, 2008 4:06 am
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.

Posted: Mon Sep 01, 2008 6:32 am
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.

Posted: Mon Sep 01, 2008 7:19 am
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.