0% found this document useful (0 votes)
7 views4 pages

PG01

The document provides a step-by-step guide for using SAS Studio, focusing on the SAS Programmer perspective. It covers how to create a simple SAS program, compute summary statistics, and manage output formats. Additionally, it explains how to customize the environment and save the program file.

Uploaded by

filiex449
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

PG01

The document provides a step-by-step guide for using SAS Studio, focusing on the SAS Programmer perspective. It covers how to create a simple SAS program, compute summary statistics, and manage output formats. Additionally, it explains how to customize the environment and save the program file.

Uploaded by

filiex449
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Document name: [Link], file size: 170.

00 kilobytes

Problem 1
Exploring the SAS Studio Editor
a. Start SAS Studio. The main window of SAS Studio consists of a navigation pane on the left and a
work area on the right.

b. Options are available in the banner area to customize your SAS Studio environment.

Search files and folders.


Search

Open files from your files and shortcuts.


Open

New program, new import data, new query, close all tabs, and maximize
New Options view.

SAS Studio includes two different perspectives: the SAS Programmer


perspective and the 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 application options, including edit autoexec file, a view menu,


More preferences, tool options, background submission status, and reset SAS
application options session.

A Help menu, including SAS Studio Help, SAS Product Documentation,


Help and About SAS Studio.

Page 1 of 4
Document name: [Link], file size: 170.00 kilobytes

c. On the Program 1 tab, type or copy and paste the following code. This is a simple SAS program
called a DATA step.

Note: If you copy and paste the program, click Format code to improve the program
spacing.

data [Link];
set [Link];
NetSales=Sales-Returns;
run;
d. 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.

e. On the CODE tab, add code to compute summary statistics. At the end of the program, begin by
typing pr. Notice that a prompt appears with valid keywords and syntax help. Press Enter to add
the word proc to the program. Press the spacebar and type me, and press Enter again to add
means to the program.

Note: The Autocomplete prompts also include a window with syntax Help and links to
documentation and examples.

f. Press the spacebar, use the prompt to select data=, and then type [Link]. Press the
spacebar and notice that the prompt lists all valid options. Type or select options in the window
to complete the following statement:

proc means data=[Link] mean sum;

g. Autocomplete prompts can be disabled by clicking More application options and then
clicking Preferences  Code and Log. Clear the Enable autocomplete check box and click Save.

h. Return to the CODE tab and press the spacebar after the SUM option and before the semicolon.
Notice that a prompt does not appear. Type MAXDEC=2 to round statistics
to two decimal places.

Note: If autocomplete is turned off, you can temporarily toggle it on at any point by holding
down the Ctrl key and pressing the spacebar to view the autocomplete prompt.

i. Complete the program by adding the following statements:

proc means data=[Link] mean sum maxdec=2;

Page 2 of 4
Document name: [Link], file size: 170.00 kilobytes

var NetSales;
class region;
run;
j. Highlight the code from PROC MEANS through RUN and click Run or press F3 to run only
the selected portion. Confirm the results.

Note: The default output format in SAS Studio is HTML.

k. 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.

l. On the RESULTS tab, click the HTML, PDF, or Word icon to open results in the corresponding file
format. You are prompted to open or save the file in the browser.

Page 3 of 4
Document name: [Link], file size: 170.00 kilobytes

Note: Additional options for the output formats are available by clicking More application
options and selecting Preferences  Results.

m. To save the program, return to the CODE tab and click the Save As toolbar button. Navigate
to the output folder in the course files. Enter shoesprogram in the Name field and click Save.
The .sas file extension is automatically added to the file name.

Page 4 of 4

You might also like