BookmarkSubscribeRSS Feed
SATISH2320
Calcite | Level 5

What are the different operations or procedures which can be used in Base SAS but not Macros and Viceversa?

4 REPLIES 4
SASKiwi
PROC Star

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.

Kurt_Bremser
Super User

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).

 

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Kurt_Bremser
Super User

@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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2030 views
  • 4 likes
  • 4 in conversation