SAS EG and Stored Processes: 3 Tips for Using Options
There are some helpful options you can set in SAS Enterprise Guide to make your day-to-day coding tasks a little quicker. Some of these tasks can impact stored processes you create from tasks instead of coding.
SAS Enterprise Guide Options
From the Tools > Options menu you can preset options such as footer text and default SAS code that you want run before or after a task executes. Sometimes this can be more helpful than other times.
Tip #1 – Adding a Default Footer
You can add a default footer or header to all of your SAS generated reports. If you are using the SAS Tasks, SAS automatically adds whatever you have preset in the Options. If you use SAS functions or macro variables your reports and graphs will appear more customized.
To set a default footer for your SAS Enterprise Guide reports and graphs, do this:
- From the Tools>Options menu, select the Tasks General pane.
- In the Default footnote text for task output field, type your text. For instance, I am using the default time and date to indicate the last time the report was updated.
Note! The date() function returns when the SAS Enterprise Guide session was started not the system time. Only causes a problem if you never log out of your SAS EG session.
Tip #2- Adding Code to Run before Each Task
You can add custom code to run before or after a task or a query. For instance, maybe you always want the output to be justified to the left. You would add the options nocenter; text. If SAS Enterprise Guide has an annoying behavior, sometimes you can control the options through this setting.
- From the Tool > Options menu, select Custom Code pane.
- Click the Edit button to type your custom code into the Edit window.
- Click the Save button when complete.
Tip #3 – Changing a Task to Stored Process
Now for the gotcha, if you are creating a stored process from a task flow instead of coding it, these options are added to the code. So you may have to temporarily disable the options if you do not want the stored process to have the behavior. In the following figure, you can see the log output with my custom code and footnote.
This does not hurt anything if it matches your intent for the stored processes. If it’s not what you want then you can either disable the option before creating the stored process or manually edit the stored process code.
Learn More about SAS Stored Processes and Prompts
You can learn more tips and tricks for creating, debugging, and using SAS stored processes in the 50 Keys to Learning SAS Stored Processes book. It's a complete guide to SAS stored processes. Check Amazon for best pricing and quick shipping!
Attending SESUG 2015?
If you are planning to attend SESUG 2015 in beautiful Savannah, Georgia on Sept 29 then join me for my talk about data visualization "How to be the MacGyver of Data Visualization"! I'll show you some cool ways to visualize data with SAS Visual Analytics as well as some traps to avoid.
Latest posts by Tricia Aanderud (see all)
- SAS VA: Is Location just a Distracting Character in Your Dataviz? - August 24, 2015
- Do You KISS Your Line Charts? - August 5, 2015
- How Not Knowing Pie Charts Makes You a #DataViz Rookie - May 7, 2015
- 6 Tips for Data Visualization from a Floral Designer - March 26, 2015
- SAS Coding: Use Flowcharts to Learn Inherited SAS Code - March 2, 2015