Well, you didn't post anything to show what the error might be. So here are a couple of guesses.
There's a missing semicolon to end this statement: %do j= 1 %to 2
The delimiter for the %scan function is likely incorrect. Macro language does not need quotes to show what is text and what is a significant name. Instead, macro language uses & to show what is a significant name. So '*' as a delimiter means to use asterisks and single quotes as possible delimiters. It gets you the right answer as along as your values do not contain any single quotes. (Of course if your values do include single quotes, those might generate other problems.
When you have a macro and are trying to debug it, turn on the macro debugging options by running this command
options mprint;
and then run the macro, and show us the entire log for this macro (or the log down to this particular error).
Many thanks for your suggestions!
Well, you didn't post anything to show what the error might be. So here are a couple of guesses.
There's a missing semicolon to end this statement: %do j= 1 %to 2
The delimiter for the %scan function is likely incorrect. Macro language does not need quotes to show what is text and what is a significant name. Instead, macro language uses & to show what is a significant name. So '*' as a delimiter means to use asterisks and single quotes as possible delimiters. It gets you the right answer as along as your values do not contain any single quotes. (Of course if your values do include single quotes, those might generate other problems.
that semicolon was driving me cr4sy! Many thanks!! 😁
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.