Page 1 of 1

Environment Variables versus Hard Coded values

Posted: Tue Sep 30, 2008 8:41 am
by wellison
Any suggestions would be appreciated. Have a simple server job that does a sql select statement to view rows in a table. If I run the job with the Server Name, User ID and password hardcoded, it works fine. However the minute I put the environment variables in and update the job parameters the job fails. I have checked the job parameters and made sure that the environment variables are correct and have the same values. I can also see in the failed log that the values pulled from the environment variables are the same as the hardcoded job log. I really stumped. Thanks

Posted: Tue Sep 30, 2008 8:48 am
by mikegohl
Are you using the variable surrounded by pound signs?

#$ENV_VARNAME#

Posted: Tue Sep 30, 2008 8:48 am
by ArndW
With which error message does the job fail?

Posted: Tue Sep 30, 2008 8:51 am
by DS_SUPPORT
What Stage you are using for Selecting the rows from Database, and what is the exactr error you are getting?

Posted: Tue Sep 30, 2008 9:01 am
by wellison
I am using the following variables:
#$HRDMPassword#
#$HRDMUser#
#$HRDMPROD#

The error message i am getting is:

testedwdev..DB2_UDB_API_0: [IBM][CLI Driver] SQL30082N Attempt to establish connection failed with security reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001

Unable to connect to DB2 server 'edwdev'.

The pulled variables from the environemnt:
HRDMPROD=edwdev
HRDMPassword=HD:D1:V1M9C?07FIM;JL@K1EBEMM5@Q4A
HRDMUser=hritmvr

Note: the hashed password is the exact hashed password that I get from the hardcoded run of this job. So I know that the password is the same for both the env and the hardcode.

Posted: Tue Sep 30, 2008 9:08 am
by chulett
What's your exact version of DataStage?

Posted: Tue Sep 30, 2008 9:09 am
by ArndW
try a test with the password being a string and not an encrypted parameter, does the error go away or stay?

Posted: Tue Sep 30, 2008 9:17 am
by wellison
version of DS 7.5.1

Posted: Tue Sep 30, 2008 11:13 am
by wellison
I am unable to change the password from variable to string. The password is controlled by the security group and the developers are not allowed to know or have the password.

Posted: Tue Sep 30, 2008 11:54 am
by ds_developer
I've had the same issue using 7.5.2. I could get the jobs to run in development, but had a lot of problems when they were promoted to QA or Production. The workaround was to use job parameters in the jobs and not environment variables. The sequences then contained the environment variables and passed them to the jobs to replace the job parameters.

Hope this helps.
John

Posted: Wed Oct 01, 2008 3:53 am
by ArndW
wellison - I didn't ask that the job gets changed permanently, just make a copy and change the datatype to see if this is the root cause of your problems.

Posted: Fri Oct 03, 2008 2:57 pm
by vivekgadwal
wellison wrote:I am using the following variables:
#$HRDMPassword#
#$HRDMUser#
#$HRDMPROD#

The error message i am getting is:

testedwdev..DB2_UDB_API_0: [IBM][CLI Driver] SQL30082N Attempt to establish connection failed with security reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001

Unable to connect to DB2 server 'edwdev'.

The pulled variables from the environemnt:
HRDMPROD=edwdev
HRDMPassword=HD:D1:V1M9C?07FIM;JL@K1EBEMM5@Q4A
HRDMUser=hritmvr

Note: the hashed password is the exact hashed password that I get from the hardcoded run of this job. So I know that the password is the same for both the env and the hardcode.
Since you define environment variables on a project level, use #$PROJDEF#. We are using that in our shop for a lot of projects and it works like a charm! :)

Work around.

Posted: Mon Oct 20, 2008 3:31 pm
by gxhpainter
Use flat file to store this information ( User name , password) and write a simple job to read the flat file and populate the variables .

Thess variables can be used in entire session. So we can execute the primary job thru sequencer .

Rgds,
Chakra