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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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