6. QUEL and EQUEL Statements : Endretrieve Statement—Terminate a Retrieve Loop : Example
 
Share this page                  
Example
The following example illustrates the use of the endretrieve statement to break out of a retrieve loop in the event of an error:
## retrieve (ename = employee.empname, 
    eno = employee.empnum)
## {
 load ename, eno into data set
 if error then print "error while loading!"
##  endretrieve
 end if
## }
## /* endretrieve transfers control to here */