Introduction
In the previous edition, we introduced SAS OnDemand for Academics, showed you how to register, navigate the interface, upload files, and run your very first SAS programs, all for free. If you haven’t read it yet, we recommend checking it out to establish your foundation.
Now, in Edition 2, we go beyond the basics and explore SAS Studio in greater depth. You’ll learn how to master your coding environment, use autocomplete and syntax tools efficiently, and organize your outputs. By the end of this guide, you’ll feel more confident and productive while working in SAS Studio.
1. Navigating the SAS Studio Interface
When you launch SAS Studio, the interface consists of several functional zones:
Navigation Pane: Where you access libraries, files, and folders.
Work Area: The central editor where you write and run code.
Banner Options: Buttons to open new files, adjust settings, and search content.
Perspectives: SAS Studio provides two views; SAS Programmer (for coding) and Visual Programmer (for flow-based development). For this guide, ensure the SAS Programmer perspective is active.
You can customize your editor under Preferences, including font size, theme, and enabling or disabling autocomplete.
2. Writing a Program in SAS Studio
Let’s explore a real SAS session where we create a dataset and compute statistics using the sashelp.shoes sample data.
Step 1: Create a New Program
Click New Program and paste the following code:
data work.shoes;
set sashelp.shoes;
NetSales = Sales - Returns;
run;
This DATA step creates a new dataset with a calculated variable NetSales.
Step 2: Run and Interpret
Click Run or press F3 to submit the code. Review the LOG for messages and OUTPUT DATA for the new dataset. The RESULTS tab will be empty unless your code includes reporting or graphics.
3. Enhancing with Summary Statistics
To get a better understanding of your data, use the PROC MEANS procedure:
proc means data=work.shoes mean sum maxdec=2;
var NetSales;
class Region;
run;
This computes the mean and sum of NetSales, grouped by region, with values rounded to two decimal places.
💡 Tip: SAS Studio offers autocomplete prompts to speed up coding and avoid syntax errors. You can toggle this feature in Preferences > Editor > Enable autocomplete.
4. Efficient Coding with Syntax Prompts
SAS Studio provides an intelligent code editor:
- Start typing
procordatato see real-time suggestions. - Use the
Format Codebutton to clean up spacing and structure. - Hover over keywords for documentation and examples.
This reduces the learning curve for new users and improves accuracy and speed.
5. Managing Output and Results
SAS Studio lets you choose how to display results:
- Use the RESULTS tab to view outputs.
- Click icons to export as HTML, PDF, or Word.
- Drag and arrange tabs to create a multi-panel layout, ideal for side-by-side comparisons.
You can adjust these defaults in Preferences > Results.
6. Saving and Reusing Code
Once you’ve written your code:
- Return to the CODE tab.
- Click Save As.
- Choose a meaningful name (e.g.,
shoes_summary) and save it in your project folder.
Organizing your programs with consistent naming helps when working on long-term projects.
Conclusion
With this deeper look into SAS Studio, you’ve now moved beyond the basics and started to build real productivity skills in the SAS environment. You’ve learned how to:
Use perspectives and layout options effectively,
Write clean, reusable SAS programs,
Leverage autocomplete and prompts for efficient coding,
Export and manage output professionally.
In this edition, we have provided key insights on how to use SAS Studio effectively and professionally. However, SAS Studio is just one of several front-end interfaces for working with SAS. Other popular alternatives include SAS Enterprise Guide, which is widely used. In a future edition, we will explore SAS Enterprise Guide in greater detail. Regardless of the front-end interface used, SAS programs and all related processes remain consistent and function across any editor or front-end platform.
In Edition 3, we will cover data access.
Stay connected with us at 3 D Statistical Learning as we continue our journey into the world of SAS.
We would like to thank Dr. Dany Djeudeu once again for his expert contributions to this educational series.
We help businesses and researchers solve complex challenges by providing expert guidance in statistics, machine learning, and tailored education.
Our core services include:
– Statistical Consulting:
Comprehensive consulting tailored to your data-driven needs.
– Training and Coaching:
In-depth instruction in statistics, machine learning, and the use of statistical software such as SAS, R, and Python.
– Reproducible Data Analysis Pipelines:
Development of documented, reproducible workflows using SAS macros and customized R and Python code.
– Interactive Data Visualization and Web Applications:
Creation of dynamic visualizations and web apps with R (Shiny, Plotly), Python (Streamlit, Dash by Plotly), and SAS (SAS Viya, SAS Web Report Studio).
– Automated Reporting and Presentation:
Generation of automated reports and presentations using Markdown and Quarto.
– Scientific Data Analysis:
Advanced analytical support for scientific research projects.