PROBLEM 8

COMPRESS COMMAND AND FULLY INTERACTIVE DATA SESSIONS

There are two objectives of this problem:

1. To learn, and execute if necessary, the COMPRESS command.

2. To learn how to enter SAS commands and data in a fully interactive manner.

FOR THIS PROBLEM, USE ONE OF THE FOLLOWING COMPUTING FACILITIES SO THAT YOU HAVE ACCESS TO A PRINTER CAPABLE OF PRINTING SCREEN DISPLAYS.

1. THE O'SHAUGHNESSY MAINFRAME TERMINAL LAB IN ROOM 247.

2. THE HESBURGH LIBRARY MACINTOSH LAB IN ROOM 248.

(REQUEST A MACINTOSH ON THE TRAINING SIDE OF THE LAB-- MACS 21-39.)

3. A MACINTOSH IN THE COMPUTING CENTER TERMINAL LAB IN ROOM G015.

4. ANY OTHER LAB CONTAINING MACINTOSH COMPUTERS WHICH

HAVE BEEN LINKED TO THE MAINFRAME VIA THE CAMPUS NETWORK BACKBONE.

THE COMPRESS COMMAND

Whenever a member of a partitioned organization dataset (say HTWT for example) is "saved" (say, because changes have been made to it), a new copy of the member (HTWT) complete with the changes is added to the dataset. The old member (HTWT, before the changes) remains as dead space in the dataset, taking up the same amount of space as when it was an "active" member. Thus, the PO dataset now takes up more disk space (tracks). This is inefficient and can eventually result in the data set taking up MANY tracks of disk space (as after many changes and saves of a small dataset member or one change and save of a very large dataset member).

Because of this problem with PO datasets, there is a need for a method of "compressing out" the dead space in a PO dataset. Hence the COMPRESS command. However, before trying a compress, there are a few points that must be understood:

1. You can't compress a PO dataset below 1 track, so there's no need to try to compress PDS.DATA unless it exceeds 1 track of your disk space.

2. A compression is a slow process. You will be fed screens of output from the compression. You can hit ENTER to advance these screens. Be patient if the computer takes some time to do the compression (the larger the number of users on the system at any one time, the slower the computer's response time).

There are actually two ways of doing a compression (for our purposes here). One is slightly more risky than the other, although it's faster.

NOTE: If you wish to have a hardcopy of the results of the COMPRESS command, refer to the print screen instructions given at the end of PROBLEM 7.

COMPRESSION METHOD 1

This method is less risky, but it takes the computer longer to do the compress.

(READY)

SPACELST

** This is the same as typing in SPACE LIST. Check to see if PDS.DATA takes up more than one track of your disk space. If if does, proceed. If not, save this sheet for a time when you'll need to compress a PD data set.**

(READY)

COMPRESS PDS.DATA PDS2.DATA

** This compressed version of PDS.DATA will be called PDS2.DATA.**

(READY)

SPACELST

** You now have two versions of PDS.DATA on the 20 tracks of disk space allocated to you --PDS.DATA (not compressed) and PDS2.DATA (compressed). **

DEL PDS.DATA

(READY)

RENAME PDS2.DATA PDS.DATA

** This command has the computer change the PO data set name from PDS2.DATA to PDS.DATA. **

(READY)

COMPRESSION METHOD 2

This method is faster, but it's also riskier. If the computer system should "crash" (shut down because of problems) during this compression, your dataset would be lost.

(READY)

COMPRESS PDS.DATA INPLACE

(READY)

A FULLY INTERACTIVE SAS SESSION

Although in PROBLEM 7 you used SAS in an interactive manner, that was not a FULLY interactive use of SAS. In this part of the problem, you will run a simple SAS program in a fully interactive, line by line, manner. This will enable you to see the results of PROCs immediately. This method is very useful when you have a short program that you wish to run in a hurry and you either don't need a hard copy of of the output or you only need a "quick and dirty" copy such as from a screen display print.

(READY)

SAS

(OUTPUT)

(1?)DATA;

(2?)INPUT A B C @@;

(3?)CARDS;

(4?)14 .023 756 11 .046 924 18 .0089 620

(5?)PROC CORR;

(6?)PROC MEANS; RUN;

(THE COMPUTER RUNS THE PROC CORR AND PROC MEANS RIGHT BEFORE YOUR EYES.)

** Make sure you hit the print screen key (or choose the Print Screen from the File menu on the Macintosh) to send the screen display to the printer once the screen is full. Then hit the ENTER key (or the RETURN key on the Macintosh) to advance the screen display and print again. **

(7?)/*

(READY)

Note: More than one SAS statement can be put on one line.

If you make an error in a data step, enter RUN; and hit RETURN. Then re-enter the data step making your corrections.

WRITING UP YOUR PROGRAM

- Explain why simple statistics were printed before the correlation coefficients.

- Give the formulas for mean, std dev, and std error of mean.

- What is the formula for obtaining a correlation coefficient?

-Explain what the correlation coefficients tell us about the relationship between A, B, C.