| Date: | Fri, 14 Aug 2009 10:59:34 -0700 |
| Reply-To: | "Terjeson, Mark" <Mterjeson@RUSSELL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Terjeson, Mark" <Mterjeson@RUSSELL.COM> |
| Subject: | Re: Why doesn't this macro delete the empty dataset? |
|
| In-Reply-To: | A<954EFD7F5865E949A7BFE98789751F1961A266@ingrid.wsipp.wa.gov> |
| Content-Type: | text/plain; charset="us-ascii" |
Hi Laura,
Long time no see. :o)
Add an ampersand to the %IF macro variable
i.e.
Change
%if _hasobs = 0 %then
To
%if &_hasobs = 0 %then
Hope this is helpful.
Mark Terjeson
Investment Business Intelligence
Investment Management & Research
Russell Investments
253-439-2367
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Laura Harmon
Sent: Friday, August 14, 2009 10:52 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Why doesn't this macro delete the empty dataset?
I modified code from a prior sas-l posting from Jonathan Goldberg:
%macro tst;
%let _dsid = %sysfunc(open(tempc.Moduletypetoquestionanswerid));
%let _hasobs = %sysfunc(attrn(&_dsid, any));
%if _hasobs = 0 %then
%do;
proc datasets nolist library=tempc;
delete Moduletypetoquestionanswerid;
quit;
%end;
%let _dsid = %sysfunc (close(&_dsid));
%mend;
%tst;
But it isn't deleting tempc.Moduletypetoquestionanswerid, any advice?
Thanks in advance for your help.
Laura Harmon
|