What are the different operations or procedures which can be used in Base SAS but not Macros and Viceversa?
There is no difference. SAS macros are mainly used as code generation tools and must produce correct Base SAS code, the same as if you had done it without macros.
Note macros can be used to generate any SAS code not just Base SAS.
Misunderstanding of concepts here.
The macro language in SAS is a preprocessing language. It is designed to let a programmer create dynamic Base SAS code.
The macro language has its own elements that have a resemblance to elements of the data step language (for ease of use), but it does something completely different. The data step language deals with data, the macro language deals with code as its output.
You cannot use a procedure in the macro language, you create the code for it with macro language.
PS Certain interfaces exist that allow the macro language to use data step functions (%sysfunc) and the data step language to work with macro variables (sysget and call symput).
Actually: "the macro language deals with code as its output." - the macro pre-processor only deals with text. If that is code all well an good, but it doesn't necessarily have to be. All the macro language is a text generator, true it has some funky loops and things, but ultimately it just generates a string.
@RW9 yeah, right, but I wanted to avoid that some newbie then tries to manipulate strings contained in datasets with macro language. Young padawans come up with all kinds of crazy ideas concerning the macro language, as we all know.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.