differences between call symput and %let

Accepted Solution Solved
Reply
Contributor
Posts: 38
Accepted Solution

differences between call symput and %let

Hi everyone,

In the example below it makes a difference whether a macro variable is defined using CALL SYMPUT (here: &ab.) or %LET (here: &ab2.).

Why is that and are there any other noteworthy differences?

Thanks!

%Let a=1;

%Let b=2;

Data _null_;

     Call Symput ('ab','%Eval(&a.+&b.)');

Run;

%Let ab2=%Eval(&a.+&b.);

%Put &ab.;

%Put &ab2.;

%Let b=0;

%Put &ab.;

%Put &ab2.;


Accepted Solutions
Solution
‎10-28-2013 07:58 AM
Trusted Advisor
Posts: 1,131

Re: differences between call symput and %let

Please refer to the below link, it has good information about the question you asked

http://support.sas.com/resources/papers/proceedings10/028-2010.pdf

Thanks,

Jagadish

Thanks,
Jag

View solution in original post


All Replies
Solution
‎10-28-2013 07:58 AM
Trusted Advisor
Posts: 1,131

Re: differences between call symput and %let

Please refer to the below link, it has good information about the question you asked

http://support.sas.com/resources/papers/proceedings10/028-2010.pdf

Thanks,

Jagadish

Thanks,
Jag
Respected Advisor
Posts: 3,777

Re: differences between call symput and %let

It's the VALUE.  They are not the same.  Add this to see the value.

%Put &ab. %superq(ab);

%Put &ab2. %superq(ab2);
Contributor
Posts: 38

Re: differences between call symput and %let

Thank you very much!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1012 views
  • 3 likes
  • 3 in conversation