SAS Enterprise Guide You ®

SAS Enterprise Guide You ®
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
Paper 416-2013
SAS® Enterprise Guide®, Best of Both Worlds: Is it Right for You?
Sunil K. Gupta, Gupta Programming, Simi Valley, CA
ABSTRACT
Whether you are new to SAS or a seasoned SAS Programmer, you still face the same dilemma. Does SAS
Enterprise Guide represent the best of both worlds to make the transition to SAS easier with a point-n-click interface
or enhance your productivity with over 90 tasks? Do you follow the same traditional path taken by millions who
learned SAS many decades ago or do you take the yellow brick road to directly analyze your data? This presentation
explores the vast differences between these two cultures and how they impact your programming environment. While
there are numerous benefits to using SAS Enterprise Guide, there are also some caveats to keep in mind to make
the transition smoother.
INTRODUCTION
Many organizations may find themselves lost by having SAS Enterprise Guide installed but not knowing how to get
started because the new approach is drastically different from traditional SAS programming. In this presentation, I
will explore the key differences as well as the similarities between the two different worlds.
SAS DISPLAY MANAGER VS. SAS ENTERPRISE GUIDE
Traditional SAS programmers are very familiar with the SAS Display Manager which is similar to a simple, open
village. In comparison, SAS Enterprise Guide offers more advanced tools that can be complex to develop. In making
the transition to SAS Enterprise Guide, when the timing is right for you, there are many features to take advantage of
including menu application, up to 90 tasks, querying multiple intermediate datasets and visual process flow.
Figure 1. SAS Display Manager vs. SAS Enterprise Guide
1
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
For those die-hard traditional SAS Programmers, you will be happy to know that you can change the display of SAS
Enterprise Guide to resemble the SAS Display Manager.
SAS Display Manager
Look
Figure 2. SAS Enterprise Guide Basics I
SAS ENTERPRISE GUIDE PROCESS FLOW
As a SAS Programmer learning SAS Enterprise Guide, one of my first tasks was to understand the process flow.
Some of the key questions I wanted answers to included how do I create and access SAS datasets, how do I write
my own code or use tasks to create summary tables and how can I read the SAS log. By reviewing the process flow
chart below, I realized that I was still able to access SAS datasets using a libname statement, submit my own SAS
program or use a task to create summary tables and access the SAS log.
In addition, now, I could take advantage of new features to document my steps with notes as well as visualize how
my summary table is produced by seeing the SAS dataset name, SAS program names as well as the output file
types. This visual process flow chart not only helps to communicate how the program works, but also documents the
SAS project and program.
Visualize your SAS
Programs
Figure 3. SAS Enterprise Guide Basics II
SAS Enterprise Guide has built-in tasks to make it easy to build SAS programs without having to type or remember
SAS syntax! Through a sequence of logical point-n-click menu selections, both technical and non-technical
professionals, including non-SAS programmers, can easily access, analyze and present data. When possible, SAS
Enterprise Guide displays graph images for visual selection of the chart layout. For the summary table task, for
example, you can drag and drop variables in the desired table layout structure.
2
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
Menu Selection to Build
SAS Program
Figure 4. Graph Gallery
PROGRAMMER’S GUIDE TO SAS ENTERPRISE GUIDE
As a die-hard SAS programmer, I am constantly searching for ways to help standardize and automate repetitive tasks
as well as save my client programming time. While SAS Enterprise Guide is like working in a „black-box‟
environment, there are at least four channels to insert custom SAS code.
Four Points of Custom Program Entry
_______
_
1. Execute code when first opening project file such as setup.sas.
2. Execute code before or after running a task.
3. Insert custom code at predetermined points within a task to run with task. Examples include before or after DATA
step or SAS Procedures and SAS Procedure statements or options.
4. Execute copied and customized generated code from task from a new program window.
With SAS Enterprise Guide, you can now more easily create prompts for user inputs. For example, after the user
selects a product from the drop down selection, the query executes and returns the product‟s sales results. The end
user does not need to be aware of the SAS code behind the menu prompt.
User Input to Build Query
Results
Figure 5. User Prompt Menu
And yes, there is a special object called the Program Node where you can write your own code and submit it as if you
were still working with SAS Display Manager. Below is an example of PROC REPORT. Note that any valid SAS
syntax will still execute within SAS Enterprise Guide. Note that you have the option to embed your SAS program
within SAS Enterprise Guide or execute the SAS program as an external file.
proc report data=mydatea.sales nowd split="*" headline;
column product year,(quantity sales pct_prd)
quantity=grd_tot sales=grd_pct;
define product / group 'PRODUCT';
define year / across 'Sales by Year' center;
define quantity / sum 'N' center format=comma6.;
define sales / sum 'Total' format=dollar8.;
define pct_prd / computed '% Total' width=5 format=pctf.;
define grd_tot / sum 'QNTY Total' format=comma6.;
define grd_pct / sum 'SALES Total' width=5 format=dollar8.;
compute before;
gt1=_c3_; gt2 = _c6_; gt3 = _c8_; endcomp;
3
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
compute pct_prd;
_c4_ = (_c3_/gt1)*100; _c7_ = (_c6_/gt2)*100; endcomp;
rbreak after / summarize skip ol ul;
compute after;
product = 'Total'; endcomp;
run;
Figure 6. PROC REPORT CODE
SAS ENTERPRISE GUIDE BEST PRACTICES
With any new software application, some level of training for both non-SAS programmers and SAS programmers is
required. Once SAS programmers get to „know their way around‟ SAS Enterprise Guide, they will be better able to
fully take advantage of SAS Enterprise Guide features. Based on my experience working on client projects, I have
listed 12 best practices below. I hope these tips will reduce your learning curve with SAS Enterprise Guide.
Best Practices Checklist
_______
_
1. Some level of training is required.
2. Write to SAS programs instead of embedding the SAS programs to keep as separate files.
3. Take advantage of Notes Task to document steps.
4. Apply „Save As‟ instead of „Save‟ to prevent accidental replacement of another project file.
5. Be careful when saving files when multiple projects are opened.
6. Take advantage of process flow diagram to visualize project code and tasks.
7. Take advantage of split panel to simultaneously view dataset and SAS program.
8. Take advantage of order list option to create batch jobs.
9. Take advantage of viewing each HTML/RTF/PDF file, for example, when creating multiple files.
10. For best debugging, keep all unique intermediate dataset names to view each data step sequence.
11. Put on your data mining hat to query explore most any intermediate dataset created to confirm assumptions.
12. Plan to follow a migration plan with your most open-minded SAS programmers before your closed-minded SAS
programmers.
Ideally you and your manager will be asking specific questions such as „What if SAS Enterprise Guide Could …‟.
This is exactly how my clients were able to optimize their investment in SAS Enterprise Guide. By going beyond „just
replacing the SAS Display Manager‟, my clients were able to save time with query exploration and management,
What If SAS Enterprise Guide Could?
_______
1. Help with querying and validating?
YES, with query exploration and management.
2. Help with documentation?
YES, with more portable package formats such as notes, SAS Programs, Lists, Logs and Output files.
3. Enforce standards and automation?
YES, with being fully compatible with SAS macros and menus.
4. Help with prototyping table layouts and performing complex statistical analysis?
YES, with feature to create custom tasks.
_
Below is an example of how query exploration and management allowed me to rerun saved queries to confirm labtest
results across several intermediate SAS datasets. Each SAS Enterprise Guide query allows you to select variables,
apply subset conditions as well as sort the order of records. In addition, nested queries are also possible.
4
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
Access Saved Queries
for each Intermediate
SAS Dataset
Figure 7. Query Exploration and Management
Below is an example of a checklist to enforce standards when creating SAS Enterprise Guide projects along with
steps for creating SAS datasets and tables. This checklist was effective to better organize the development and
validation tasks for a team of SAS programmers.
Standards:
Checklist
for General,
SAS
Dataset or
Table
Generation
Figure 8. Development Checklist
One of the gems I discovered was the Characterize Data task. By executing this one task against a SAS dataset, I
was able to quickly review all unique values of both character and numeric variables as well as descriptive statistics
for all numeric variables. Below is the PROC FREQ results of the NAME variable.
5
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
List of all unique values Automatic for both
character and numeric
variables. Can specify
number of unique values
to display.
Figure 9. Summary of Categorical Variables
Below is the PROC MEANS results of the following numeric variables: AGE, HEIGHT, and
WEIGHT.
Descriptive Statistics Automatic for each
numeric variable.
Figure 10. Summary of Continuous Variables
Top Four Unknown Benefits
Are you familiar with these three powerful SAS Enterprise Guide features? Once I asked SAS tech support „Could
SAS Enterprise Guide …‟, and discovered that yes, SAS Enterprise Guide can, I started to apply the features daily. I
hope you too can benefit from my discovery.
#1. The first feature is the ability to split the workspace screen to view multiple windows such as the SAS program
and dataset or log files simultaneously. For me, cross-referencing SAS code with the SAS log and SAS dataset
helps to provide a complete picture of my SAS program design. This benefit, combined with the second benefit,
reinforces that SAS Enterprise Guide is not just for non-technical professionals, but also for the SAS programmer diehards!
#2. The second feature is the power to save queries of multiple intermediate datasets such as sorts and filters for
each data review step within a SAS program. For example, there could be missing values or patients with data
issues that may cause unexpected results. SAS has a built-in system for us to trouble-shoot our SAS programs with
step-by-step review of each intermediate dataset. What a concept! Without this great feature, you would have to „reinvent‟ the wheel for each condition, select variables and sort query datasets for the debugging purpose of each step.
Who can remember all of these details or has the time to retype the SAS code?
6
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
#3. The third and final feature is the ability to run production SAS programs. Most organizations have a sequence of
SAS programs they need to run on a regular basis. Who wants to manually submit each SAS program? This is a
waste of time since you would not only need to monitor when the SAS program is done, but also need to track which
SAS program to run next.
SAS SAVVY: FREE SAS RESOURCES
Recently, I launched my SAS blog, www.SASSavvy.com, to better organize my access to useful resources on
www.support.sas as well as www.lexjansen.com. Instead of always drilling down to the best SAS papers and tips, I
decided to categorize these links by SAS procedures and SAS topics as well as reference them in common SAS
programming FAQ.
Below is a mind map I created to better identify best SAS papers for beginners, managers, SAS Display Manager and
Right For You as well as links to videos, facts and options.
Access Free
SAS Savvy
Resources
Figure 11. SAS Savvy: SAS Enterprise Guide Mind Map
7
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
Below is the link to free SAS Institute videos for learning SAS Enterprise Guide.
Access
Free SAS
Institute
Resources
Figure 12. SAS Enterprise Guide Video
Below are the same best SAS papers referenced in the SAS Enterprise Guide mind map.
Beginner Paper Writing Code in SAS® Enterprise Guide®, Susan Slaughter, Lora D. Delwiche
Management Paper Enterprise Guide for Business Analysts, Sunil Gupta
SAS Enterprise Guide Pros/Cons Paper What you get and what you lose when you switch to SAS
Enterprise Guide®, Andreas Mangold
SAS EG 4.3 One Page Summary Becoming a Better Programmer with 4.3
SAS EG 4.3 Paper New Goodies in SAS® Enterprise Guide® 4.3, Audimar Bangi, Chris
Hemedinger, Stephen Slocum
Pharma Application Paper 1 SAS Enterprise Guide in Pharmaceutical Applications: Automated
Analysis and Reporting, Alex Dmitrienko
Pharma Application Paper 2 Running Clinical Trials Programs with Enterprise Guide, Philip R
Holland
Free SAS Tutorials SAS Enterprise Guide Video
Free SAS Video SAS Enterprise Guide 4.3 Demo Video
Free SAS Video New Goodies in SAS Enterprise Guide 4.3
Business Intelligence User Group for other SAS Enterprise Guide papers
SAS EG Automation Example
SAS Institute Hot Fixes
SUMMARY
As we get to the end of the discussion of the similarities and differences between SAS Display Manager and SAS
Enterprise Guide, I hope you now have some insights into how and why you would consider migrating to SAS
Enterprise Guide. Unless you have a strong reason not to utilize SAS Enterprise Guide, I suggest you take the big
plunge and start taking small steps to use SAS Enterprise Guide. Both SAS Programmers and SAS Managers can
easily use SAS Enterprise Guide to better document, organize and analyze data for better decisions.
8
SAS Global Forum 2013
SAS® Enterprise Guide® – Implementation and Usage
Suggested Migration Steps
1. Export any or all SAS Enterprise Guide code as needed.
2. Enhance SAS Enterprise Guide code with ODS style options as needed.
3. Very useful to develop summary table prototype without writing SAS code.
4. For any task, select Preview Task Code to review generated SAS code.
5. Can create custom SAS code with Code Task, the Programmer‟s Task.
6. In SAS Enterprise Guide 4.3, can use fill-in editor and apply WHERE condition with new tab.
REFERENCES
Aanderud, Tricia, Business Intelligence Notes, http://www.bi-notes.com/
Gupta, Sunil, “Enterprise Guide for Business Analysts”, Data Presentation, WUSS 2006, WUSS 2005
Gupta, Sunil, “Analysis and Reporting Made Easier Using SAS Enterprise Guide”, Los Angeles Basin
SAS User Group, 2005, SAS Solutions, WUSS 2004
CONTACT INFORMATION
The author welcomes your comments and suggestions.
Sunil K. Gupta
Senior SAS Consultant
Gupta Programming
213 Goldenwood Circle
Simi Valley, CA 93065
Phone: (805)-577-8877
E-mail: [email protected]
www.GuptaProgramming.com
www.SASSavvy.com
Sunil Gupta is a best selling SAS author and global corporate trainer. Sunil is Principal Consultant at
Gupta Programming since 1994. Most recently, Sunil launched www.SASSavvy.com and released five
new SAS e-Guides on Quick Results with PROC SQL, Quick Results with PROC REPORT, A to Z Analysis
and Validation using PROC TABULATE, Compare and Conquer SAS Programming Techniques and
Automating Tasks using SAS Macro Programming. He has been using SAS® software for over 18
years and is a SAS Base Certified Professional. He is also the author of Quick Results with the Output
Delivery System, and Sharpening Your SAS Skills.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are
trademarks of their respective companies.
9
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement