I won't say this is the best, but it may help you get what you want. I make 1960 a cut off point for no particular reason. That means that 00-59 are considered 2000-2059 and 60-99 are considered 1960-1999. You'd call the "verdate" routine
CALL VERDATE date-to-verify verdate: proc parse arg indate . if datatype(indate,"W") <> 1 then return "KO" /* not an integer */ if length(indate) <> 6 then return "KO" /* must be 6 digits */ parse var indate 1 yy 3 mm 5 dd if mm>12 then return 'KO' if dd>31 then return 'KO' yy='19'yy if yy < 1960 then yy=yy+100 days.1=31 days.2=28 days.3=31 days.4=30 days.5=31 days.6=30 days.7=31 days.8=31 days.9=30 days.10=31 days.11=30 days.12=31 if 0 = yy%4 then days.2=29 /* maybe leap year */ if 0 = yy%100 then days.2=28 /* or maybe not */ if 0 = yy%400 then days.2=29 /* yes, it is! */ if dd > days.mm then return 'KO' return 'OK' John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets® 9151 Boulevard 26 . N. Richland Hills . TX 76010 (817) 255-3225 phone . [email protected] . www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets® is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company®, Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM > -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:[email protected]] On Behalf Of CUNY Yann > Sent: Tuesday, April 26, 2011 10:31 AM > To: [email protected] > Subject: Re: Control date format using Rexx > > I have a dataset with a lot of date, in YYMMDD Format. > > I just want to verify that the dates indicated in the dataset > are real : > 120229 => OK > 100229 => KO > 101328 => KO > > Etc. > > -----Message d'origine----- > De : IBM Mainframe Discussion List > [mailto:[email protected]] De la part de McKown, John > Envoyé : mardi 26 avril 2011 17:25 > À : [email protected] > Objet : Re: Control date format using Rexx > > > -----Original Message----- > > From: IBM Mainframe Discussion List > > [mailto:[email protected]] On Behalf Of CUNY Yann > > Sent: Tuesday, April 26, 2011 10:17 AM > > To: [email protected] > > Subject: Control date format using Rexx > > > > Hi all, > > > > I would like to control a date format in a dataset with > REXX. I know > > it is possible to convert ... but I just want to make a control. > > > > Thanks in advance. > > > > Yann > > I don't understand. What does "make a control" mean to you? > Perhaps an example of the output you want would help. If you > need today's date in European format: dd/mm/yy, then > > TODAY=DATE('E') > > would do it. > > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ > 4A390/4.3.16 > > -- > John McKown > Systems Engineer IV > IT > > Administrative Services Group > > HealthMarkets(r) > > 9151 Boulevard 26 * N. Richland Hills * TX 76010 > (817) 255-3225 phone * > [email protected] * www.HealthMarkets.com > > Confidentiality Notice: This e-mail message may contain > confidential or proprietary information. If you are not the > intended recipient, please contact the sender by reply e-mail > and destroy all copies of the original message. > HealthMarkets(r) is the brand name for products underwritten > and issued by the insurance subsidiaries of HealthMarkets, > Inc. -The Chesapeake Life Insurance Company(r), Mid-West > National Life Insurance Company of TennesseeSM and The MEGA > Life and Health Insurance Company.SM > > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access > instructions, send email to [email protected] with the > message: GET IBM-MAIN INFO Search the archives at > http://bama.ua.edu/archives/ibm-main.html > > > Ce message est confidentiel; Son contenu ne represente en aucun cas > un engagement de la part de AXA Technology Services (AXA Tech) sous > reserve de tout accord conclu par ecrit entre vous et AXA Technology > Services (AXA Tech).Toute publication, utilisation ou diffusion,meme > partielle, doit etre autorisee prealablement. Si vous n'etes pas > destinataire de ce message, merci d'en avertir immediatement l'expe- > diteur. > > This message is confidential; its contents do not constitute a > commitment by AXA Technology Services (AXA Tech) except where provi- > ded for in a written agreement between you and AXA Technology > Services (AXA Tech). Any unauthorised disclosure, use or dissemina- > tion, either whole or partial, is prohibited. If you are not the > intended recipient of the message, please notify the sender imme- > diately. > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: GET IBM-MAIN INFO > Search the archives at http://bama.ua.edu/archives/ibm-main.html > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

