LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: cc: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>

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/


Back to: Top of message | Previous page | Main SAS-L page