| Title: | FOCUS, from INFORMATION BUILDERS | 
| Moderator: | ZAYIUS::BROUILLETTE | 
| Created: | Thu Feb 19 1987 | 
| Last Modified: | Mon May 05 1997 | 
| Last Successful Update: | Fri Jun 06 1997 | 
| Number of topics: | 615 | 
| Total number of notes: | 1779 | 
Is it possible in FOCUS to do error trapping ?
Using &IORETURN it is possible to detect errors in Dialogue Manager 
read/write operations and &RETCODE gives the error status of a VMS command.
But I would like to detect an error in a TABLE request or a MATCH request
to terminate programs in a batch job in a controlled way, so without lots 
of error messages caused by following TABLE requests which can't execute 
because of non-existing HOLD-files. This would also give us the opportunity,
if an error occures, to display special information in the log-file and to 
ring some warning bells.
Does anyone know how to do this?
Rgrds,                   
      Andr� van 't Hoog
| T.R | Title | User | Personal Name | Date | Lines | 
|---|---|---|---|---|---|
| 174.1 | note 153 | MEMV01::COPPERSMITH | SYSTEM-W-RELFLT, reality fault | Tue Jan 31 1989 16:13 | 1 | 
| See note 153. | |||||
| 174.2 | ANOTHER WAY | FDCV10::MADDEN | Thu Feb 16 1989 11:05 | 26 | |
|     Another way,
    
    TABLE FILE ...
    ...
    END
    ? STAT
    -RUN
    -IF &READS EQ 0 GOTO NO_RECS;
    -ALLDONE
    -QUIT FOCUS 55
    -*
    -NO_RECS
    -QUIT FOCUS 99
    
        In the DCL routine
    $ RETURN_CODE = %X'$STATUS'
    $ IF RETURN CODE .EQS. 55  do something
    $ IF RETURN_CODE .EQS. 99 do something
    
        The above can be altered to help in MODIFY situations by looking
    at &ACCEPTS or some of the other statistical variables.  Also you
    
    can write & stats to a file and read them in DCL procedure to have
    double error check.
    
    Also note 153 is another way.
 | |||||
| 174.3 | Use &LINES for MATCH | THRILL::WILS | Joris Wils | Wed Feb 21 1990 16:21 | 19 | 
|     I couldn't get the method in 153 to work, because it isn't clear to
    me how &RETCODE works. Also when you do a MATCH &READS is not set. 
    &LINES is.
    
    So for reporting on MATCH or TABLE I use a separate FEX:
    MATCH FILE  (or TABLE FILE)
    :
    :
    END
    EX ERRREAD
    
    --------------------
    -* ERRREAD.FEX
    -IF &LINES EQ '0' THEN GOTO ERRREAD;
    -EXIT
    -*
    -ERRREAD
    -VMS DEFINE/JOB FEX$STAT 1
    -EXIT
 | |||||