Page 1 of 1

How to call environment variable in DB2-Stage

Posted: Tue Nov 18, 2008 6:51 am
by yollsonlegrand
Hello!!!
has some one allready setting up the environment variables in the Administrator and then call the Database globales Parameters into a DB2-Stage without problem?
Sequentiel file and all other stages work well with my environment variables calling in this Stage. Only DB2-stage did not work well. To contourn the proble I'm oblige to set "server-name", "Userid", and "Password"-Parameters als Job parameters to run the job correctly. What is not gut. Because thise parameters must be define als Global Parameters.
Any Ideas will be very Helpful.
Thank' once more fore haven been given back your Idea. After populate the Target table I will say you if all work other no.

Posted: Tue Nov 18, 2008 2:41 pm
by ray.wurlod
Introduce the environment variables into your job as job parameters (or in a parameter set), then use job parameter references within your DB2 Enterprise stage or DB2 API stage.

Posted: Tue Nov 18, 2008 5:23 pm
by yollsonlegrand
ray.wurlod wrote:Introduce the environment variables into your job as job parameters (or in a parameter set), then use job parameter references within your DB2 Enterprise stage or DB2 API stage. ...
hello,
thanks for your Reply. Is there an other way to do this, differently from the way you advise it to me? Because, before calling in DB2-Stage or into ORACLE-Stage any parameters, this must be introduice in Job-Parameters tab of the Job Properties.
All my environment parameters are already introduice in this Job parameters. That is the reason this work well in other stage like Sequentiel file and so one.
The probleme is that, after seting up environment parameters(server_name, UserId, PWD) connexion to database in administrator and calling this in DB2-Stage like this: #$server_name#, #$UserId#, #$PWD# , runing the Job failed.
But by setting the same parameters als Job parameters and call this like this:#server_name#, #Userid#, #pwd# , runing the Job succeeded.
Perraph's I'm making some thingh wrong. But like I say. The same setting in Oracle_stage which failed down in DB2-stage, work very well. Is there an other way to do this fur DB2-Stage?
Yhank's for any Idea in advance.

Posted: Tue Nov 18, 2008 7:21 pm
by chulett
yollsonlegrand wrote:The probleme is that, after seting up environment parameters(server_name, UserId, PWD) connexion to database in administrator and calling this in DB2-Stage like this: #$server_name#, #$UserId#, #$PWD# , runing the Job failed.
Failed how?

Posted: Wed Nov 19, 2008 2:15 am
by yollsonlegrand
chulett wrote:
yollsonlegrand wrote:The probleme is that, after seting up environment parameters(server_name, UserId, PWD) connexion to database in administrator and calling this in DB2-Stage like this: #$server_name#, #$UserId#, #$PWD# , runing the Job failed.
Failed how?
I receive the followed Message Error:'DSTAGE-DB2CLI-0005': Unable to connect to DB@ server ' NOTLIKELYDSCAPIOP_$PS_DBPTTSOURCENOTLIKELY'.,
by running the Job with following parameters: #$server_name#, #$UserId#, #$PWD#. But if I set the same parameters als Job parameters all work well.
And I did another test by setting all the other stage(Sequentiel file, Lookup Set file etc..) with the environment parameters and only the DB2-Stage with the local parameters(job parameters). the job work very well.

Thank's for any Ideas

Posted: Wed Nov 19, 2008 8:00 am
by throbinson
You're SOL my friend. Those pesky IBM Developers didn't make environment variables work for all stages of a given job which limits the utility of environment variables for use in any DS job.
Bummer. Perhaps there is a DB2 patch?
The giveaway is seeing the DSCAPIOP_.

DataStage is not resolving this to a parameter value at runtime. It's not recognizing it as a parameter. We have the same problem with Teradata API stage. We're testing a patch.

Posted: Thu Nov 20, 2008 4:15 am
by yollsonlegrand
DataStage is not resolving this to a parameter value at runtime. It's not recognizing it as a parameter. We have the same problem with Teradata API stage. We're testing a patch.[/quote]

Thank's for this information.

Posted: Thu Nov 20, 2008 4:17 am
by yollsonlegrand
DataStage is not resolving this to a parameter value at runtime. It's not recognizing it as a parameter. We have the same problem with Teradata API stage. We're testing a patch.[/quote]

Thank's for this information.

Posted: Thu Nov 20, 2008 5:22 am
by arvind_ds
Create new job parameters at job level itself and not the one that have been defined through DS Administrator. Pass the values into these parameters for the said job from the job sequence as $Variable_Name under value expression using insert job parameter option.

HTH

Posted: Thu Nov 20, 2008 5:23 am
by arvind_ds
Create new job parameters at job level itself and not the one that have been defined through DS Administrator. Pass the values into these parameters for the said job from the job sequence as $Variable_Name under value expression using insert job parameter option.

HTH