Printing and Saving TABLES
For printing the numerical summaries, you may find that saving the
output as a text file useful. You can then download this to a PC and
use a word processor to edit and format. In INSIGHT, select the menu:
FILE:SAVE:Tables. The output is then sent to the SAS OUTPUT Window
(one of the original windows that appears when you first start up
SAS). From the Output Window, you can save it as a text file. Go to
the FILE menu in the OUPUT Window, and select "Save as.." You will be
prompted to give a file name. I usually use a name such as HW1.out
(ending in .out) for text output files.
There are two ways to save graphic images in SAS. The second one described later has not been working properly causing SAS to crash with an error "Segmentation Fault". This method is a bit nicer, so as soon as it does work, we will let you know. For now use the following method.
- Click on the plot (just the edge) that you want to print, so that it is highlighted around the edge. If you want to print to plots that are right next to each other, i.e the residuals versus fitted and the normal quantile plot, click on the first plot, and then press the shift key while clicking on the second plot. Make sure that both plots are completely visible.
- Now go to the File menu and select "Save:Graphics File". In the popup window, specify a file name i.e. plot1.ps, then click on OK. I usually use a name ending in .ps for postscript files. Remember to use a different name for the different plots; if you don't change the name, you will destroy whatever was saved as plot1.ps.
- Now go over to the UNIX (XTERM) window and type
ls
That makes a list of the files in your directory. One of
them
should be plot1.ps.
- To make sure that it is o.k. before sending it to the printer, you may
preview it with the command
ghostview plot1.ps
As there are quotas on the number of pages you may print for free, make sure your plot is correct before saving it. Since you do not need to turn in every output file, just print the ones that are important.
- To send it to the printer, type
print plot1.ps
at the UNIX prompt.
- Once you have turned in your homework and have had it graded, you will probably need to remove the old postscript files. To do this, enter the following command at the UNIX prompt.
rm plot1.ps
Printing Method 2 -- DO NOT USE FOR NOW
PRELIMINARIES: in each SAS Session you must do the following:
- In the PROGRAM EDITOR WINDOW, go to the Menu VIEW and select Preferences... then Display Manager and finally click on "Use Host Printing". Click on OK.
- Next go to the PROGRAM EDITOR window and select the FILE menu and click on" Print Setup...". Click on "Properties..." in the popup menu and then OK. You should see that the printer icon is cyan and blue now. Click on OK. Once you have done these two steps at the beginning of the session, your output will be saved to a file called "prn.ps" by default. If the icon is NOT HIGHLIGHTED in BLUE, SAS will crash!
a) In the SAS output window to be printed: choose Edit-Windows-Select
All; this will highlight the entire window. If you want to save only a single plot or figure, just click on the edge of the image so that its outline is highlighted.
b) Now choose File:Print. Click on the box "Print File to Disk", and then PRINT. A window will pop up; in the box under "Enter directory name, filename or filter, specify a filename for the output, such as HW1reg.ps click on "OK", and select "Fill Page" on the next window that appears; this will conserve paper. Note, if you don not change the filenames, you will write over the
old file.
c) Go over to the UNIX window and type
ls
That makes a list of the files in your directory. One of
them
should be HW1reg.ps.
To make sure that it is o.k. before sending it to the printer, you may preview it with the command
ghostview HW1reg.ps
As there are quotas on the number of pages you may print for free, make sure your plot is correct before saving it. Since you do not need to turn in every output file, just print the ones that are important.
To send it to the printer, type
print HW1reg.ps
at the UNIX prompt.
For some unknown reason, we have experienced problems with SAS crashing with the error message "Segmentation fault". If you experience this, even after following these instructions to the letter, PLEASE send an email to help@acpub.duke.edu and clyde@stat.duke.edu with the error message and a description, so that they are aware of the problem.