HP3000-L Archives

July 2003, Week 5

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:
"Gates, Scott" <[log in to unmask]>
Reply To:
Gates, Scott
Date:
Wed, 30 Jul 2003 13:27:37 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (201 lines)
Thanks man. That's JUST what the doctor ordered.   Fit's quite nicely in my
job.


-----Original Message-----
From: Dave Gale [mailto:[log in to unmask]]
Sent: Wednesday, July 30, 2003 11:54 AM
To: Gates, Scott
Subject: Re: Need Date command File


Scott,

I have several date routines available to me. One will set a all variables
based on anydate you supply (it's really for a julian date type process)

Combine this with another date routine that will allow you to do the math as
you show it below, you can get any date AD you want. I originally wrote them
for Y2K, but have used them sucessefully in the type of jobs you are asking
for.

CALDATE will calculate the date based on  a julian date parameter. It needs
the JULIAN routine as it calls it internally when it is done. JULIAN will
just give you the date if you supply a julian or gregorian date.

To use them I would normally do something like

!JULIAN>$NULL               'retrieves today's date and sets the vars
!CALDAYS ![cal_days - 30] ' Sets vars you can use later in your code


Perhaps it will make more sense once you look at the code.

Enjoy,

Dave
----- Original Message -----
From: "Gates, Scott" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, July 30, 2003 11:26 AM
Subject: Need Date command File


> I've been writing a little command file that sets system variables as
dates
> for use in jobs.  It still kinda crude, hasn't been fully tested and a
> couple are weird but fit my specific needs at the time, but, it
> presently sets End of Last month, Beginning of Last month and the same for
the last
> quarter. (Kind like Maestro would set, if we had Maestro).   It even
handle
> leap years (Within reason: We're NOT going to care that 2100 is not a
> leap year, now are we?. THANKS HP!)
>
> As I do this, I think, I GOTTA be reinventing the wheel.
>
> So, does anyone have any little Date Utility ditties out there that
> like will SETVAR TODAY-1, TODAY-2, TODAY-7 TODAY-30 etc, etc.
>
> I've appended mine to the end of this note.
>
> Scott Gates
> Programmer/Analyst
> Information Services
> Our Lady of Bellefonte Hospital
> P.O. Box 789
> Ashland, Kentucky 41105-0789
> -----------------------------------
> Phone: (606)833-3773
>   Fax: (606)833-3342
> -----------------------------------
> Quote: ...Computers are...stupid. Unlike human beings, computers
> possess
the
> truly
> profound stupidity of the inanimate. - Bruce Sterling - THE HACKER
CRACKDOWN
> -----------------------------------
> Intranet: http://Olbh01iis/intranet/index.html
> <http://Olbh01iis/intranet/index.html>
> Primary e-mail  : [mailto:[log in to unmask] <mailto:[log in to unmask]> ]
> Alternate e-mail : [mailto:[log in to unmask]
> <mailto:[log in to unmask]> ]
> -----------------------------------
> Our Lady of Bellefonte : http://www.olbh.com <http://www.olbh.com>
> -----------------------------------
> Confidentiality Notice: This e-mail message, including any attachments, is
> for the sole use of the intended recipient(s) and may contain confidential
> and privileged information.  Any unauthorized review, use, disclosure or
> distribution is prohibited.  If you are not the intended recipient, please
> contact the sender by reply e-mail, fax, or phone and destroy all copies
of
> the original message.
>
> COMMENT SETVARDT
> SETVAR LASTMONTH !HPMONTH - 1
> IF LASTMONTH = 0
>  SETVAR REPYEAR !HPYYYY - 1
>  SETVAR LASTMONTH 12
> ELSE
>  SETVAR REPYEAR !HPYYYY
> ENDIF
>
>
> SETVAR YEARMOD,!HPYYYY MOD 4
> SETVAR HPLEAPYR,FALSE
> IF YEARMOD = 0 THEN
>   SETVAR HPLEAPYR,TRUE
> ENDIF
>
> IF !LASTMONTH = 2 AND !HPLEAPYR = TRUE
>   SETVAR TEOM  "29"
> ELSE
>   IF !LASTMONTH = 2
>     SETVAR TEOM "28"
>   ELSE
>     IF !LASTMONTH = 4 OR !LASTMONTH = 6 OR !LASTMONTH = 9 OR
> !LASTMONTH =
11
>       SETVAR TEOM "30"
>     ELSE
>       SETVAR TEOM "31"
>     ENDIF
>   ENDIF
> ENDIF
> SETVAR TYY ,(RHT("!REPYEAR",2))
> SETVAR TMM, (RHT("0"+ "!LASTMONTH",2))
> SETVAR BOM, ("!TYY"+"!TMM"+"01")
> SETVAR EOM, ("!TYY"+"!TMM"+"!TEOM")
>
> COMMENT CALCULATE LAST BEQ AND EOQ
> IF !HPMONTH = 4 OR !HPMONTH = 5 OR !HPMONTH = 6
> SETVAR BOQ ,("!TYY" + "0101")
> SETVAR EOQ ,("!TYY" + "0331")
> ENDIF
> IF !HPMONTH = 7 OR !HPMONTH = 8 OR !HPMONTH = 9
> SETVAR BOQ ,("!TYY" + "0401")
> SETVAR EOQ ,("!TYY" + "0630")
> ENDIF
> IF !HPMONTH = 10 OR !HPMONTH = 11 OR !HPMONTH = 12
> SETVAR BOQ ,("!TYY" + "0701")
> SETVAR EOQ ,("!TYY" + "0930")
> ENDIF
> IF !HPMONTH = 1 OR !HPMONTH = 2 OR !HPMONTH = 3
> SETVAR HPLASTYEAR, !HPYEAR-1
> SETVAR BOQ, ((RHT("0"+ "!HPLASTYEAR",2)) + "1001")
> SETVAR EOQ ,((RHT("0"+ "!HPLASTYEAR",2)) + "1231")
> ENDIF
>
> IF !LASTMONTH = 1
> SETVAR TMONTH,"JANUARY"
> ENDIF
> IF !LASTMONTH = 2
> SETVAR TMONTH,"FEBRUARY"
> ENDIF
> IF !LASTMONTH = 3
> SETVAR TMONTH,"MARCH"
> ENDIF
> IF !LASTMONTH = 4
> SETVAR TMONTH,"APRIL"
> ENDIF
> IF !LASTMONTH = 5
> SETVAR TMONTH,"MAY"
> ENDIF
> IF !LASTMONTH = 6
> SETVAR TMONTH,"JUNE"
> ENDIF
> IF !LASTMONTH = 7
> SETVAR TMONTH,"JULY"
> ENDIF
> IF !LASTMONTH = 8
> SETVAR TMONTH,"AUGUST"
> ENDIF
> IF !LASTMONTH = 9
> SETVAR TMONTH,"SEPTEMBER"
> ENDIF
> IF !LASTMONTH = 10
> SETVAR TMONTH,"OCTOBER"
> ENDIF
> IF !LASTMONTH = 11
> SETVAR TMONTH,"NOVEMBER"
> ENDIF
> IF !LASTMONTH = 12
> SETVAR TMONTH,"DECEMBER"
> ENDIF
> SETVAR REPLAB,"!TMONTH !REPYEAR"
> showvar REPYEAR
> showvar LASTMONTH
> SHOWVAR BOM
> SHOWVAR EOM
> SHOWVAR TMONTH
> SHOWVAR BOQ
> SHOWVAR EOQ
> showvar REPLAB
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2