Sometimes, we do need that macro variable has only numeric value.
We can use %EVAL to judge if the string is numeric value.
* Sample;
%let mv=1+a;
%let a=%eval(%scan(&mv, 1, +));
%let b=%eval(%scan(&mv, 2, +)); * Error occurs;
SAS Senior Technical Consultant (twitter: @sasrunner)
Oakville, ON, Canada
Certified SAS Base/Advanced Programmer
Certified Data Integration Developer for SAS
Certified Platform Administrator for SAS
Certified Visual Business Analyst for SAS
SAS Certified Associate: Programming Fundamentals Using SAS Viya
SAS Certified Specialist: Intermediate Programming Using SAS Viya
* Sample;
%let mv=1+a;
%let a=%eval(%scan(&mv, 1, +));
%let b=%eval(%scan(&mv, 2, +)); * Error occurs;
No comments:
Post a Comment