9.3.35 DATE (BUF)

Description:  Returns the current date as set within the system. 
Class:  Subroutine 
Arguments:  BUF is a 9-byte variable, array, array element, or character substring.

The date is returned as a 9-byte ASCII character string taking the form dd-mmm-yy, where:
   dd  is the 2-digit date
   mmm is the 3-letter month
   yy  is the last two digits of the year
If BUF is of numeric type and smaller than 9 bytes, data corruption can occur.

If BUF is of character type, its associated length is passed to the subroutine. If BUF is smaller than 9 bytes, the subroutine truncates the date to fit in the specified length. If an array of type character is passed, the subroutine stores the date in the first array element, using the element length, not the length of the entire array.

Warning: The two-digit year return value may cause problems with the year 2000. Use DATE_AND_TIME instead (see Section 9.3.36). 


Consider the following:


The length of the first array element in CHARACTER array DAY is passed to the DATE subroutine. The subroutine then truncates the date to fit into the one-character element, producing an incorrect result.

Previous Page Next Page Table of Contents