Macro programm lesson 8.3.5 demonstration3, warning message and error message are displayed

12 views
Skip to first unread message

Thirumagal manivannan

unread,
Oct 17, 2014, 11:26:11 AM10/17/14
to anova...@googlegroups.com
Hi,
I have run Macro programm lesson 8.3.5  demonstration3  code.
But " apparent symbolic reference CANADA is not resolved.

code
%macro countries(country);
title "Customers in &country";

%let country =%sysfunc(compress(&country));
proc print data=orion3.customer_dim noobs label;
where customer_country = "&&&country";
var customer_id customer_name customer_age_group;
customer_group;
run;
%mend countries;
%countries(Canada)

Log
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
42 ;
43
44 %macro countries(country);
45 title "Customers in &country";
46
47 %let country =%sysfunc(compress(&country));
48 proc print data=orion3.customer_dim noobs label;
49 where customer_country = "&&&country";
50 var customer_id customer_name customer_age_group;
51 customer_group;
52 run;
53 %mend countries;
54 %countries(Canada)
NOTE: Line generated by the invoked macro "COUNTRIES".
54 proc print data=orion3.customer_dim noobs label; where customer_country = "&&&country"; var customer_id customer_name
54 ! customer_age_group; customer_group; run;
______________
180
WARNING: Apparent symbolic reference CANADA not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.03 seconds
55 ;
56 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
66 ;


Thirumagal manivannan

unread,
Oct 17, 2014, 11:31:43 AM10/17/14
to anova...@googlegroups.com
Hi,
Previous post  is about Macro program lesson 8.5.2.lookup list
Regards
Thiru

Jennifer SUN

unread,
Oct 17, 2014, 2:25:29 PM10/17/14
to anova...@googlegroups.com
HI Thriu,

Instead directly tell you what wrong, how about you use what you learned from e-learning course to try figure it out first.

please try to use option mprint, mlogic, and symbolgen to see what wrong of your marco. If you do not know how to use those options, please review the lesson 8.

Jennifer

Anova Groups

unread,
Oct 17, 2014, 11:02:24 PM10/17/14
to anova...@googlegroups.com
First write a simple proc print for some country and see it works and then generalize your code.
Reply all
Reply to author
Forward
0 new messages