NET/MASTER Network Control Language (NCL) Programmer's Guide

Debugging an NCL Process From Start to Finish
Debugging an NCL Process
9–80 106160 Tandem Computers Incorporated
Step 12
Stop debugging the NCL process and the primary processing environment
environment associated with the OCS window, by using the DEBUG STOP command,
as shown in the following screen.
Use FUP to copy ZEX0904N to a new NCL procedure, ZEX0905N, as shown in the
following screen.
Edit the ZEX0905N NCL procedure and correct the suspected bug, by using the EDIT
command, as shown in the following screen. The following listing shows the changes
(in bold type) that you should make to the NCL procedure:
zex0905n: PROCEDURE
/************************************************/
/* Calendar display for a month in a given year */
/* &1 = month (01-12) */
/* &2 = year (1583-2999) (Gregorian calendar) */
/* Example: START ZEX0905N 02 2020 */
/************************************************/
&month = &1
&year = &2
/* Check the parameters are correct */
IF &month = "" OR &year = "" OR,
&month < 1 OR &year < 1583 OR,
&month > 12 OR &year > 2999 OR,
LENGTH( &month ) \= 2 OR,
LENGTH( &year ) \= 4 THEN DO
SAY "Reenter number(s): month 01-12; year 1583-2999"
FLUSH
END /*do*/
/* Array to set days in each month */
&days.01 = 31; &days.02 = 28; &days.03 = 31
&days.04 = 30; &days.05 = 31; &days.06 = 30
&days.07 = 31; &days.08 = 31; &days.09 = 30
&days.10 = 31; &days.11 = 30; &days.12 = 31
/* February has 29 days in a leap year */
IF DATECONV( 11, &year"/02/28", 11, 1 ) == &year"/02/29" THEN
&days.02 = 29
/* Table to get numeric value of first day of week */
&start = &year"/"&month"/01"
SELECT DATECONV( 11, &start, W )
WHEN Sunday THEN &first = 1
WHEN Monday THEN &first = 2
WHEN Tuesday THEN &first = 3
WHEN Wednesday THEN &first = 4
WHEN Thursday THEN &first = 5
WHEN Friday THEN &first = 6
WHEN Saturday THEN &first = 7
END
/* Draw calendar */
/* Heading lines */
SAY "Calendar for: "SUBSTR( DATECONV( 11, &start, N ), 4 )
SAY "Sun Mon Tue Wed Thu Fri Sat"
/* Construct display line up to starting point of first day */