This is one of those things discovered when
trying to find a solution to an old problem.
Putting the Last Day of Last Month automatically
into a job stream parameter. Our site puts
variables into job streams all the time.
It was calculating this one variable that was
difficult.
I spent a hour or so perusing VESoft Expressions
section of the MPEX manual.* And played around
with the DATEBUILD function to no success.
Finally I take a look at the DATEADD function,
and get the proverbial "light-bulb" of Eureka,
and get what I need with two SETVARs just
prior to the JOB card:
::SETVAR EOM DATEADD(TODAY,0,0,-!HPDATE)
::SETVAR EOMSTR CDATE(!EOM,"MMDDYY")
!JOB ...
...
{EOMSTR}
...
!EOJ
If you wanted the last day of the current
month you could use DATEADD(TODAY,0,1,-!HPDATE)
Although it may go wrong if the you're already
on the last day, and the next month has less
days than the current month. Given it was
an MPS calculation and not an GL program, it
may be livable a few days out of the year.
(It could easily be fixed with a few ::IF
statements.)
- - - - - - -
* (Sorry VESoft, the online help is a neat
feature, and there is a Windows help file out
there, there is nothing like flipping through
an actual paper manual when trying to find
something. Those of you that have paper
versions, hoard them like gold. I'm sure
there is a method of printing it in the
online help section, although getting it to a
printer double-sided in the notebook's 6" x
8.5" paper, which is something between A5 and
Foolscap Quarto, is a bit difficult. If
VESoft had stayed with the original US-A
notebook size of over 15 years ago. Then I
could update a regular manual by printing it.)
BT
Tracy Johnson
MSI Schaevitz Sensors
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|