You are a skilled SAS® programmer. You can code circles around those “newbies” who point and click in SAS® Enterprise Guide®. And yet… there are tasks you struggle with on a regular basis, such as “Is the name of that data set DRUG or DRUGS?” and “What intern wrote this code? It’s not formatted well at all and is hard to read.” In this presentation you learn how to program, yes program, more efficiently. You learn the benefits of autocomplete and inline help, as well as how to easily format the code that intern wrote that you inherited. In addition, you learn how to create a process flow of a program to identify any dead ends, i.e., data sets that get created but are not used in that program.
Kicking and Screaming Your Way to SAS® Enterprise Guide
1. we create thinking data®
Kicking and Screaming Your
Way to SAS® Enterprise
Guide®
M. Michelle Buchecker
Director of Technical Training Services
ThotWave Technologies
1
2. About the Presenter
Michelle Buchecker is the Director of Technical Training Servicesfor ThotWave
Technologies, LLC. She is responsible for helping customers build the next generation of
analytic professionals.
Her specialties include training development, training delivery, Base SAS®
, Macro, SAS
Enterprise Guide®, SAS/Connect®, OLAP, and BI.
She has been teaching SAS software for over 20 years.
4. Lessons
1 What are thebenefits and basic
interface of SAS Enterprise Guide?
2
3
Intro to SAS Enterprise Guide
What techniques are available to make
me a more efficient programmer?
Efficient Programming
Howdo I work with SAS programs,
logs, and outputsin SAS Enterprise
Guide?
Working with the Interface
4
6. SAS Enterprise Guide Program Editor
SAS Enterprise Guide includes a programming editor similar to the Enhanced Program
Editor in SAS Display Manager.
Additional functionality in the SAS Enterprise Guide Program Editor includesthe following:
6
Intro to EG
autocomplete
dynamic syntax tooltips
formatting programs to provide consistent spacing
analyzing program flow
10. SAS Enterprise Guide Program Editor
SAS Enterprise Guide includes a programming editor similar to the Enhanced Program
Editor in SAS Display Manager.
Additional functionality in the SAS Enterprise Guide Program Editor includesthe following:
autocomplete
dynamic syntax tooltips
formatting programs to provide consistent spacing
analyzing program flow
10
Efficient Programming
11. Creating a New Program
To create a new program in SAS Enterprise Guide, click File > New > Program.
11
Efficient Programming
12. Using Autocomplete
The editor can suggest:
• SAS statements
• procedures
• macro programs
• macro variables
• functions
• formats
• librefs
• SAS data sets
• variable names
In SAS Enterprise Guide, the Program Editor includes an autocomplete feature.
12
Efficient Programming
autocomplete
13. Using Inline Help
If you hover over words in the program, you will
notice inline help for keywords in a context-
sensitive manner.
13
Efficient Programming
dynamic syntax tooltips
14. Using Inline Help
Inline Help is especially useful for infrequently used options.
14
Efficient Programming
20. Creating an Analysis of a Program
Programscan be dissected for relationship
of the components
• steps
• data sets
• outputs
• documentation
To analyze a program in SAS Enterprise
Guide, click Analyze Program > Analyze
for Program Flow. Then click Begin
analysis.
20
Efficient Programming
analyzing program flow
21. Creating a Visual Relationship of a Program
Once analysis is complete, you can create a visual
relationship of the program. SAS Enterprise Guide
calls this a process flow.
Provide a name for the process flow and click
Create process flow.
21
Efficient Programming
22. Creating a Process Flow from a Program
A new process flow is created in the project depicting a visual representation of the
program.
22
Efficient Programming
24. Opening an Existing Program
Click File > Open > Program
Options to open an existing program in SAS Enterprise Guide:
Navigate through the tree structure in the
Servers list or your local machine.
24
Interface
25. Opening an Existing Program
• Navigate to the desired directory.
• Double-click on the program.
25
Interface
26. Running an Existing Program
• Select Run from the toolbar.
• Right-click on the program and select Run on server.
• Press F8 or F3.
If running on a server, verify you are connected to the correctServer.
A SAS program can be submitted using one of these techniques:
26
Interface
27. Running a Portion of a Program
• Select the down arrow next to Run > Run
Selection from the toolbar.
• Right-click on the program and select Run
Selection on server.
• Press the F3 or F8 key.
A portion of a SAS program can be submitted by highlighting the code and doing any of the following:
27
Interface
28. Identifying Warning & Errors in the Log
The code icons in the project indicate whether there are warnings or errorsin the SAS log.
28
Interface
29. Viewing the Log Tab
The Log tab displays the log from SAS Enterprise Guide-generated statementsand the code
submitted.
29
Interface
30. Identifying Warning & Errors in the Log
Arrows on the Log tab enable quick navigation to the next warning or error.
30
Interface
31. Viewing the Log Summary
The Log Summary pane can be toggled on/off to show errors, warnings, and/or notes.
31
Interface
32. Viewing the Results Tab
The Results tab displays output that would go to the Output window or .LST file.
32
Interface
33. Viewing the Output Data
The Output Data tab shows a view of any data sets created.
33
Interface
34. Saving a Program
Changes to the program can be saved from the Program tab or by pressing Ctrl+Shift+S.
34
Interface
35. Saving a Program
If you create a program from scratch in SAS
Enterprise Guide (File > New > Program),
the Save button saves the code internally to
the project only.
Use Save As to save the code
outside of SAS Enterprise Guide.
35
Interface
36. Programming Statements to Avoid
Be aware of the following statements:
• Code that would normally cause a window or prompt to appear (DEBUG, PROC FSLIST,
KEYS) does not work and causes error messagesin SAS Enterprise Guide.
• Code that terminates the SAS processwith ABORT or ENDSAS calls terminates the
connection between SAS Enterprise Guide and the SAS server.
36
Interface
37. Summary
Now that you’ve attended this presentation, you should be able to:
Explain thebenefits and basic
interface of SAS Enterprise Guide.
Use theSAS Enterprise Guide
interface to be a more efficient
programmer.
Work with programs,logs, and output.
1
2
3
37