Munif, I was also thinking about this...if you request the dates in YY/M/DD format, you can make your verification much easier with this: Ver(&RVK,NB,IDATE,MSG=invalid date)
This would automatically take into account the different days in a month (for example, your sample would allow me to enter April 31, or February 31). Billy On Thu, Apr 19, 2012 at 8:19 AM, Thomas Berg <[email protected]>wrote: > An important note is that the rexx code is indentation sensitive, it must > obey the same indentation rules as the other panel code. Otherwise a S0C4 > abend is nearly sure. > > > > Regards, > Thomas Berg > ______________________________________________________ > Thomas Berg Specialist AM/DQS SWEDBANK AB (publ) > > > > -----Ursprungligt meddelande----- > > Från: IBM Mainframe Discussion List [mailto:[email protected]] För > > Bill Ashton > > Skickat: den 19 april 2012 13:58 > > Till: [email protected] > > Ämne: Re: ISPF Panel date validation > > > > Of course the REXX test on line 16 needs to have & instead of > > "and"...sorry > > about that! > > Billy > > > > On Thu, Apr 19, 2012 at 7:57 AM, Bill Ashton <[email protected]> > > wrote: > > > > > Munif, you may get other answers from the ISPF group if you join > > there, > > > but here is my untested quick stab at it... > > > > > > 000013 *REXX (STRT RVK RES) > > > 000014 date1 = Date("B",strt,"U"); > > > 000015 date2 = Date("B",rvk,"U"); > > > 000016 If (date2 - date1 <= 90) and (date2 > date1) Then > > > 000017 res = "OK"; > > > 000018 Else > > > 000019 res = "NG"; > > > 000020 *ENDREXX > > > 000021 > > > 000022 If (&res NE "OK") Ver(&rvk,LEN,EQ,99,MSG=Date to far in > > > future) > > > 000024 > > > > > > The Rexx will use the variables STRT and RVK from your panel, and will > > > create a result called RES. It will convert both dates to a base > > number > > > format and then compare them. It will see if RVK is 90 days or less in > > the > > > future and that RVK is further ahead than STRT, and set the result to > > "OK" > > > or "NG" depending on the test. > > > > > > Then the regular panel code will check the result switch, and if it is > > not > > > "OK" it will perform a VER that will always faill, so you can specify > > the > > > proper message number. > > > > > > Hope this works out for you. > > > Billy > > > > > > > > > > > > On Thu, Apr 19, 2012 at 6:56 AM, Terry Sambrooks < > > > [email protected]> wrote: > > > > > >> Hi Munif, > > >> > > >> Re: "I have been requested to modify a panel to verify that user > > input a > > >> valid date (MM/DD/YY) and the > > >> input date is no more then 3 months away (roughly speaking)." > > >> > > >> REXX may provide better validation capability in this instance, but > > you do > > >> not need to exit the panel, to use REXX as it can be embedded on the > > panel > > >> itself within the PROC section. > > >> > > >> It usage is described in Chapter 7 Panel Definition Statement > > Reference in > > >> the ISPF Dialog Developers Guide and Reference. > > >> > > >> Kind Regards - Terry > > >> > > >> Director > > >> KMS-IT Limited > > >> 228 Abbeydale Road South > > >> Dore > > >> Sheffield > > >> S17 3LA > > >> UK > > >> > > >> Reg : 3767263 > > >> > > >> Outgoing e-mails have been scanned, but it is the recipients > > >> responsibility > > >> to ensure their anti-virus software is up to date. > > >> > > >> > > >> > > >> > > >> --------------------------------------------------------------------- > > - > > >> For IBM-MAIN subscribe / signoff / archive access instructions, > > >> send email to [email protected] with the message: INFO IBM-MAIN > > >> > > > > > > > > > > > > -- > > > Thank you and best regards, > > > *Billy Ashton* > > > > > > > > > > > > -- > > Thank you and best regards, > > *Billy Ashton* > > > > ---------------------------------------------------------------------- > > For IBM-MAIN subscribe / signoff / archive access instructions, > > send email to [email protected] with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > -- Thank you and best regards, *Billy Ashton* ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

