Page 1 of 1

Job Parameter Value Assignment

Posted: Mon Oct 13, 2014 7:36 am
by pavans
Hi All,

Scenario:
My run-id is created by oracle sequence in one job.
In subsequent job I need to use this generated value. So the requirement is assigning value of run-id generated in job1 to some variable/parameter and then pass the value to job2.

What I did:
Step1:
1. Created a parameter set (Say PS1) in datastage designer.
2. Created param name as JOB_ID
3. In Values tab gave File1 as file name.

Step2:
1. Created a Job J1, that writes one value to File1.
So job_id has value. Lets say it as 1001.

2. Created a Job J2 which loads a table that has 4 columns as below:
SourceTable, Sourceid, targettable , targetid
A,0,B,1001

Not I tried to pass paramfile value PS1.JOB_ID to targetid through JobActivity using the value expression.

But I am getting a zero passed everytime.

I could see a unique number created in Job J1 and is loaded to File1 in job J1.

I also tried using : field(convert(@FM,',', PS1.JOB_ID),',',1)

Am I missing something here.
Any help is really appreciated.

Thanks in Advance.

Posted: Mon Oct 13, 2014 8:16 am
by chulett
Parameter set value files need to be in name/value pairs (XXX=YYYY) and it sounds like you just wrote the value to the file. True?

Re: Job Parameter Value Assignment

Posted: Mon Oct 13, 2014 8:39 am
by pavans
Thank you for the quick reply.

Now I have set First Line is Column Names = True in the job J1.
Keeping all others same, I ran the job and I am getting the same output. :(

Do you think I should use a Execute Command Activity before Job J2 in the Job sequence?

Posted: Mon Oct 13, 2014 8:57 am
by chulett
My reply had nothing to do with column names. Show us the contents of the value file you created.

Posted: Mon Oct 13, 2014 3:21 pm
by ray.wurlod
What Craig is trying to say is that the entry in the value file should be of the form

Code: Select all

ID=1001
First line is column names should be False.

Posted: Mon Oct 13, 2014 5:06 pm
by chulett
That's what Craig did say. :wink:

Just with a generic example.

Posted: Mon Oct 13, 2014 6:42 pm
by ray.wurlod
Craig only speaks 'murrican.
:lol:

Re: Job Parameter Value Assignment

Posted: Tue Oct 14, 2014 4:19 am
by pavans
Yes. The value in the file looks like :

ID=1055

and is located at

F:\IBM\InformationServer\Server\Projects\PRO_NAME\valuefileDB

I created the file at this path rather creating it using Parameter Sets from designer.

I am confused on how to read this file now.

Re: Job Parameter Value Assignment

Posted: Tue Oct 14, 2014 5:01 am
by pavans
I was missing a execute command stage in below and the command.
I found it now. To read contents of param file we should use a in command 'type'.

It worked now.

Thank you all for your time.

Posted: Tue Oct 14, 2014 6:11 am
by chulett
A generic 'parameter file', yes - but then there's no need for the parameter name. A parameter set value file? No, that would be read automatically if setup properly.