Setting a parameter in before job subroutine

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
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Setting a parameter in before job subroutine

Post by samyamkrishna »

I am creating a before job subroutine
It looks as below.
My aim is to set a parameter.

but
Para=DSSetParam(DSJ.ME,'ParamName','JobName' )
always returns -1 to Para

full code
=================================

$INCLUDE DSINCLUDE JOBCONTROL.H

ErrorCode = 0


JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
ParamName = DSGetJobInfo(DSJ.ME,DSJ.PARAMLIST)
Para=DSSetParam(DSJ.ME,'ParamName','JobName' )
==================================
Cheers,
Samyam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't... it's far too late at that point. "Before Job" is a bit of a misnomer as the job has already started when they run, it's just that it is before anything on the canvas starts to run. So you need to set parameters before the job is actually started. As in actually "started started". :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you look up / do some research to find out what that -1 return code means? See this post from someone with the exact same issue:

viewtopic.php?t=136072
-craig

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