Date: Thu, 17 Apr 2008 11:02:27 -0500
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: %Eval and dates
In-Reply-To: <200804171536.m3HAkmJk001963@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
The short answer is %SYSEVALF. But why are you doing this kind of
work using macro language? I don't think this is the best "path".
%let start_date='01Dec2005'd;
%let end_date='30Nov2006'd;
%let days=%sysevalF(&end_date.-&start_date.);
%put _user_;
On Thu, Apr 17, 2008 at 10:36 AM, Kevin Martino <kevinQED@gmail.com> wrote:
> Hi,
>
> I kind of know why this code is not working, with "A character operand was
> found in the %EVAL function ..." error message, but not sure what the
> solution is? Please could someone help?
>
> %let start_date='01Dec2005'd;
> %let end_date='30Nov2006'd;
> %let days=%eval(&end_date.-&start_date.)
>
>
> Thanks.
>
|