DATA Step, Macro, Functions and more

macro var question

Reply
Frequent Contributor
Posts: 89

macro var question

dear all,
in example below...why is a not 1 within the macro??

%LET a=1;
%PUT >>>>>>>&a;

%MACRO ABC(test);
%PUT >>>>>>>&&test. ;
%MEND;

%ABC(a);


regards,
Herman
Super Contributor
Posts: 281

Re: macro var question

%abc(&a)
Respected Advisor
Posts: 3,799

Re: macro var question

[pre]
%PUT >>>>>>>&&&test. ;
[/pre]
Super Contributor
Super Contributor
Posts: 3,174

Re: macro var question

Posted in reply to data_null__
Suggested reading from the SAS support website http://support.sas.com/ found using a Google advanced search (listed below).

SAS Macro Language: Reference, Macro Variables:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a002047074.htm

Scott Barry
SBBWorks, Inc.

macro variable resolution site:sas.com
Super User
Posts: 10,028

Re: macro var question

@data _null_; is correct. He is more understanding about Macro variable and clever than me. Learned it.
Super Contributor
Posts: 673

Re: macro var question

%LET a=1;
%PUT >>>>>>>&a;

%MACRO ABC(test);
%PUT >>>>>>>&&test. ;
%MEND;

%ABC(&a.);
Ask a Question
Discussion stats
  • 5 replies
  • 139 views
  • 0 likes
  • 6 in conversation