Date: Wed, 8 May 2002 06:00:00 GMT
Reply-To: gsnell@datasavantconsulting.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gregg Snell <gsnell@DATASAVANTCONSULTING.COM>
Subject: Re: Failure in Month and Year Functions (invalid argument)
Gigi,
The date functions of MONTH and YEAR will only work with a date value, not a
date-time value. Try this:
THISMNTH=MONTH(DATEPART(ADM_DATE));
THISYEAR=YEAR(DATEPART(ADM_DATE));
Regards,
Gregg P. Snell
>I'm running PC SAS v8.02. Have two statements that says:
>
>THISMNTH=MONTH(ADM_DATE);
>THISYEAR=YEAR(ADM_DATE);
>
>I get an errors every time they execute -- Invalid argument to function
>MONTH and Invalid argument to function YEAR.
>
>From the log I can see two example values that fail:
>ADM_DATE = 26FEB2002:22:13:20
>ADM_DATE = 29MAR2002:06:24:00
>
>Can anyone see why it's failing. Feel as though I'm missing something
>obvious, but I just can't figure it out. Any help would be
>appreciated...Gigi
>
>
http://www.datasavantconsulting.com
|