LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (April 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 1 Apr 2010 15:18:35 -0400
Reply-To:     Jack Clark <jclark@HILLTOP.UMBC.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Clark <jclark@HILLTOP.UMBC.EDU>
Subject:      Re: Calling Macro
Comments: To: SAS Swamy <sasswamy@GMAIL.COM>
In-Reply-To:  A<201004011829.o31GEOVl026963@malibu.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

Swamy,

Try the CALL EXECUTE routine to call your macro in the DATA Step.

(untested)

data _NULL_; if &yesobs > 0 then call execute('%process_dates(data=TEST)'); run;

Jack

Jack Clark Senior Research Analyst phone: 410-455-6256 fax: 410-455-6850 jclark@hilltop.umbc.edu

University of Maryland, Baltimore County Sondheim Hall, 3rd Floor 1000 Hilltop Circle Baltimore, MD 21250

Please consider the environment before printing this email and/or any attachments.

Confidentiality Notice: This e-mail may contain information that is legally privileged and that is intended only for the use of the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying of this e-mail, distribution, or action taken in reliance on the contents of this e-mail and/or documents attributed to this e-mail is strictly prohibited. If you have received this information in error, please notify the sender immediately by phone and delete this entire e-mail. Thank you.-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of SAS Swamy Sent: Thursday, April 01, 2010 2:30 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Calling Macro

Hello everyone,

I have to run a Macro based on a condition , that only If rows exist in a data set then execute macro. This is how I am checking the data set whether any rows exist or Not .

data _NULL_; call symputx('yesobs',not eof); stop; set TEST_DATASET end=eof; run;

%put YESOBS=&yesobs; In the output , I am able to see 0 , when I try to open the TEST_DATASET it shows 0 observation.

But in the following condition , even though I am checking for value > 0 , the Macro is getting executed

data _NULL_; if &yesobs > 0 then %process_dates(data=TEST); run;

Can someone please let me know what Is the Issue and how to resolve this

Thanks In Advance,

- swamy


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