GoTo Statement

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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Put the Label, where you want to jump to in your code or if you don't need it leave it away.

Wolfgang
I wrote the following code:

ReadSeq FileLine From CdrFileVar
On Error
Call DSLogWarn (" Error from " : " dwh/apps/ArdentFiles/cdr_sample.txt" : ", status : " :Status() , " Trial" )
GoTo ErrorExit
End

And I had the following error:

Label 'ErrorExit' not defined

So, my question is:
How can I use the GoTo statement, where can I define the labels and how can I make use of it?



Nancy Bebawy

Edited by - nancy_luca on 04/22/2002 08:50:32
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Here is an example using a GoSub and a label called GetInfo:

ErrCode = DSRunJob(hJob3, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob3)
Handle = hJob3
gosub GetInfo
...

*************************************************
* Function that returns information about the job
*************************************************

GetInfo:
Status = DSGetJobInfo(Handle, DSJ.JOBSTATUS)

begin case
case Status = DSJS.RUNNING

case Status = DSJS.RUNFAILED
* Fatal Error - No Return
call DSLogWarn("Job Failed: ":Jname, Bname)
end case

return
Post Reply