Syntax: %SET DATE,{MDY|DMY|YMD}
Examples: %SET DATE,MDY
By default, MPEX dates -- in selection conditions, in the %CALC, %IF,
%SETVAR,
etc. commands, and so on -- are expected to be in MM/DD/[YY]YY (2- or
4-digit
year, with or without slashes) format. You can change this by saying
%SET DATE,DMY
to indicate that input dates will be in DD/MM/[YY]YY format or
%SET DATE,YMD
to indicate that input dates will be in [YY]YY/MM/DD format.
Note that while most commands do not make use of this setting to determine
how
to display date values, a few commands do use this setting. The commands
that
do make use of this setting have a note to that effect in their command
description. If you want to output a date in a specific format (in a %CALC
command or your own %LISTF template file), you can use the CDATEMDY,
CDATEDMY,
and CDATEYMD functions or the built-in formatting capability of the WRITELN
and
STRWRITE functions. (see Appendix for more details).
-----Original Message-----
From: Rao, Ragu [mailto:[log in to unmask]]
Sent: 23 October 2001 14:10
To: [log in to unmask]
Subject: Re: Weird MPEX question
yeah.. it works just fine with the quote.. still surprising as to why it
does not work without the quote. hmmm...
-----Original Message-----
From: Steve Miller [mailto:[log in to unmask]]
Sent: Tuesday, October 23, 2001 8:35 AM
To: [log in to unmask]
Subject: Re: [HP3000-L] Weird MPEX question
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 *
* 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 *
|