Job Parameter Value Assignment

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Job Parameter Value Assignment

Post 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.
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Re: Job Parameter Value Assignment

Post 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?
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

My reply had nothing to do with column names. Show us the contents of the value file you created.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's what Craig did say. :wink:

Just with a generic example.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Craig only speaks 'murrican.
:lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Re: Job Parameter Value Assignment

Post 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.
Thanks,
Pavan
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Re: Job Parameter Value Assignment

Post 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.
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply