| Date: | Mon, 27 Oct 2008 10:40:51 -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: Warnings about Global macro variables created in Macro
Program that is called with CALL EXECUTE |
|
| In-Reply-To: | A<482249F865060740AE33815802042D2F0164422D@LTA3VS012.ees.hhs.gov> |
| Content-Type: | text/plain; charset="us-ascii" |
Ron,
Thank you for pointing me to the SGF paper. I read the section on CALL
EXECUTE and see where the NRSTR issue is discussed. I plan to keep the
paper marked for reference in the future.
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
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Fehd, Ronald J. (CDC/CCHIS/NCPHI)
Sent: Monday, October 27, 2008 10:13 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Warnings about Global macro variables created in Macro
Program that is called with CALL EXECUTE
Jack has provided the answer
Here's a paper which illustrates the problem of call execute w/out
nrstr:
Paper 113-2007:
Ronald J. Fehd and Art Carpenter
List Processing Basics:
Creating and Using Lists of Macro Variables
http://tinyurl.com/6mmqpj for
http://www2.sas.com/proceedings/forum2007/113-2007.pdf
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Jack Clark
> Sent: Monday, October 27, 2008 9:21 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Warnings about Global macro variables created in
> Macro Program that is called with CALL EXECUTE
>
> Good morning,
>
>
>
> I would like to understand some Warning messages I am getting
> in my SAS
> log when calling a macro program with CALL EXECUTE. I have tried to
> create a simplified version for posting to SAS-l, so it may seem
> somewhat contrived.
>
>
>
> Basically, I have a macro program which accepts a parameter.
> The macro
> program is called from a DATA _null_ with the CALL EXECUTE syntax.
> Inside the macro program, additional macro variables are created using
> PROC SQL. Also inside the macro program, the created macro variables
> are assigned to DATA step variables so the values can be used in an
> audit report.
>
>
>
>
>
> %macro classage (age=);
>
>
>
> proc sql noprint;
>
> select put (count (*), 12.-L)
>
> into :old_cnt
>
> from sashelp.class
>
> ;
>
> select put (count (*), 12.-L)
>
> into :new_cnt
>
> from sashelp.class
>
> where age = &age
>
> ;
>
> quit;
>
>
>
>
>
> data audit;
>
> student_age = &age.;
>
> totcnt = &old_cnt.;
>
> cnt = &new_cnt.;
>
> run;
>
>
>
> proc append base = audrpt data = audit;
>
> run;
>
>
>
> proc sql;
>
> drop table audit
>
> ;
>
> quit;
>
>
>
>
>
> %mend classage;
>
>
>
> data test;
>
> input age $ @@;
>
> cards;
>
> 11 12 13
>
> ;
>
> run;
>
>
>
> data _null_;
>
> set test;
>
> call execute('%classage (age='||age||');');
>
> run;
>
>
>
> proc print data = audrpt;
>
> run;
>
>
>
>
>
> Here is the issue I am having. When the CALL EXECUTE runs, it sees
> references to macro variables which are not created yet (the ones from
> PROC SQL) and gives a message in the log that APPARENT SYMBOLIC
> REFERENCE NOT RESOLVED. Otherwise, the logic works fine.
>
>
>
> Can someone explain the cause for this and recommend a way to prevent
> the WARNING messages from showing in the log? I know that the
> references to those macro variables are not resolved because they have
> to be created with the PROC SQL inside the macro program first.
>
>
>
> Thanks in advance,
>
>
>
>
>
>
>
> 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
>
>
>
>
> 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.
>
>
|