NET/MASTER Network Control Language (NCL) Programmer's Guide
Examples of System-Level NCL Procedures
Developing System-Level NCL Procedures
106160 Tandem Computers Incorporated 17–35
LOGPROC NCL Procedures The following LOGPROC NCL procedure allows all log messages to pass through to
the activity log:
zex1713n: PROCEDURE
/* Passes all messages unchanged */
SAY LOGPROC starting
DO FOREVER
LOGREAD
END /*do*/
END zex1713n
This NCL procedure does not delete messages and it does not change messages. It
produces the same result as having no LOGPROC.
Note As discussed earlier in this section, the LOGCONT verb is not required after the LOGREAD verb when a
message is passed on with no changes.
The following LOGPROC NCL procedure logs all messages in the activity log:
zex1714n: PROCEDURE
/* LOGPROC to detect OPSYS commands and log them */
/* to a file - specifically "START," "STOP," and */
/* "ABORT." */
/* */
/* The name of the file used in this example is */
/* $DATA2.JOHNNCLS.OPSLOG, but you should change */
/* this to suit your own installation. */
/* */
/* This procedure assumes that you have already */
/* created the file (using a command such as FUP */
/* CREATE from TACL or OPSYS SEND FUP CREATE from */
/* the OCS command input line). An entry-sequenced */
/* file with a record length of 132 is adequate. */
/* */
/* This procedure assumes that the file is available */
/* for use, that is, you have issued the following */
/* commands from the INIT or READY NCL procedure: */
/* INTCLEAR TYPE=ALL */
/* INTCMD "UDBCTL RESET=$DATA2.JOHNNCLS.OPSLOG" */
/* INTREAD */
/* INTCMD "UDBCTL ID=OLOG OPEN=$DATA2.JOHNNCLS.OPSLOG"*/
SAY "LOGPROC starting"
FILE OPEN ID=OLOG FORMAT=UNMAPPED KEYEXTR=NO
DO FOREVER
LOGREAD ARGS
&arg1 = UPPER(&1)
&arg2 = UPPER(&2)
&arg3 = UPPER(&3)
&arg5 = UPPER(&5)
IF &arg1 = "START" AND ,
&arg2 = "OPSYS" AND ,
(( &arg3 = "START" OR ,
&arg3 = "STOP" OR ,