Gary,
I think MPEX is trying to be 'too helpful'. It sees you are entering a
date, and appears to convert it to the default YY/MM/DD format. Try
entering your last SETVAR using quotes around the value:
setvar purgedate "!purgemonth/!purgeday/!purgeyear"
Unfortunately, I don't have MPEX here to test it, but I think this might
work for you.
Steve Miller
Beechglen Development, Inc
Cincinnati, Ohio
----- Original Message -----
From: "Paveza, Gary" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, October 23, 2001 8:19 AM
Subject: Weird MPEX question
> I'm trying to set a variable to a date in the format I want (looking to
> return the date of 7 days ago), but I'm running into some trouble. And
what
> baffles me even more, is that the variables I'm working with are not
setting
> the way I expect them to. Can anyone tell me why the below is happening?
>
> %SETVAR PURGEDATE TODAY-7
> %
> %SHOWVAR PURGEDATE
> PURGEDATE = 01/10/16
> As expected
>
> %
> %
> %SETVAR PURGEMONTH STR("!PURGEDATE",4,2)
> %SHOWVAR PURGEMONTH
> PURGEMONTH = 10
> As expected
>
> %
> %SETVAR PURGEDAY STR("!PURGEDATE",7,2)
> %SHOWVAR PURGEDAY
> PURGEDAY = 16
> As expected
>
> %
> %SETVAR PURGEYEAR STR("!PURGEDATE",1,2)
> %SHOWVAR PURGEYEAR
> PURGEYEAR = 01
> As expected
>
> %
> %
> %ECHO !PURGEMONTH/!PURGEDAY/!PURGEYEAR
> 10/16/01
> As expected
>
> %SETVAR PURGEDATE !PURGEMONTH/!PURGEDAY/!PURGEYEAR
> %SHOWVAR PURGEDATE
> PURGEDATE = 01/10/16
> Okay, what in the world happened here?
>
> %setvar purgedate !purgemonth
> %showvar purgedate
> PURGEDATE = 10
> Let's try to set it to something else. Hmm...it takes the value just fine.
>
> %
> %setvar purgedate !purgemonth/!purgeday/!purgeyear
> %showvar purgedate
> PURGEDATE = 01/10/16
> Weird. Now I'm totally confused.
>
>
> -------------------------------------------------------------
> Gary L. Paveza, Jr.
> Production Support Analyst - Lead
> (302) 761-3173 - voice
> (877) 720-2970 - pager
>
> * 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 *
|