HP3000-L Archives

October 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Michael P. Smith" <[log in to unmask]>
Reply To:
Michael P. Smith
Date:
Fri, 23 Oct 1998 16:17:25 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (57 lines)
Well...

  To put it bluntly.   No.

  There is no built-in mechanism for seeing if the current day is indeed the
last day of the month.  Assuming you want to do this via JCL I am providing
a quick and dirty little command file I wrote for determining what the last
day of the month is.  Obviously you would simply call the command file and
check to see if HPDATE is equal to EOM (the variable that the command file
returns, and not so coinsidentaly the name of the command file.)


parm p1="!hpmonth" p2="!hpyyyy"
setvar _eom_month !["!p1"]
setvar _eom_year  !["!p2"]
if _eom_month=2 then
  setvar eom 28+( (1/(1+(_eom_year mod   4))) - &
                  (1/(1+(_eom_year mod 100))) + &
                  (1/(1+(_eom_year mod 400))) )
else
  setvar eom 30+(((_eom_month+(_eom_month / 8)) *3) mod 2)
endif
echo End of month !_eom_month/!_eom_year is !eom
deletevar _eom_@

The command file provided above does no error checking and unfortunately
does use 1 IF statement.  I just wrote this command file so I can't
guarantee that it works, although some quick testing seems to indicate that
it does.  Good luck.


 ---------------------------------------------------------------
| Michael P. Smith                                              |
| Sr. Systems Programmer                                        |
| The Hertz Corporation    [log in to unmask] (work)          |
| Oklahoma City, OK        [log in to unmask] (personal)      |
 ---------------------------------------------------------------
The thoughts, views and expressions contained in this message are those
of Michael P. Smith, and do not necessarily reflect those of the Hertz
Corporation.  To reply via email, remove the .xx from email address.


Therm-O-Link wrote in message ...
>Is there an easy way to determine if today is the last day of the
>current month?

>I know I can do it with some effort by coding a series of IF statements
>and checking what the current month is and if the current day is 31 or
>30 or 29 or 28 (depending on the month and whether the current year is
>a leap year or not), but I'd like to do it in and easier (and hopefully)
>more efficient manner.

>Jim Phillips                            Manager of Information Systems
>E-Mail: [log in to unmask]      Therm-O-Link, Inc.
>Phone: (330) 527-2124                   P. O. Box 285
>  Fax: (330) 527-2123                   Garrettsville, Ohio  44231

ATOM RSS1 RSS2