× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



One method is to pass it to one of the various date api's (see infocenter
and some of the samples in the archives).
Another is to call an RPGLE subprocedure in a service program to do it for
you. (And it's a good workout.)

CALLPRC PRC(MYDATECHECKER) PARM((&WORKDATE)) RTNVAL(&CHAR1)
if (&char1='0') do
// send abort message
else do
// date is ok
EndDo

However, if you REALLY want to verify it, then have your CL called by a
CMD. Then you have to convert it from what the PARM passes in (which will
be CYYMMDD) to your format:
PARM KWD(FROMDATE) TYPE(*DATE)

*DATE
The parameter value is a character string that represents a
date. When entering the command, the year may be specified with
either 2 digits or 4 digits. If a 2-digit year is specified,
the date is assumed to be in the range of January 1, 1940
through December 31, 2039. If a 4-digit year is specified, the
date may be in the range of August 24, 1928 through May 9, 2071.
When it is passed to the command processing program, it is
always passed in the format Cyymmdd, where C = century, yy =
year, mm = month, and dd = day. The century digit is set to 0
(zero) for years 19xx, and it is set to 1 (one) for years 20xx.
When a date value is specified in this PARM statement, it must
be specified in one of the following formats mmddyy, mmddyyyy,
or Cyymmdd. When a user types a date in the command at run
time, it must be specified in the job-date format. The job date
separator may be used when the date is entered. If the
separator character is used, the date must be enclosed in
apostrophes.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.