Presentation is loading. Please wait.

Presentation is loading. Please wait.

Becoming A Master Manipulator

Similar presentations


Presentation on theme: "Becoming A Master Manipulator"— Presentation transcript:

1 Becoming A Master Manipulator
Using Macro Functions To Manipulate SAS® Enterprise Guide Date Prompts

2 Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health
Abstract Methods Results In surveillance and epidemiologic functions of public health departments, SAS codes are created to produce recurring reports. Typically, these reports will assess the status of selected reportable diseases across time periods to monitor trends, such as case counts for current month, current year, past years, yearly averages. Instead of having a separate SAS Enterprise Guide (EG) date prompt for each date value, macro functions can manipulate dates to reduce the number of prompts necessary. This paper explores using macro functions and SAS EG 7.1 date prompts to automate manipulation of date values in lieu of multiple date prompts for reports. Step 1 Create date prompts: The SAS programmer needs to assess how many sets of dates are needed to create the report and what is the minimum number of date prompts needed. For example, instead of creating 8 different prompts, we can use 4. Step 2 Create macros for dates captured from date prompt Use “call symputx” statements to apply functions to the macro variables Step 3 Apply formats to the dates to customize appearance in reports Use %sysfunc to apply formats to the variables Step 4 Create reports using these new dates Formatted new dates resulting from macros will be created From 4 prompt created macro variables, we can create 10 total date variables to be used for reporting Conclusions From a few initial sets of dates, we can create a series of related dates to create a comprehensive report monitoring trends. The end user will only need to input the initial sets of dates for the prompt and the SAS code will calculate the rest! Objectives Create date prompts Utilize macro functions to manipulate the dates Incorporate new dates into reports End s

3 Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health
Create date prompts In the example report, we can see the following dates are needed: Current month Current month one year ago YTD for this year YTD for last year Last year 2 years prior 3 years prior 5 year average Example report featuring multiple sets of dates ` Main Page Next Page

4 Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health
X Create date prompts Question: Is this too many prompts? Select your answer: A. Yes! B. Too many! Click here to continue ` Main Page Next Page

5 Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health
Create date prompts Instead of 8 prompts, we can use 4! Start Date End Date Year Start (Average) Year End (Average) Click here to continue ` Main Page Next Page

6 Click here to start manipulating!
Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health Manipulate variables &date_start &date_end &average_start &average_end Click here to start manipulating! Click here to continue ` Main Page Next Page

7 Click here to continue manipulating!
Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health Manipulate variables Click here to continue manipulating! Click here to continue ` Main Page Next Page

8 Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health
Initial variables Resulting variables ` Main Page Next Page

9 Becoming A Master Manipulator Edward Lan Los Angeles County Department of Public Health
Use them in reports! Click here to use! 01MAR MAR2018 or 01MAR MAR2017 01JAN MAR2018 or 01JAN MAR2017 01JAN MAR2018 ` ` Main Page Next Page

10 Contact Information Edward Lan County of Los Angeles Dept. of Public Health Tuberculosis Control Program ` S Title Main Page


Download ppt "Becoming A Master Manipulator"

Similar presentations


Ads by Google