Passing parameters through a file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Vennpras
Participant
Posts: 1
Joined: Fri May 06, 2005 3:38 am

Passing parameters through a file

Post by Vennpras »

Hi all,

Can we pass job parameters through a file while running a job instead of hard coding them in job properties or entering them manually while running a job in parallel jobs. I think it is possible but dont know in what way we can implement that in Parallel jobs. Please give some suggestions.
jayantthakore
Participant
Posts: 42
Joined: Tue Jan 18, 2005 5:48 am

Post by jayantthakore »

hii,
You can do it on the Unix prompt throgh a shell script..............
You will have a file which will contain all the parameters in the same order as the job..
In the Before job Subroutine you can call this file to assign the values to the parameter.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Hi Jayant

you mean reading from the file in the before job routine and assigning the job parameter?. I think you cannot assign parameters to the job's before job routine. Correct me if i am wrong.

--Balaji S.R
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You cannot modify your parameter values inside the job itself.
jayantthakore
Participant
Posts: 42
Joined: Tue Jan 18, 2005 5:48 am

Post by jayantthakore »

Yaa its possible you need to have a shell Script which read a file which have all your job parameter values.
Now call this shell script from the before job subroutine promt to get the values.

Hope you r getting me....!!!!!!!!!!!!
regards,
Jayant S Thakore
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Jayant,

at version 7 it is not possible to change a job's parameter values from before-job code.

In order to do what the poster wishes to do, the parameter file needs to be read as part of one job or sequence, the parameter values separated out and then the actual job called with these parameters.
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Hi
There is another option available in datastage server jobs but i am not sure that will be possible in parallel jobs

you have to write a piece of code for the job which is using the job parameters
compile the job which is using the job parameters and after the compilation open the job control tab of job properties and add a piece of code which will read a file and assign the values to the parameter list.

The external file will contain the parameter values stored in a textfile and be ensure to give the paramter values as related to parameters defined.

RK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Job control routines, such as RK has described, will also work to control parallel jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,
But iam bit confused :? How can we assign a paramter value within a job for itself.

-Kumar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Kumar,

no reason to be confused - you cannot change a job's parameter values within the job itself.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

rkdatastage wrote:Hi
There is another option available in datastage server jobs but i am not sure that will be possible in parallel jobs

you have to write a piece of code for the job which is using the job parameters
compile the job which is using the job parameters and after the compilation open the job control tab of job properties and add a piece of code which will read a file and assign the values to the parameter list.

The external file will contain the parameter values stored in a textfile and be ensure to give the paramter values as related to parameters defined.

RK
Hi RK,
Are you mentioning that a job A reads the parameter file and populated the value required to job B and calls it Or job A calls jobB which populate the parameter for job A :roll:

-Kumar
ThilSe
Participant
Posts: 80
Joined: Thu Jun 09, 2005 7:45 am

Post by ThilSe »

Hi,

You can write the required parameters to a file as follows:
param1=value1
param2=value2....

Now you can write a shell script that reads the "parameter=value" pairs from this file and use the -param flag of the "dsjob command" to specify the values to the datastage job.

Regards
Senthil
Post Reply