One common use of BTEQ testing and branching is to produce a message if certain conditions are met. For example, a script might include a request that is expected to change the database. In this case, an activity count of zero indicates a problem, even if no error code is returned. If the request is critical to the operations, try including the following command in the script, right after the request:
.IF ACTIVITYCOUNT = 0 THEN .QUIT 65
In this case, the return code of 65 would have been predefined to indicate that the request did not change the database.
Or, before quitting BTEQ, try branching to a different part of the script and use the REMARK command to specify a descriptive message to elaborate on the return code, as follows:
.IF ACTIVITYCOUNT = 0 THEN .GOTO PROB65 . . . .LOGOFF .EXIT 0 .LABEL PROB65 .REMARK 'Prob 65: The . . . request did not affect any rows' .QUIT 65