How to initialize value of parameters automatically?

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
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

How to initialize value of parameters automatically?

Post by shamshad »

We first design out ETL job in TEST and then move to PROD. Most of our jobs uses parameters, most commonly

TEST PROD
InputFileName : Employee.txt ProdEmp.txt
InputFilepath : /local/inputfiles/ /local/prodinputfiles/
OutputFileName : Emplyeeout.txt ProEmp.txt
OutputFilepath :/local/outputfiles/ /local/prodoutputfiles/
DataBaseServer : DCMDBTEST DCMDBPROD
DatabaseUserid : dcmdb dsmdb
DatabasePasswd : dbpass01 dbpass01

(** DatabaseUserid and DatabasePasswd are same for test and prod.)

The values for above parameters are different in TEST and PROD. When we move the code from TEST to PROD, we have to go to JOB PROPERTIES and redit the parameter window and enter the PROD value.

Is there any way we do this automatic. What I mean is, we will have both TEST and PROD information Parameter Values saved in the ETL and based on where we are running the appropriate (TEST or PROD) value are initialized?

Any help appreciated.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You dont need to re-edit the values of the parameters. Why dont you pass the parameter values via a parameter file.
How exactly do you plan to run your jobs.
Is the control by a sequence job or the control is by a unix script?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

Post by shamshad »

My guess would be the jobs would be put in a Sequencer and will be scheduled.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

well if thats the case then i am guessing that you will have one master control sequences controlling other sequences/jobs.
When you schedule your process, pass the dsjob command along with a parameter file.
Maintain two files
test.params and prod.params
When running in the test environment, pass the command
dsjob -run `cat test.params`

and for the production environment
dsjob -run `cat prod.params'

The param file should be in the following format
-param paramname=paramvalue -param paramname=paramvalue -param paramname=paramvalue

This way you dont have to go and re-edit the param values for each environment.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
phanee_k
Charter Member
Charter Member
Posts: 68
Joined: Thu Nov 20, 2003 11:02 pm

Post by phanee_k »

See that the directory structures are the same across the environments like Dev / Test / Prod.
If the parameters are common across all the jobs in your project ,
create Project Level Parameters using the Administrator and set $PROJDEF to those parameters as default values.

This way , if the environment changes you need change the parameters as they will take the values from project defaults which are set in administrator.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Re: How to initialize value of parameters automatically?

Post by kcbland »

shamshad wrote:Is there any way we do this automatic. What I mean is, we will have both TEST and PROD information Parameter Values saved in the ETL and based on where we are running the appropriate (TEST or PROD) value are initialized?

Any help appreciated.
Intelligent job control, stored process metadata, and configuration values in a repository. The job control fetches the appropriate configuration values, retrieves pertinent process metadata, and derives other runtime values as part of its tasks of running jobs, analyzing quality of processing, and storing process metadata.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply