Rational Developer for System z
PL/I for Windows, Version 7.6, Programming Guide

DAYS

DAYS returns a FIXED BINARY(31,0) value which is the number of days (in Lilian format) corresponding to the date d.

d
String expression representing a date. If omitted, it is assumed to be the value returned by DATETIME().

The value for d should have character type. If not, d is converted to character.

p
One of the supported date patterns shown in Table 36. If omitted, the compiler assumes that p is the default pattern returned by the DATETIME built-in function (YYYYMMDDHHMISS999).

p should have character type. If not, it is converted to character.

w
An integer expression that defines a century window to be used to handle any two-digit year formats.

The following example shows uses of both the DAYS and DAYSTODATE built-in functions:

  dcl date_format char(8) static init('MMDDYYYY');
  dcl todays_date char(8);
  dcl sep2_1993 char(8);
  dcl days_of_july4_1993 fixed bin(31);
  dcl msg char(100) varying;
  dcl date_due char(8);
 
  todays_date = daystodate(days(),date_format);
 
  days_of_july4_1993 = days('07041993','MMDDYYYY');
  sep2_1993 = daystodate(days_of_july4_1993 + 60, Date_format);
               /*  09021993    */
 
  date_due = daystodate(days() + 60, date_format);
          /* assuming today is July 4, 1993, this would be Sept. 2, 1993
 
  msg = 'Please pay amount due on or before ' ||
           substr(date_due, 1, 2) || '/' ||
           substr(date_due, 3,2)  || '/' ||
           substr(date_due, 5);

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)