Read Parameter Frmo a Parameter File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
Read Parameter Frmo a Parameter File
Wanted to know if there is some way where I can mark my jobs to read from the parameter files, so that when the jobs are moved from Dev to UAT or Production we need not go and change the indiviual Parameters for each of the job. Could I get some such sample routine code
Thanks,
Thanks,
Last edited by Devyani Sarkar on Thu May 12, 2005 9:28 am, edited 1 time in total.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
You can do it, by calling your DataStage job from command prompt. In doing so, it can be called via unix shell script. You can have parameter file imported to a shell script, & the same can be passed to a
dsjob.
This one approach, I know.
Below is detail of Shell script :
SCRIPT STARTS
#!/bin/sh
. ./MyParamFile
dsjob -server $ServerFromParamFile -user $UserFromParamFile -password $PasswordFromParamFile -run -param param1=MyParam1 -param param2=MyParam2 DSRepository DSJobName
SCRIPT ENDS
Hope, I ans your Qn. Anyone knows better approach, please share.
dsjob.
This one approach, I know.
Below is detail of Shell script :
SCRIPT STARTS
#!/bin/sh
. ./MyParamFile
dsjob -server $ServerFromParamFile -user $UserFromParamFile -password $PasswordFromParamFile -run -param param1=MyParam1 -param param2=MyParam2 DSRepository DSJobName
SCRIPT ENDS
Hope, I ans your Qn. Anyone knows better approach, please share.
Thanks with regards,
videsh.
videsh.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
There is One way which we follow.
1. We call the Datasatge Jobs within the unix script .
2. As videsh suggested we use parameter.profile to set all the parameters except for the Passwords.
3 . Then using these parameters we get the Password from one of Server Wide script say get_pass.
ex. we get the Password by using $user (parameter value) from the Parameter.profile , Server Instance and userid of the user invoking the script.
1. We call the Datasatge Jobs within the unix script .
2. As videsh suggested we use parameter.profile to set all the parameters except for the Passwords.
3 . Then using these parameters we get the Password from one of Server Wide script say get_pass.
ex. we get the Password by using $user (parameter value) from the Parameter.profile , Server Instance and userid of the user invoking the script.
The question Devyani is asking has two facettes.
(1) How can I use parameter files
(2) If yes what is the best way to do it.
The first question is about to be answered, there are several ways, on is that you write a master job, which reads the parameter file and transfers the input to the files to run. For example Michael Olbrich has written such a master job, which fits to all satelit jobs a company could have and even checks if all parameter needed are also present.
An other approach is that how Thomas Meier did it via a Unix Script, which calles itself dsjob.
So that is not the problem.
Best way is to divide parameter in 3 parameter files:
(a) Dev-Level file, which contains all parameters which belong to the special developping level (development, test, integration, production), like DatabaseSID, DatabaseUser, DatabasePassword (yes do it via environtment) and so on.
(b) Job specific parameters, which are the same in each level, and are the same in each job run.
(c) Job run specific parameters, which are special for each run of the job.
If you devide all your parameters in these three block it will be very easy for you to maintain it.
Wolfgang
(1) How can I use parameter files
(2) If yes what is the best way to do it.
The first question is about to be answered, there are several ways, on is that you write a master job, which reads the parameter file and transfers the input to the files to run. For example Michael Olbrich has written such a master job, which fits to all satelit jobs a company could have and even checks if all parameter needed are also present.
An other approach is that how Thomas Meier did it via a Unix Script, which calles itself dsjob.
So that is not the problem.
Best way is to divide parameter in 3 parameter files:
(a) Dev-Level file, which contains all parameters which belong to the special developping level (development, test, integration, production), like DatabaseSID, DatabaseUser, DatabasePassword (yes do it via environtment) and so on.
(b) Job specific parameters, which are the same in each level, and are the same in each job run.
(c) Job run specific parameters, which are special for each run of the job.
If you devide all your parameters in these three block it will be very easy for you to maintain it.
Wolfgang
-
- Participant
- Posts: 15
- Joined: Wed May 11, 2005 12:09 pm
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
ds_developer wrote:I would use Environment Variables, but it depends on which version of 7 you are on. I know version 7.5 supports encryption, but 7.0.1 does not.
See the excellent write-up in the FAQs forum.
John
How is encryption possible on 7.5 datastage ,can please give the steps to
encrypt the parmeters and how are decrypted?
Thank you very much,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Charles,
here are some samples:
(a) Platform Parameters
DatabaseSID, DatabaseUser, DatabasePassword
(b) Job Parameters
TmpFileName, TargetTable, TargetFile, ErrorfileName
(c) Job Cycle Parameters
CycleNumber,Date, SourceFileName,
Sometimes you need mixed Parameter-content. That could be get by concatinating a b-Parameter like ErrContractFile with a c-Parameter like CycleNumber in your DS-job.
Kind regards
Wolfgang
here are some samples:
(a) Platform Parameters
DatabaseSID, DatabaseUser, DatabasePassword
(b) Job Parameters
TmpFileName, TargetTable, TargetFile, ErrorfileName
(c) Job Cycle Parameters
CycleNumber,Date, SourceFileName,
Sometimes you need mixed Parameter-content. That could be get by concatinating a b-Parameter like ErrContractFile with a c-Parameter like CycleNumber in your DS-job.
Kind regards
Wolfgang