Read Parameter Frmo a Parameter File

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
Devyani Sarkar
Participant
Posts: 26
Joined: Thu Apr 15, 2004 12:54 am

Read Parameter Frmo a Parameter File

Post by Devyani Sarkar »

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,
Last edited by Devyani Sarkar on Thu May 12, 2005 9:28 am, edited 1 time in total.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You may either have to write a routine or a batch script. Otherwise you can set a project-wide variables.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

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.
Thanks with regards,
videsh.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Writing the parameters in a file creates the risk of password being openly displayed.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Can anyone please suggest, how we can safeguard passwords, & then can be passed in as parameter value, to a DataStage job?
Thanks with regards,
videsh.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

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
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Post by Gokul »

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.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

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
charles.craig@physiciansm
Participant
Posts: 15
Joined: Wed May 11, 2005 12:09 pm

Post by charles.craig@physiciansm »

Hello Wolfgang (WoMaWil),

I agree with your three tier approach to parameter management. Could you give specific parameters you keep in each tier, i.e.

(a) Platform Parameters
DatabaseSID, DatabaseUser, DatabasePassword

(b) Job Parameters

(c) Job Cycle Parameters
CycleNumber,Date?

Thanks,
CBC
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

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

Post by ray.wurlod »

Within the Parameters grid, specify the parameter type as Encrypted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

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
Post Reply