Page 1 of 1

I am getting error while calling UtilityRunJob from a routin

Posted: Fri Apr 14, 2006 8:04 am
by RaviM
Hi All,

I am getting error while UtilityRunJob from user defiend routine. below is my code.
------------------------------------------------
$INCLUDE DSINCLUDE JOBCONTROL.H
Arg1 = "TestJob"
Str = UtilityRunJob(Arg1,"","","")
Ans = Str
----------------------------------------------

Error message :
Compiling: Source = 'DSU_BP/DSU.TestRoutine', Object = 'DSU_BP.O/DSU.TestRoutine'

0003 Str = UtilityRunJob(Arg1,"","","")

^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'UtilityRunJob' never dimensioned.

2 Errors detected, No Object Code Produced.

How do i solve this error

Posted: Fri Apr 14, 2006 8:24 am
by DSguru2B
Did you try to test the routine before even running it. The test should have what all arguments to pass in order to see the result of the job.

Posted: Fri Apr 14, 2006 8:40 am
by RaviM
Yes,

This UtilityRunJob working fine when i am calling from server job.
giving error only when i am calling from user defind routine.

DSguru2B wrote:Did you try to test the routine before even running it. The test should have what all arguments to pass in order to see the result of the job.

Posted: Fri Apr 14, 2006 8:55 am
by DSguru2B
You are calling a Transform from within a routine. As far as i know, i dont think you can do that. I might be wrong but i am pretty sure you cannot call a Transform from within a routine

Posted: Fri Apr 14, 2006 9:04 am
by DSguru2B
Moreover why are you doing your own user defined routine. Simple call that routine from the Transformer and just pass in the required arguments.

Posted: Fri Apr 14, 2006 10:15 am
by ogmios
What about the following... the original error is an indication it can't find the UtilityRunJob routine

Code: Select all

Deffun UtilityRunJob(Name, PA, R,W) Calling "DSX.UTILITYRUNJOB"

Arg1 = "TestJob"
Str = UtilityRunJob(Arg1,"","","")
Ans = Str 
Ogmios

Posted: Fri Apr 14, 2006 4:38 pm
by ray.wurlod
UtilityRunJob is not cataloged with a "DSU" prefix. From memory it's cataloged as "DSX.UTILITYRUNJOB". Someone with access to DataStage could perhaps verify this. That's the name that must be used in the CALLING clause. And note that it is case sensitive (all upper case).

Posted: Fri Apr 14, 2006 7:19 pm
by chulett
ray.wurlod wrote:From memory it's cataloged as "DSX.UTILITYRUNJOB"
Sounds right to me.