My CA Ramis database has an AUTOMATIC PROCEDURE that is executing in BATCH as well as ONLINE. Is it supposed to execute in BATCH, too?

Document ID : KB000049684
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

My CA Ramis database has an AUTOMATIC PROCEDURE written in SBX that is executing in BATCH as well as ONLINE. Is it supposed to execute in BATCH, too? I only want it to execute when ONLINE.

Solution:

Yes, the AUTOMATIC PROCEDURE identified in CA Ramis database's file RAMSET's PROFILE field named PROCEDURE will be invoked in any environment including BATCH.

You can control any SBX procedure during execution by testing the value of the SBX variable %TERMINAL.

When running in batch the value of %TERMINAL is zero.

So, you can add the following to your SBX procedure and compile the procedure:

IF %TERMINAL EQ 0 THEN; EXIT; ENDIF;

This will cause the SBX procedure to end if it is being run on batch mode.