SAS EG and Stored Processes: 3 Tips for Using Options

This post was kindly contributed by Business Intelligence Notes for SAS® BI Users - go there to comment and to read the full post.

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:

  1. From the Tools>Options menu, select the Tasks General pane.
  2. 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.   

  1. From the Tool > Options menu, select Custom Code pane.  
  2. Click the Edit button to type your custom code into the Edit window.   
  3. 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.

 

 

Know someone who would like this post? Share it:

Facebook

This post was kindly contributed by Business Intelligence Notes for SAS® BI Users - go there to comment and to read the full post.