BATCH: PROC RETURNS(BIT(1)); /* PROCEDURE DETERMINES WHETHER PROGRAM IS RUNNING BATCH AND RETURNS LOGICAL FLAG TRUE FOR BATCH, FALSE FOR INTERACTIVE AUTHOR: AL JAWORSKI DATE: 2/18/82 */ %INCLUDE SYS$TRNLOG; %INCLUDE $STSDEF; DCL TERMINAL_LENGTH FIXED BINARY(15) INIT(0); DCL TERMINAL CHAR(63) INIT(' '); STS$VALUE = SYS$TRNLOG('TT',TERMINAL_LENGTH,TERMINAL,,,,); IF STS$SUCCESS THEN DO; IF INDEX(TERMINAL,':')=0 THEN RETURN('1'B); /* LOGICAL NAME TRANSLATES TO 'OPA0' INDICATING BATCH */ ELSE RETURN('0'B); /* 'TT' TRANSLATES TO 'TTxx:' OR 'OPA0:' INDICATING INTERACTIVE */ END; ELSE PUT EDIT('Unable to determine whether running batch or interactive') (SKIP,A); END BATCH;