Environment Variables versus Hard Coded values

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
wellison
Participant
Posts: 6
Joined: Thu Apr 10, 2008 1:49 am

Environment Variables versus Hard Coded values

Post 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
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

Are you using the variable surrounded by pound signs?

#$ENV_VARNAME#
Michael Gohl
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

With which error message does the job fail?
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

What Stage you are using for Selecting the rows from Database, and what is the exactr error you are getting?
wellison
Participant
Posts: 6
Joined: Thu Apr 10, 2008 1:49 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What's your exact version of DataStage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

try a test with the password being a string and not an encrypted parameter, does the error go away or stay?
wellison
Participant
Posts: 6
Joined: Thu Apr 10, 2008 1:49 am

Post by wellison »

version of DS 7.5.1
wellison
Participant
Posts: 6
Joined: Thu Apr 10, 2008 1:49 am

Post 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.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post 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! :)
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
gxhpainter
Premium Member
Premium Member
Posts: 28
Joined: Tue Jul 01, 2008 9:23 am

Work around.

Post 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
Post Reply