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

Introducing NCL Procedures and Functions
Procedures and Functions
6–2 106160 Tandem Computers Incorporated
Built-in Functions A built-in function is a function distributed with your NonStop NET/MASTER
Management Services (MS) system. These functions are designed to return
information that may otherwise require extensive coding to acquire. The functions
perform a variety of useful operations such as:
Positioning strings
Manipulating strings
Testing strings
Formatting numbers
Testing numbers
Generating numbers
Data conversion
Returning the date and time
Returning operating system information
The NonStop NET/MASTER NCL Reference Manual completely describes the syntax of
all built-in functions.
Two examples of built-in functions are DATE and TIME. The DATE built-in function
returns the current date in the format you specify and the TIME built-in function
returns the current time in the format you specify. (The format is specified by the
number or letter in parentheses (( )) following the DATE or TIME keyword.)
The following example shows an NCL procedure that uses the DATE and TIME
built-in functions to display the current date and time in a variety of formats:
zex0601n: PROCEDURE
/* Built-in functions */
SAY "Default date is: "DATE() /* dd mmm yyyy */
SAY "Date 1 is: "DATE(1) /* yy.ddd */
SAY "Date 2 is: "DATE(2) /* ddd dd-mm-yyy */
SAY "Date 3 is: "DATE(3) /* dd-mmm-yyyy */
SAY "Date 4 is: "DATE(4) /* dd/mm/yy */
SAY "Date 5 is: "DATE(5) /* mm/dd/yy */
SAY "Date 6 is: "DATE(6) /* yy/mm/dd */
SAY "Date 7 is: "DATE(7) /* yymmdd */
SAY "Date 8 is: "DATE(8) /* yyyymmmdd */
SAY "Date 9 is: "DATE(9) /* Base date */
SAY "Time A is: "TIME(A) /* sssss.uuuuuu */
SAY "Time C is: "TIME(C) /* hh.mmxx */
SAY "Time H is: "TIME(H) /* Since midnight */
SAY "Time L is: "TIME(L) /* hh:mm:ss.uuuuuu */
END zex0601n