Environment Variables
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 57
- Joined: Wed Nov 15, 2006 10:25 am
- Location: Ottawa ON
Environment Variables
Hi all,
I have read all I could about the evironment variables on this forum.
I created a user-defined environment variable under administrator as $Server_NAME.
In my Job Properties, I add environment variable $Server_NAME under Parameters. In the default value, I could see the value that I put in by Administrator.
I put #$Server_NAME# in the Server Name of the DB2 stage.
I compiled and ran the job and got the error below. I tried to change the default value as $PROJDEF for $Server_NAME under Parameters. I compiled and ran the job again and still got the same error below.
DB2_UDB_API_0,0: Fatal Error: Fatal: [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009
DSTAGE-DB2CLI-0005`:`Unable to connect to DB2 server 'NOTLIKELYDSCAPIOP_$Server_NAMENOTLIKELY'.
Any advice? Please help!
Thanks
TD
I have read all I could about the evironment variables on this forum.
I created a user-defined environment variable under administrator as $Server_NAME.
In my Job Properties, I add environment variable $Server_NAME under Parameters. In the default value, I could see the value that I put in by Administrator.
I put #$Server_NAME# in the Server Name of the DB2 stage.
I compiled and ran the job and got the error below. I tried to change the default value as $PROJDEF for $Server_NAME under Parameters. I compiled and ran the job again and still got the same error below.
DB2_UDB_API_0,0: Fatal Error: Fatal: [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009
DSTAGE-DB2CLI-0005`:`Unable to connect to DB2 server 'NOTLIKELYDSCAPIOP_$Server_NAMENOTLIKELY'.
Any advice? Please help!
Thanks
TD
TPQ
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
-
- Premium Member
- Posts: 252
- Joined: Mon Sep 19, 2005 10:28 pm
- Location: Melbourne, Australia
- Contact:
Instead of running the job, try View Data from the DB2 stage in the designer window.
There is a bug in the Dynamic RDBMS stage (at least in v8) whereby it DOES recognise environment variables when you View Data, but does NOT when you run the job.
Possibly the same bug exists in the DB2 stage
There is a bug in the Dynamic RDBMS stage (at least in v8) whereby it DOES recognise environment variables when you View Data, but does NOT when you run the job.
Possibly the same bug exists in the DB2 stage
Ross Leishman
-
- Premium Member
- Posts: 57
- Joined: Wed Nov 15, 2006 10:25 am
- Location: Ottawa ON
Thanks to all for your advice.
I have tried to hard code the values and I got the DB2 connection works fine. I tried to use GetEnvironment variable and I did get it. But as soon as I want to apply to the DB2 stage and I got the problem.
I have read so much on this forum about this problem. Someone said he had the same problem and solved it by dsenv. He didn't say in details on it.
I don't know what it is. Can anybody tell me what it is and how to solve the problem with this???
Thank you so much in advance!
TPQ
I have tried to hard code the values and I got the DB2 connection works fine. I tried to use GetEnvironment variable and I did get it. But as soon as I want to apply to the DB2 stage and I got the problem.
I have read so much on this forum about this problem. Someone said he had the same problem and solved it by dsenv. He didn't say in details on it.
I don't know what it is. Can anybody tell me what it is and how to solve the problem with this???
Thank you so much in advance!
TPQ
TPQ
Hi,
Are you using the DB2 Enterprise Stage or DB2 API stage?
Try connecting to DB2 using these 2 stages.
Dont use the environment variable for now.
Just create a job parameter say server and try to use the parameter.
I have had the same issue with Teradata Multiload stage. It does not accept parameters which are defined as environment variables.
HTH
--Rich
Are you using the DB2 Enterprise Stage or DB2 API stage?
Try connecting to DB2 using these 2 stages.
Dont use the environment variable for now.
Just create a job parameter say server and try to use the parameter.
I have had the same issue with Teradata Multiload stage. It does not accept parameters which are defined as environment variables.
HTH
--Rich
Environment Variables
Sometimes connecting using ODBC stage solves the problem. There were instances where we could not connect to DB2 using DB2 stages, but were able to connect using ODBC stage.
-----------------------
R-Square
[Ravi Raj]
R-Square
[Ravi Raj]
-
- Premium Member
- Posts: 57
- Joined: Wed Nov 15, 2006 10:25 am
- Location: Ottawa ON
Re: Environment Variables
I use DB2 API stage and when I clicked on the Review Data button, I got the result correctly from the SQL that I wrote. But when I ran the job, the DB2 stage didn't recognize the environment variable.
I tried with ODBC but it didn't work with the environment variable. I worked with the Server Name that I clicked from the DataSource button.
I need to set up the environment variables which we could use with multi environments later for our system.
Thanks,
TPQ
I tried with ODBC but it didn't work with the environment variable. I worked with the Server Name that I clicked from the DataSource button.
I need to set up the environment variables which we could use with multi environments later for our system.
Thanks,
TPQ
TPQ
Hi TPQ,
As I mentioned earlier do not use the job parameter which you picked from the environment variables list ($Server_Name) to be used in the DB2 API stage.
Create a parameter which is unique to the job say Server_NAME.
Create a job sequence and add the environment variable $Server_Name in the job parameter list. Add the parallel job as a job activity in the sequence. In the job activity parameter list map $Server_Name to Server_Name.
This should solve your problem.
--Rich
As I mentioned earlier do not use the job parameter which you picked from the environment variables list ($Server_Name) to be used in the DB2 API stage.
Create a parameter which is unique to the job say Server_NAME.
Create a job sequence and add the environment variable $Server_Name in the job parameter list. Add the parallel job as a job activity in the sequence. In the job activity parameter list map $Server_Name to Server_Name.
This should solve your problem.
--Rich
-
- Premium Member
- Posts: 57
- Joined: Wed Nov 15, 2006 10:25 am
- Location: Ottawa ON