Once you have created output, the Results window opens.
On Windows, the Results window covers the Explorer window. You can switch between the two windows using the tabs at the bottom of the window.
Look at the Results window. The Results node at the top of the window contains a folder for the output of the PROC PRINT procedure. The folder is labeled with the procedure name and the title of the report.
Click the expansion icon next to the the folder.
Double-click Data Set WORK.TEST. The Output window scrolls to the top of the output.
Each time you run a program that creates output, the new output is appended to the last output in the Output window. You can double-click the output item in the Results window to scroll the output window to the top of that particular output. If you clear the Output window, the links in the Results window are deleted.
Create HTML output
You can set preferences to create LISTING output or HTML output. Your preferences are stored from session to session.
Select Tools -> Options ->Preferences.
Click the Results tab.
Select the Create HTML check box.
Modify the program
Now that you have seen the output and formatting for the PRINT procedure, let’s try adding options to the program to do these things:
remove the date from the top of each page
replace the default “The SAS System” title
use the column label rather than the column name in the output
remove the Obs column.
We can do this by using a SAS system option, a TITLE statement, and options on the PROC PRINT statement.
To remove the date from the top of each page, use the NODATE system option. Copy the following OPTIONS statement and paste it at the top of the program:
To replace the default title, use the TITLE statement. Copy the following line and add it above the RUN statement for the PRINT procedure:
title "Product Sales Report";
By including the TITLE statement in the PROC step, the title is applied to the output of the procedure.
To remove the Obs column and use column labels, use options on the PROC PRINT statement. Change the PROC PRINT statement to add the LABEL and NOOBS options. Your PROC PRINT statement should look like this:
proc print data=test label noobs;
Your program should look like the one below.
Select Run -> Submit.
View and save the results
You can create HTML results and save them as HTML files.
In the Results Viewer window, scroll the HTML results. You can change the color and style of HTML output by selecting a different style on the Results tab of the Options window.
With the Results Viewer window active, select File-> Save As. In the File name box, type ProductSales.htm. Click Save.
Look at the the Results window. Notice that there is a new folder for the results of the program you just ran. The folder name uses the Product Sales Report title that you specified in your program.Double-click the Print: Product Sales Report folder, then double-click Data Set WORK.TEST. There are links to both the listing output and the HTML output.
Save a SAS program and set up a favorite folder
When you save your SAS programs, you can store them in a folder that’s easy to access from the Explorer window.
With the Editor window active, select File-> Save As.
The Save As window opens to a default folder on your system. In the File name box, type prodsales. Click Save. The file is saved with a .sas extension, indicating that it is a SAS program.
In the Explorer window, double-click Favorite Folders.
Right-click in the Favorite Folders window and select New Favorite Folder.
In the New Favorite Folder window, type SAS programs in the Name box.
Click Browse. The Select window opens to the same default location where you saved the program. Verify that prodsales.sas is in the directory. Click OK to close the Select window.
Click OK to close the New Favorite Folder window. SAS programs is added to the Favorite Folders window. This gives you a convenient way of accessing your SAS programs.
Now you’ve learned the basic steps for creating, submitting, and saving SAS programs. In the next section of this quick-start guide, you can choose sample SAS programs to investigate, experiment with, adapt, and save.
See these online resources to learn more about how tocreate and run SAS programs.
Documentation, publications, and FAQs
documentation in SAS Help:
In SAS, click Help-> SAS Help and Documentation.
Expand SAS Products-> Base SAS-> SAS Language Reference: Concepts.
Expand DATA Step Concepts-> DATA Step Processing and view topics of interest.
Expand SAS System Concepts-> Error Processing and Debugging and view topics of interest.
Expand SAS System Concepts-> SAS Output and view topics of interest.
Expand DATA Step Concepts->Reading Raw Data and view topics of interest.
other publications in SAS Documentation, including SAS Tech Report
programs in SAS Help:
In SAS, click Help->SAS Help and Documentation.
Expand Learning to Use SAS-> Sample SAS Programs->Base SAS Samples->Base Usage Guide Examples.
programs in SAS Press and SAS Documentation Example Code and Data
adminSAS Series 5: Create and run SAS programs Cont.