From the course: SAS Programming for R Users, Part 2

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Creating macro programs with macro statements: A business example

Creating macro programs with macro statements: A business example - SAS Tutorial

From the course: SAS Programming for R Users, Part 2

Creating macro programs with macro statements: A business example

- [Instructor] A macro language statement instructs the macro processor to perform an operation. It consists of a keyword, and begins with a percent symbol (%) just like our macro call and macro definition, and ends in a semi-colon (;). Be sure to look up macro statements on the online doc page. There are a lot of different macro statements that you can incorporate into your own macro programming. We can do conditional processing with macro statements, so I can choose which proper data sets to run based on certain parameters. We can do parameter validation, check if a value is outside a specific range, and if it is we'll tell SAS to throw an error so it doesn't keep processing. And finally I'll show you how to do iterative processing on a demonstration. We want to read in multiple csv files all in a single macro program so I don't have to keep typing out proc import or the appropriate data steps. And this is one instance where macro programming can help quite a bit. Now to learn a…

Contents