Specifying the EXIT statement

Use the EXIT statement to end script processing.

About this task

The following example uses the IF clause together with RC_OK to determine if clients are accessing the server. If an RC_OK return code is received, it indicates that client sessions are accessing the server. The script proceeds with the exit statement, and the backup does not start.
/* Back up storage pools if clients are not accessing the server */
select * from sessions
/* There are sessions if rc_ok is received */
if(rc_ok) exit
backup stg backuppool copypool