Scenario 5

Directions

This scenario uses the Certadv.Schedule data set. Write a SAS program that does the following:
  • Create a macro named CourseLoc with no parameters.
  • Use the SQL procedure to create a series of macro variables named LOC1, LOC2, and so on, that store the distinct values of the Location column in the Certadv.Schedule table.
  • Use the %DO loop to execute a PROC PRINT step once for each LOCn macro variable that is created. The PROC PRINT step should filter data based on the value of Location and the LOCn macro variable. Add a title with the text 'Courses Offered in' and substitute the value of the LOCn macro variable.
  • Call the CourseLoc macro program.

Test Your Code

  1. What is the value of Location for observation 18?
  2. What is the observation number where the Course_Code is C001, and Location is Boston?

Exam Objective

  • Automate programs by defining and calling macros using the SAS macro language.
  • Create data-driven programs using the SAS macro language.
Last updated: October 16, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.81.232