UtilityRunJob with job parameter

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
eldonp
Participant
Posts: 47
Joined: Thu Jun 19, 2003 3:49 am

UtilityRunJob with job parameter

Post by eldonp »

I haven't figured out how to use a job parameter inside the UtilityRunJob utility. Given the following scenario.

Current jobname: JobParameters
Current job parameter name: JobToRun

Inside of a transformer stage, I have tried the following derivations:

UtilityRunJob('#JobToRun#','Project=':Link1.project,0,0)
UtilityRunJob("#JobToRun#",'Project=':Link1.project,0,0)
UtilityRunJob('JobToRun','Project=':Link1.project,0,0)
UtilityRunJob("JobToRun",'Project=':Link1.project,0,0)
UtilityRunJob(#JobToRun#,'Project=':Link1.project,0,0)
UtilityRunJob(JobToRun,'Project=':Link1.project,0,0)

None has worked yet.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The correct format was "UtilityRunJob(JobToRun,'Project=':Link1.project,0,0)". What happened when you tried that one (i.e. error message / warning / effects)? The parameter "Project" is case sensitive and must exist in the "JobToRun" job.
eldonp
Participant
Posts: 47
Joined: Thu Jun 19, 2003 3:49 am

Post by eldonp »

The problem I have is with the JobToRun parameter component. I can't get it to substitute the correct value at runtime.

Assigning the parameters to the job works ok. I do this by removing JobToRun and replacing it with the name of the job I want to run.

e.g.
UtilityRunJob('LoadCustFact','Project=':Link1.project,0,0) works ok.

but
UtilityRunJob('#JobToRun#','Project=':Link1.project,0,0) where the value of job parameter JobToRun at runtime is
LoadCustFact
does not work as I described above.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

eldonp wrote:UtilityRunJob('#JobToRun#','Project=':Link1.project,0,0)
will not work, since it will not expand the value of the parameter and look for a job name starting and ending with hash marks. Specify the JobToRun with quotes and without hash marks, as per the previous post.
Post Reply