Pass multiple parameters from flat file to job sequence

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
haisen
Participant
Posts: 11
Joined: Sun May 11, 2008 1:42 am

Pass multiple parameters from flat file to job sequence

Post by haisen »

Requirement:
1) Pass multiple parameters from flat file to parallel job.
2) Parameters to be used globally by other jobs.

Flat File's Content:-
FILE_NAME=abc.txt
START_DATE=20080526
END_DATE=20080531

Currently, I managed to use a Execute Command to pass a SINGLE parameter to a Job Activity. However, DS doesn't allows multiple inputs.

Execute Command: grep FILE_NAME flatFilePath | cut -d"=" -f2
Job Activity: Field(hello.$CommandOutput,@FM,1,1)

TIA
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

Execute Command: grep FILE_NAME flatFilePath | cut -d"=" -f2
Job Activity: Field(hello.$CommandOutput,@FM,1,1)
You can manage with the same script in the job activity stage.
You can write a small shell script which will return you the all the values from the file in predefined order seperated by a delimiter.
The shell script may look like
FILE_NAME=`grep FILE_NAME flatFilePath | cut -d"=" -f2 `
START_DATE=`grep START_DATE flatFilePath | cut -d"=" -f2 `

and so .. on

the last line will be
echo $FILE_NAME $START_DATE " "

Then in the job activity stage you can extract the individual parameter
like
Field(hello.$CommandOutput,@FM,1,1)
Field(hello.$CommandOutput,@FM,2,1)
so on..


for this purpose you can write basic subroutine too.

Hope this will help you.
Birendra
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

Specify the parameters in a Parameter Set, and specify in the Parameter Set the file from which the default values are to be obtained.

You can specify different files for different projects (for example development, test, production).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
haisen
Participant
Posts: 11
Joined: Sun May 11, 2008 1:42 am

Post by haisen »

Thanks, got it to work using 1st mtd. Will try the method to globalise it.
Post Reply