Page 1 of 1

Setting a parameter in before job subroutine

Posted: Thu Mar 30, 2017 1:31 pm
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' )
==================================

Posted: Thu Mar 30, 2017 2:20 pm
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:

Posted: Thu Mar 30, 2017 10:25 pm
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