Page 1 of 1

setting parameter value in befor job routine

Posted: Wed Sep 28, 2005 6:28 am
by mickboland
I could be using the wrong approach but here i go:

What i want:
I want to add version numbes to the seq files that my jobs create
eg: c:\data\result #version#.csv

My Approach:
1. create a job parameter called version
2. add a before job routing to set the version parameter to a new value (using the KeyMgtGetNextVAlue routine)
3. add the param value to the seq file name eg: c:\data\result #version#.csv

My Problem:
1. I can get the version number in the routine successfully
2. BUT when i use the DSSetParam(DSJ.ME, "version", newversionvalue) function, it returns a DSJE.BADHANDLE error

Any suggestion on approach or why the error would be much appreciated.

Posted: Wed Sep 28, 2005 6:54 am
by chulett
'Before Job' is a bit of misnomer as the job has actually started at that point. Regardless, a job cannot set its own parameter values - it's too late at that point. Your controlling process, whatever actually runs the job, that process needs to do all of the parameter setting.

Posted: Wed Sep 28, 2005 3:43 pm
by mickboland
any way of adding a version number to an output seq file eg: c:\data\result #version#.csv

can you read a value from an input link an use it in the output filename?

Posted: Wed Sep 28, 2005 4:44 pm
by rleishman
Try searching this forum for @USER (use "exact match"). There are four global variables that can be set in a routine and accessed elsewhere in the job. I'm unsure as to whether they can be used in a filename like a parameter.