Practice: Exploring Sas Studio: Data Work - Shoes Set Sashelp - Shoes Netsales Sales-Returns Run
Practice: Exploring Sas Studio: Data Work - Shoes Set Sashelp - Shoes Netsales Sales-Returns Run
1. Start SAS Studio. The main window of SAS Studio consists of a navigation pane on the left and a work area on
the right.
2. Options are available in the banner area to customize your SAS Studio environment.
Option Description
Search Search files and folders.
Open Open files from your files and shortcuts.
New New program, new import data, new query, close all tabs, and maximize view.
Options
SAS SAS Studio includes two different perspectives: the SAS Programmer perspective and the
Programmer Visual Programmer perspective. A perspective is a predetermined set of features that is
customized to meet the needs of a specific type of user. This course is about programming in
SAS, so you need to make sure that the SAS Programmer perspective is selected on the
toolbar at the top of the application. You can find more information about both perspectives in
SAS® Studio: User's Guide.
More More application options, including edit autoexec file, a view menu, preferences, tool options,
application background submission status, and reset SAS session.
options
Help A Help menu including SAS Studio Help, SAS Product Documentation, and About SAS
Studio.
3. On the Program 1 tab in the work area, type or copy and paste the code below. This is a simple SAS program
called a DATA step.
Note: If you copy and paste the program, you can click the Format Code icon on the toolbar to improve the
program spacing.
data work.shoes;
set sashelp.shoes;
NetSales=Sales-Returns;
run;
4. Click Run or press F3 to submit the code. Examine the LOG and OUTPUT DATA tabs. The RESULTS tab is
empty because the program did not create a report.
Note: The Autocomplete prompts also include a window with syntax help and links to documentation and
examples.
6. Press the spacebar, use the prompt to select data=, and then type work.shoes.
a. Press the spacebar and notice that the prompt lists all valid options.
b. Type or select the options in the window to complete the following statement:
7. Complete the program by adding the following VAR, CLASS, and RUN statements:
proc means data=work.shoes mean sum maxdec=2;
var NetSales;
class region;
run;
8. Highlight the code from PROC MEANS through the RUN statement and click Run or press F3 to run only the
selected portion. Confirm the results.
9. To view multiple tabs at the same time, click the RESULTS tab and drag it to the right side of the work area
until a highlighted region appears. To return to a single window, drag the RESULTS tab back to the main tab
area.
10. On the RESULTS tab, click the HTML, PDF, or Word icon to open the results in the corresponding file format.
You are prompted to open the file in the browser.
Note: Additional options for the output formats are available. Click the More application options icon on the
banner, and then select Preferences > Results to view the options.
11. To save the program, return to the CODE tab and click the Save as toolbar button.
a. Navigate to the output folder in the course files.
b. Enter shoesprogram in the Name field and click Save.
Copyright © 2018 SAS Institute Inc., Cary, NC, USA. All rights reserved.