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

Explicit date calculations

You can use the DAYS and DAYSTODATE built-in functions to make date comparisons and calculations manually.

Comparing dates

To compare two dates d1 and d2 which have the date pattern YYMMDD, you can use the following code:

  DAYS (d1, 'YYMMDD', w) < DAYS(d2, 'YYMMDD', w)

Converting dates

You can convert between a two-digit date (d1) with the pattern YYMMDD and a four-digit date (d2) with the pattern YYYYMMDD using assignments:

d2 = DAYSTODATE(DAYS(d1,'YYMMDD',w), 'YYYYMMDD');
d1 = DAYSTODATE(DAYS(d2,'YYYYMMDD'), 'YYMMDD' ,w);

Terms of use | Feedback

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