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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
The CORR and FREQ procedures4m 47s
-
(Locked)
The MEANS and UNIVARIATE procedures3m 22s
-
(Locked)
Demo: Ames home sales data exploration4m 15s
-
(Locked)
Selecting output to print and suppress2m 45s
-
(Locked)
Demo: Selecting output with ODS TRACE or the online documentation3m 45s
-
(Locked)
Saving results to new SAS data sets2m 22s
-
(Locked)
Demo: Creating data tables with ODS6m 9s
-
(Locked)
Creating global macro variables: Manually6m 35s
-
(Locked)
Creating global macro variables: Automating the process3m 26s
-
(Locked)
Demo: Creating and using macro variables6m 42s
-
(Locked)
Macro programming3m 56s
-
(Locked)
Creating macro programs with parameters5m 9s
-
(Locked)
Creating macro programs with macro statements: A business example4m 28s
-
(Locked)
Demo: A macro program to generate data, summary statistics, and plots6m 46s
-
(Locked)
Demo: A macro program for iterative processing8m 37s
-