×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




So what format is this?
11121211
YYYYMMDD or MMDDYYYY

That being said, review this:
D ds
D testSet 90 inz('2008-01-31123108 11/23/08
+
D 01/14/200802222007 013208
+
D 1234 11121211 010101
')
D TestArray 10 overlay(testSet) dim(9)
D ds
D testdate10 10a
D testdate8 8a overlay(testdate10)
D testdate6 6a overlay(testdate10)
D x s 5i 0
D length s 5i 0
D dspmsg s 25a
D
/free
*inlr=*on;
for x=1 to %elem(TestArray);
testdate10=%trim(TestArray(x));
length=%len(%trim(TestArray(x)));
if length=10;
test(de) *iso testdate10;
if not %error;
dspmsg=testdate10+' *iso';
dsply dspmsg;
iter;
ENDIF;
test(de) *usa testdate10;
if not %error;
dspmsg=testdate10+' *usa';
dsply dspmsg;
iter;
ENDIF;
dspmsg=testdate10+' bad10';
dsply dspmsg;
iter;
endif; // length=10
if length=8;
test(de) *iso0 testdate8;
if not %error;
dspmsg=testdate8+' *iso0';
dsply dspmsg;
iter;
ENDIF;
test(de) *usa0 testdate8;
if not %error;
dspmsg=testdate8+' *usa0';
dsply dspmsg;
iter;
ENDIF;
test(de) *mdy testdate8;
if not %error;
dspmsg=testdate8+' *mdy';
dsply dspmsg;
iter;
ENDIF;
test(de) *ymd testdate8;
if not %error;
dspmsg=testdate8+' *ymd';
dsply dspmsg;
iter;
ENDIF;
dspmsg=testdate8+' bad8';
dsply dspmsg;
iter;
endif; // length=8
if length=6;
test(de) *mdy0 testdate6;
if not %error;
dspmsg=testdate6+' *mdy0';
dsply dspmsg;
iter;
ENDIF;
test(de) *ymd0 testdate6;
if not %error;
dspmsg=testdate6+' *ymd0';
dsply dspmsg;
iter;
ENDIF;
dspmsg=testdate6+' bad6';
dsply dspmsg;
iter;
endif; // length=6
dspmsg=testdate10+' pucked';
dsply dspmsg;
iter;
ENDFOR;
/end-free
call rob/testdate
DSPLY 2008-01-31 *iso
DSPLY 123108 *mdy0
DSPLY 11/23/08 *mdy
DSPLY 01/14/2008 *usa
DSPLY 02222007 *usa0
DSPLY 013208 bad6
DSPLY 1234 pucked
DSPLY 11121211 *iso0
DSPLY 010101 *mdy0
dspjoblog

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.