Passing parameter values through BASIC routine

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

Post Reply
karthikgk0705
Premium Member
Premium Member
Posts: 45
Joined: Tue Aug 29, 2006 2:59 am
Location: Bangalore

Passing parameter values through BASIC routine

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Passing parameter values through BASIC routine

Post 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:
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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...
-craig

"You can never have too many knives" -- Logan Nine Fingers
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post 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.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post 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.
Hope This Helps
Regards
Post Reply