Date: Sat, 5 May 2007 20:30:50 +0000
Reply-To: iw1junk@COMCAST.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <iw1junk@COMCAST.NET>
Subject: Re: Macro Manipulations
Summary: %SYSEVALF recognizes date notation.
#iw-value=1
Richard,
For that matter there is no need for the inner %SYSFUNC when &SYSDATE is
accurate.
4 %let date2 = %sysfunc(sum(%sysevalf("&sysdate"d-1)),date.);
5 %put date2=&date2.;
date2=04MAY07
or to give SUM some purpose
6 %let date2 = %sysfunc(sum(%sysevalf("&sysdate"d)-1),date.);
7 %put date2=&date2.;
date2=04MAY07
Ian Whitlock
==============
Date: Sat, 5 May 2007 10:19:24 -0400
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion"
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: Internet News Service
Subject: Re: Macro Manipulations
Comments: To: sas-l
"Huang, JS" wrote: > This should work: > > %let yesterday =
%sysfunc(putn(%eval(%sysfunc (today())-1),date.)); > %put yesterday=
&yesterday;
There is no need for the putn. SYSFUNC has an optional second argument for
formatting results.
%let date2 = %sysfunc(sum(%sysfunc(today()),-1),date.); %put date2=&date2.;
-- Richard A. DeVenezia http://www.devenezia.com/