Page 1 of 2

regarding jobparameters used in DRS stage

Posted: Thu Dec 14, 2006 4:45 pm
by vijaykumar
hi,
i want to use parameters defined at project level in my source stage.
i defined a parameter using datastage administrator.
NAME TYPE PROMPT VALUE
DBMS TYPE STRING ENTER THE DATABASE NAME
in the value - i didn't give any name- i just set to default.

when i go to my source stage which is DRS STAGE, and browse for job parameter, it enters #RDBMS# and when i view the data, its asking for the database type.
since i didn't give any value while defining project level parameter its prompting for DBMS TYPE.
my team lead asks me to enter the jobparameter as
NAME TYPE PROMPT VALUE
$RDBMS STRING ENTER THE DATABASE NAME $PROJDEF
when define parameters and set to default are they stored in $PROJDEF directory.
how can i represent the jobparameters in the way as my team lead wants.
plz help me.
cheers;
vijay

Posted: Thu Dec 14, 2006 4:56 pm
by narasimha
Go to your Job properties
In the parameters tab you have a button called "Add Environment Variables"
Here you will find the Environment Variables you added in the Administrator. Select it.
You need to enter the default value as $PROJDEF
You will now find it in the format you want!

Posted: Thu Dec 14, 2006 5:00 pm
by I_Server_Whale
You can define these environment variables through DS administrator.

Go to DS Administrator, Select your project that you are working on, click on 'Properties', the property window opens, click on 'Environment' and then select 'User Defined'.

Here you can add the environment variables. Once you finish adding them and also assigning the default values.

You can access these defined environment variables in your DS job by opening 'Job Properties' and then by clicking 'Add Environment variable'.

Once you add a environment, the default value that you previously defined in the DS admininstrator will be assigned to it. Overwrite this value with '$PROJDEF'.

This way the variable will be assigned the value that was defined at project level (through DS administrator).

Whale.

Posted: Thu Dec 14, 2006 5:03 pm
by us1aslam1us
Go to environment variables and define your DBMS TYPE like MSSQL server , IBM DB2 or whatever .... and In your job properties 'Add Environment Variables' and assign the default to $PROJDEF.

Sam

Posted: Thu Dec 14, 2006 5:06 pm
by narasimha
Looks like everybody wants to give the same solution :wink:

Posted: Thu Dec 14, 2006 5:10 pm
by I_Server_Whale
Funny! Isn't it :wink: . Now the OP has the same solution worded in three different ways. Good for him. :)

Whale.

Posted: Thu Dec 14, 2006 5:47 pm
by us1aslam1us
That means I am learning a lot from you guys. 8) Really this is good for the OP.

Sam

Posted: Thu Dec 14, 2006 5:51 pm
by vijaykumar
Hi Gurus,
Thanks very much i could declare a jobparameter in the required fashion.
I got another problem , when i work out with DRS stage and browse for jobparameter , it says
NO PARAMETER FOR #RDBMS# EXISTS, due to want to declare such parameter.when i click yes and want to view data it prompts to enter the database name.
what happened to the parameter declared at project level, why isn't it taking the value at run time.
i declared parameter at project level as
NAME TYPE PROMPT VALUE
RDBMS TYPE STRING ENTER THE RDBMS NAME MYSQL SERVER

when to jobparameters and replaced by env variable $PROJDEF.

plz help me why does it says that parameter #RDBMS# DOESN'T EXIST, NO SUCH PARAMETER WAS DECLARED.
when i try to view the data from source why doesn't it take the data from
value of the parameter declared.why does it prompt to enter RDBMS TYPE.
plz help me
cheers;
vijay

Posted: Thu Dec 14, 2006 5:59 pm
by us1aslam1us
Ok got you!

You need to mention the Database name which you are hitting not the DBMS TYPE.

In ADMIN..


Code: Select all

 RDBMS     string     RDBMS NAME       Specify the name of database
Similarly define the userid and password,then go back to designer properties and ADD ENV VARIABLES.

Sam

Posted: Thu Dec 14, 2006 6:01 pm
by narasimha
Are you using #RDBMS# in your DRS stage, you should be using #$RDBMS#

Posted: Thu Dec 14, 2006 6:01 pm
by I_Server_Whale
Change to #$RDBMS# instead of #RDBMS#

Posted: Thu Dec 14, 2006 6:42 pm
by vijaykumar
Hi gurus,

THANKS VERY MUCH. i could solve that problem.

i specified the value of RDBMS- MSSQL SERVER
again, i changed it at joblevel- changed value to default value or env value $PROJDEF.
iam getting error
DS BROWSER..... DYNAMIC_RDBMS_0:UNKNOWN CLINET LIBRARY-$PROJDEF.

I understand from this error is that its not recognising $PROJDEF.
why is that so happening.when i try to view the data it comes up with
NAME VALUE
RDBMS NAME $PROJDEF
i get the following error
DS BROWSER..... DYNAMIC_RDBMS_0:UNKNOWN CLINET LIBRARY-$PROJDEF.

plz help me.
cheers;
vijay

Posted: Thu Dec 14, 2006 7:45 pm
by vijaykumar
Hi gurus,
i have given incomplete information.
the problem is
I declared a project level parameter.
RDBMS NAME i have given value- MSSQL SERVER.
At joblevel i selected user-defined param and i browse for the parameter which was declared at project level.

when keep the value of my parameter to MSSQL SERVER. its running properly , i could view the data from the source.
when i change it to $PROJDEF at joblevel, iam getting error
DS BROWSER UNKNOWN CLINET LIBRARY-$PROJDEF.

plz help me, is there why am i getting error when i use default value $PROJDEF.
if i want to use $PROJ DEF - what should i do-plz help me

Posted: Thu Dec 14, 2006 7:49 pm
by narasimha
Ahhh .. Now I know what you are doing wrong.
You don't have the default value set for RDBMS in the Administrator.
Go to Administrator and enter the value for RDBMS as "MSSQL Server", You should be fine :P

Posted: Thu Dec 14, 2006 7:51 pm
by DSguru2B
Are you getting that error while viewing data or while running? I know for viewing data, $PROJDEF was to be replaced by its true value in 7.5. But while running, it runs fine. This functionality was enhanced in 7.5.2 or 7.5.1A