Page 1 of 1

Problem with Routine

Posted: Wed Aug 04, 2004 6:19 am
by suma
Thanks a LOT!! Its very useful.I have generated code thro Job Control tab in Job Parameter.

But if i compile it in a Routine i am facing the same problem
Here is the code i generated,

hJob1 = DSAttachJob("test1", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: test1", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: test1", "JobControl")
End

The error i get is

Array 'DSAttachJob' never dimensioned.
WARNING: Variable 'DSJ.ERRFATAL' never assigned a value.
Array 'DSRunJob' never dimensioned.
WARNING: Variable 'DSJ.RUNNORMAL' never assigned a value.
Array 'DSWaitForJob' never dimensioned.
Array 'DSGetJobInfo' never dimensioned.
WARNING: Variable 'DSJ.JOBSTATUS' never assigned a value.
WARNING: Variable 'DSJS.RUNFAILED' never assigned a value.
WARNING: Variable 'DSJS.CRASHED' never assigned a value.
WARNING: Variable 'Ans' never assigned a value.

4 Errors detected, No Object Code Produced.


Can you tell me why i get this error 'never dimensioned' I get this error very often

Posted: Wed Aug 04, 2004 6:27 am
by chulett
Because DataStage has no clue that the functions you are trying to call are job control functions. Without you helping out, it thinks they are variables that you have never declared, i.e. never 'dimensioned'.

Add this to the top of the routine:

Code: Select all

$IFNDEF JOBCONTROL.H 
$INCLUDE DSINCLUDE JOBCONTROL.H 
$ENDIF 
This will cause the header file that contains the definitions of the Job Control functions you are using to be included in the routine.