setting parameter value in befor job routine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mickboland
Participant
Posts: 27
Joined: Sun Mar 20, 2005 4:23 am
Location: Brisbane, Australia

setting parameter value in befor job routine

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

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

"You can never have too many knives" -- Logan Nine Fingers
mickboland
Participant
Posts: 27
Joined: Sun Mar 20, 2005 4:23 am
Location: Brisbane, Australia

Post 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?
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post 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.
Ross Leishman
Post Reply