Page 1 of 1

Passing parameters through a file

Posted: Fri Jan 06, 2006 4:17 am
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.

Posted: Fri Jan 06, 2006 4:57 am
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.

Posted: Fri Jan 06, 2006 5:06 am
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

Posted: Fri Jan 06, 2006 5:21 am
by ArndW
You cannot modify your parameter values inside the job itself.

Posted: Fri Jan 06, 2006 5:38 am
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....!!!!!!!!!!!!

Posted: Fri Jan 06, 2006 6:04 am
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.

Posted: Fri Jan 06, 2006 6:07 am
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

Posted: Fri Jan 06, 2006 4:07 pm
by ray.wurlod
Job control routines, such as RK has described, will also work to control parallel jobs.

Posted: Sat Jan 07, 2006 1:26 am
by kumar_s
Hi,
But iam bit confused :? How can we assign a paramter value within a job for itself.

-Kumar

Posted: Sat Jan 07, 2006 3:47 am
by ArndW
Kumar,

no reason to be confused - you cannot change a job's parameter values within the job itself.

Posted: Sun Jan 08, 2006 9:31 pm
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

Posted: Mon Jan 09, 2006 5:26 am
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