06-19-2017 02:37 AM
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.
06-19-2017 02:39 AM
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).
06-19-2017 04:10 AM
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.
06-19-2017 04:36 AM
@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.