regarding jobparameters used in DRS stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

regarding jobparameters used in DRS stage

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post 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!
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post 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.
Last edited by I_Server_Whale on Thu Dec 14, 2006 6:03 pm, edited 2 times in total.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Looks like everybody wants to give the same solution :wink:
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post 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.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

That means I am learning a lot from you guys. 8) Really this is good for the OP.

Sam
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post 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
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Are you using #RDBMS# in your DRS stage, you should be using #$RDBMS#
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Change to #$RDBMS# instead of #RDBMS#
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post 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
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post 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
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply