× 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.



Hi, Michael:

Try using the CVTDAT command.

You could do something like this:

DCL VAR(&DATE) TYPE(*CHAR) LEN(10) /* date in YYYY-MM-DD format */
DCL VAR(&RSLT) TYPE(*CHAR) LEN(10) /* result: validated date YYYY-MM-DD */
DCL VAR(&VLDD) TYPE(*LGL) /* valid date flag; 1=true, 0=false */
...
CHGVAR VAR(&VLDD) VALUE('1') /* assume date is valid */
CVTDAT DATE(&DATE) TOVAR(&RSLT) FROMFMT(*YYMD) TOFMT(*ISO)
MONMSG MSGID(CPF0550 CPF0551 CPF0552 CPF0553 CPF0554 +
CPF0555 CPF0556 CPF0557) EXEC(DO)
CHGVAR VAR(&VLDD) VALUE('0') /* indicate date is not valid */
ENDDO
...
IF (&VLDD) THEN(DO) /* valid date */
...
ENDDO
ELSE (DO) /* date not valid */
...
ENDDO

Does that help?

Cheers,

Mark S. Waterbury

> Michael Rosinger wrote:
List,

I need to pass in 2 dates to a CLLE program in the ISO format YYYY-MM-DD. Is there a straightforward way to validate a date value from a CLLE program instead of assuming they are valid? Suggestions?


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.