Job Parameter's that include other Job Parameters

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jgm7841
Premium Member
Premium Member
Posts: 1
Joined: Thu May 06, 2004 5:09 pm

Job Parameter's that include other Job Parameters

Post by jgm7841 »

Is there a way to declare a job parameter and then use that job parameter in the default value of a parameter that appears later in the grid.

example:
declare SRC with a value of dev
and then declare
SOMEPATH with a value of /opt/somewhere/#SRC#/morepath
such that SOMEPATH evaluates to /opt/somewhere/dev/morepath at runtime.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

No.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only indirectly.
You need to do it in job control code, in which you build all parameters before issuing job run requests.

Code: Select all

hJob1 = DSAttachJob("Job1", DSJ.ERRNONE)
ErrCode = DSSetParam(hJob1, "SRC", "dev")

hJob2 = DSAttachJob("Job2", DSJ.ERRNONE)
SRC = DSGetParamInfo(hJob1, "SRC", DSJ.PARAMVALUE)
ErrCode = DSSetParam(hJob2, "SomePath", "/opt/somewhere/" : SRC : "/morepath")
Of course, you don't need DSGetParamInfo to determine the value of SRC, because it's already in the job control code. All you need is SRC = "dev"!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

If you want every part of your path to be a job parameter, and you want part of it to be DEV / TEST / PROD then consider two layers of batch/sequence jobs, the first sets multiple path variables and passes it through as consolidated paths to the child job.

Parent path has the following variables:
PROJECT_PATH "/opt/somewhere/"
ENVIRONMENT "DEV"
SOURCE_PATH "/sourcefiles"
LOOKUP_PATH "/lookupfiles"
REJECT_PATH "/rejectfiles"

Inside this sequence job you call another sequence job and pass it consolidated parameters which are then passed to server jobs:
FULL_SOURCE_PATH PROJECT_PATH:ENVIRONMENT:SOURCE_PATH
FULL_LOOKUP_PATH PROJECT_PATH:ENVIRONMENT:LOOKUP_PATH
FULL_REJECT_PATH PROJECT_PATH:ENVIRONMENT:REJECT_PATH

When you put your paths together you need to decide whether to do it once using this hierarchy or do it over and over in the actual path fields in server jobs.
Post Reply