Page 1 of 1

Passing parameter values through BASIC routine

Posted: Tue Nov 13, 2007 11:39 am
by karthikgk0705
Hi,

Although tons of topics have already been dealt here,I couldn't find one which best fits my scenario.Hence listing out here,

My datastage runs in windows, tool version - 7.0. I have numerous jobs in which the password and userid are hardcoded.I need to pass this as parameter such that I will be maintaing the values in a table as soon I change the values in the table all my jobs should be fed with the new value.I cannot use sequencers.I should do this either in BASIC routine or by a server job.If any of you have anyother approach pls put it forward. Also pls let me know how can I accomplish the above approach.

Thanks in advance.

Posted: Tue Nov 13, 2007 3:56 pm
by ray.wurlod
You can not set job parameter values once a job is running. That rules out a before-job subroutine.

You must set job parameter values before the job starts. This is most easily accomplished from a job sequence (which is a GUI for writing job control code). Or, of course, you could write your own job control code in the job properties windows of a server job.

The main function you need is DSSetParam(), but a best practice approach would also employ DSGetParamInfo() to validate that the parameter name does indeed exist in the job.

WHY can't you use job sequence?

Re: Passing parameter values through BASIC routine

Posted: Tue Nov 13, 2007 4:03 pm
by gateleys
karthikgk0705 wrote:I need to pass this as parameter such that I will be maintaing the values in a table as soon I change the values in the table all my jobs should be fed with the new value.
Wouldn't you be better off parameterzing all those 'hard-coded' connection string values? That way, you could use environment variables with the values set at the Admin level (instead of storing in some external table). This architecture is commonly practiced.
karthikgk0705 wrote:I cannot use sequencers.I should do this either in BASIC routine or by a server job.
I just don't understand these kinds of constraints. :roll:

Posted: Tue Nov 13, 2007 4:25 pm
by chulett
One thing to keep in mind - I don't believe that the 'environment variables' concept was fully baked in the 7.0 release...

Posted: Wed Nov 14, 2007 3:43 am
by sachin1
hello,

what i understand from your quotes is that you need to set values for all
job-parameter used in your jobs, plus when you change the values stored in database, it should use these new values.


1. First let your basic code read either a database or a file in which you will maintain username/password values.

2. Those values which are read in first step should be used to set values for job parameter for all your jobs.

3. you need to use DSAttachJob,DSRunJob,DSSetParam,DSDetachJob, DSGetJobInfo etc... please check for proper sequence.

4.you need to code all above 3 steps in basic code and use step 3 for all your jobs, this basic code need to be pasted in one of your normal datastage job(Job properties --> Job Control Tab) and execute this job which will run all your jobs sequentailly.

5. You can schedule this datastage job which will execute all your jobs.

these are the steps i use for my development and it works.

Posted: Wed Nov 14, 2007 8:48 am
by thurmy34
Hi
We use ini files to store our parameters.
We have a routine who read the file and then we use DSSetParam inside a job control.