Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

REXX DATE COMPARISON

537 views
Skip to first unread message

bill...@my-dejanews.com

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
I am trying to compare the current date with a range of dates -- ie, current
date is 4/13/99, and the range is 4/10/99 - 4/30/99; question: is the current
date in the range.

So far as I can see, there is not a SAS-like common internal date format that
can be used to compare dates, which leads me to believe that I've got to
parse these dates and do it the hard way -- year to year, month to month,
etc. As I'm a newbie in REXX, I could be totally wrong.

Any thoughts on how I might do this in REXX would be appreciated.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Gilbert Saint-flour

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
In <7evvnb$b92$1...@nnrp1.dejanews.com>, on 13 Apr 1999 at 17:43,
bill...@my-dejanews.com said:

>I am trying to compare the current date with a range of dates -- ie,
>current date is 4/13/99, and the range is 4/10/99 - 4/30/99; question: is
>the current date in the range.

Use the date conversion capabilities of the DATE built-in function
available in the recent releases of TSO/E. For example,

DATE('B','04/13/99','U')

returns the number of days since the virtual origin of our calendar. Once
you've converted the two dates to a number of days, it's easy to compare
them. Make sure you provide the input date in the proper format, the DATE
function is quite touchy on this subject.

Gilbert Saint-flour <g...@ibm.net>

bill...@my-dejanews.com

unread,
Apr 27, 1999, 3:00:00 AM4/27/99
to
This is a followup question.

I have this code in a REXX exec.

" PriSDate=word(PriRec,1)
PriSCnt=DATE('B',PriSDate,'U') "

The intent is to convert PriSDate, a character date value from record PriRec,
into a number which can be used to compare the date with another date. When I
run the code across 90 or so MVS ESA images, about half work. The other have
return this:
99 +++ PriSCnt=DATE('B',date())
IRX0040I Error running MVSCALL, line 99: Incorrect call to routine
***
Any hints on what might be causing this problem would be most appreciated.

As a side note, I am using the 'Rexx in the TSO Environment' and Ranade's
'Programming In Rexx' books as my primary manuals. Neither mentions the
ability to have multiple parms for the DATE function -- only one. If anyone
happens to know of a manual which talks about this expanded parameter list
ability, I'd appreciate learning of it.

Thank you.

Ron MacRae

unread,
Apr 28, 1999, 3:00:00 AM4/28/99
to
If this works on some systems and not on others perhaps these others are at
an earlier version of TSO E. The ability of the DATE() function to have more
than 1 parm is relatively recent. It used to only work on the current date.


Regards, Ron MacRae.

bill...@my-dejanews.com wrote in message
<7g596o$h0u$1...@nnrp1.dejanews.com>...


>I have this code in a REXX exec.
>
>" PriSDate=word(PriRec,1)
> PriSCnt=DATE('B',PriSDate,'U') "

0 new messages