Starting SST

For most purposes, SST operates the same way on a floppy disk based system as on a system with a hard disk. However, startup is slightly different on the two kinds of systems.

Floppy disk systems

Place the SST program diskette in the A drive and issue the command:

A>sst

The SST program will be loaded into memory (this takes about 30 seconds) and the following message appears on the screen:

SST - Statistical Software Tools
Version 1.0, copyright 1985, 1986 by
J.A. Dubin and R.D. Rivers

Your are now ready to compute.

Hard disk systems

Make the SST directory the default directory and issue the command:

C>cd \sst
C>sst

and the message above should appear on the screen.

SST commands

You are in interactive mode. SST will execute commands one at a time as you issue them. Each command is executed after a carriage return (the key marked <Enter>) has been pressed.

When a command will not fit on one line

Sometimes a command will not fit on a single line. To continue a SST command onto the next line, type a backslash (`\') followed by a carriage return and continue typing. You can repeat this procedure as many times as necessary until you have finished typing the command.

Command syntax

The typical SST command consists of a command name followed by various subops. The command name tells SST what procedure it is to perform. The subops tell it what variables you want it to use, options, and other details of the procedure. Subops are of two forms. Some subops are just "flags". Others take arguments such as which observations you will be dealing with.

The RANGE command

The most important command in SST is the RANCE command. SST is a very flexible program and it tries to accomodate your needs. You may have only a few variables, but many observations on each variable. On the other hand, you may have many variables, but only a few observations. To store datasets efficiently, SST needs to know roughly how many observations you will be dealing with and the RANCE statement provides this information. For example:

range obs[1-100]

tells SST that you will be using 100 observations. It is not necessary to know exactly how many observations you will be using (any reasonable guess will do) nor does specifying one obseration range (with the OBS subop) prevent you from changing it later to a larger or smaller range statement. If you omit the RANCE command, SST may become rather slow for some procedures, because it assumes that you will have 8000 observations on each variable. It is a good habit to always issue a RANCE statement as the first command of any SST session. The RANCE command also serves the purpose of determining which observations will be used for statistical procedures. For example, at some point in an SST session, you may decide that only observations 100 through 200 and 500 through 600 should be used for subsequent statistical procedures. Give the command:

range obs[100-200,500-600]

and only these observations will be used until you issue another RANCE statement. Subsequent RANCE statements may either enlarge, contract, or completely change the range of observations used for statistical procedures. The RANCE statement can also be set to include all observations satisfying a logical condition by using the IF subop. Logical expressions in SST are described in detail in Chapter 4 of the User's Guide, but their use is not complicated. For example, if x is a variable stored in memory, you can pick out all observations for which x is positive by giving the RANCE command:

range if[x>0]

Until another RANCE statement is issued, only those observations for which the variable x is positive will be employed.

On-line help (old)

If you don't remember an SST command name, type:

help

and SST will provide a complete list of command names. If you don't remember the syntax for the command, type `help' followed by the command name:

help command_name

and SST responds with a short summary of the command syntax. Detailed information about how the command works and examples may be found in the User's Guide and Reference Manual. The notation used to describe the syntax of SST commands by the on-line help facility (as well as in the SST Reference Manual) is the following: optional subops are enclosed in braces (`{' and `2') while the kind of argument used by a subop (e.g., number, variable list, etc.) replaces the subop argument inside brackets; optional subops which do not take arguments (flags) are just enclosed in braces. If you use a subop which takes an argument, you must type the brackets. Do not type braces around optional subops. (Braces have a special meaning to SST that is explained in the Chapter 8).

Prompting

Some users prefer to be prompted for subops. If you type an incomplete command leaving out a required subop, SST will prompt you for missing subops. For example, type just a command name, and SST will supply the names of required subops one at a time. You supply just the arguments to the subop (that is, don't type subop name or the brackets around the arguments as you would normally). When you have entered all the required subops, SST then gives you a chance to add optional subops by asking you for options. You type optional subops as you normally would (including brackets). The subop prompting feature allows you to operate SST largely as a menu-driven program.

How to stop SST from processing a command

SST periodically checks to see if you want it to stop processing a command. For example, you may have started to print some data and then become impatient. If you depress the <Ctrl> and <Scroll Lock> keys simultaneously, SST will stop processing the current command and allow you to enter a new command.

How to leave SST

To return to DOS from SST, just type:

quit

The QUIT command eliminates all scratch files created during the SST session and properly terminates SST processing.

Batch mode

SST can be used in either interactive or batch mode. In interactive mode, a command is executed immediately after it is entered at the keyboard. In batch mode, you create a file of SST commands with a text editor or word processor. The commands are then executed sequentially. While SST is processing your batch file you can take a coffee break.

There are two ways to execute a batch file. First, from the DOS prompt you may invoke SST with a filename:

A>sst file.cmd

SST will automatically execute the commands in the file file.cmd without further prompting. Alternatively, you may start SST in interactive mode and at some point during your SST session (perhaps as the first command) give the RUN command:

run file.cmd

If the last command in your SST command file is the QUIT command, SST will return to DOS. Otherwise, SST allows you to continue interactively. You may, for example, RUN another command file after SST has finished processing the first command file.

If a command file is specified without an extension (either in the RUN command or when SST is started), SST assumes the extension `.cmd'. You may use other extensions for command files, but in this case the extension must be specified. If the command file has no extension, type the filename followed by a period with no extension.

Advantages and disadvantages of batch mode

Interactive model allows you to experiment with your data. Based on the results of one statistical procedure you can choose what to do next. Typing commands, however, is rather tedious, and sometimes it's easier to use the editing features of a word processor to create a file containing a large number of commands.

However batch mode has disadvantages. It requires one to "plan ahead" by writing out a sequence of commands. If the program contains an error, you can fix the error by altering the commands using a word processor and then reexecute the SST program. This means that earlier commands (that were fine all along) now have to be reexecuted or one has to specify that these particular commands should not be executed. Either way takes time, and it may be quicker to use interactive mode in some cases.

We prefer to mix interactive and batch mode. We keep some frequently executed commands in batch files which can be run whenever needed without retyping. The spooling feature, described below, can also be used to simplify input.

Controlling execution of batch files

There are only two commands which one uses in batch mode that one doesn't use in interactive mode. The first, PAUSE, causes the program to stop execution and display a message Press return to continue on the screen. Execution continues when a carriage return is entered. As explained above in the DOS unnumberedsec, one can stop the program at any time by depressing the <Ctrl> and <NumLock> keys simultaneously. The PAUSE command stops the program at a predetermined point. This eliminates the need to watch the screen to stop the program at the desired point.

If you created an SST command file some time ago, you may have forgotten the purpose of certain procedures. SST allows you to add comments to your command files with the REM command. Whatever fol- lows the REM command is printed on the screen as you type it. Thus:

rem regression without a constant

will appear on the screen, but no action is taken. In editing a command file, sometimes it is better to "comment out" commands that you don't want executed, rather than delete them. You can use a word processor or editor to add REM in front of commands that you do not want executed so that these commands will be ignored by SST.

How to leave SST without really leaving

After using SST for awhile, we are confident that you won't want to leave SST for very long, so we have provided a facility for executing other programs without having to leave SST with the SYS command. SYS allows you to leave SST temporarily to do other tasks and then to return to SST, with all your data preserved in the same state that you left them.

The SYS command is extremely useful. Although SYS can be used in batch mode, the most common use is in interactive mode. Any DOS command can be executed with SYS. For example, to obtain a directory without leaving sst, type:

sys dir

and the directory appears on the screen, followed by the SST prompt, and you can continue your SST session.

Another common use of the SYS command is to move between SST and a word processor to create and edit SST commands. Suppose you normally access your word processor by typing `wp'. To access your word processor from within SST, one would simply enter (after the SST prompt):

sys wp

You can now use your word processor as usual. When you exit the word processor, you will be put back into SST. Thus a common sequence would be:

sys wp file.cmd

You are now in your word processor and you can edit the file of SST commands, file.cmd. Once you have finished editing the file and have returned to SST, you can RUN the command file:

run file.cmd

To execute more than one command outside of SST, type:

sys command

and the DOS prompt appears. When you have finished executing DOS commands and other programs, type:

A>exit

and you will be returned to SST with everything in the state that you left it.

A few words of caution about the SYS command. First, not all programs can be executed using SYS. Programs with a nonstandard interface to the operating system, may cause the SST session to be aborted. All DOS commands are guaranteed to work and we have found that many popular programs can be executed this way. On the other hand, we cannot guarantee that any non-DOS command will work and it is prudent to try executing the program from within SST when nothing of importance can be lost, before using this facility.

Second, it is possible to fill up the memory of your computer to the point that there is not enough room to load the program that you want to execute. If this happens, SST will give you an error message explaining the situation and return you to the SST session. No harm is done, but don't be surprised if this happens.

Saving SST commands and output

SST output goes directly to the screen unless you specify otherwise. Unfortunately this means that results tend to scroll by too fast to read. There are several options to deal with this problem. As explained above, in batch mode, you can stop the execution of SST commands with the PAUSE command. You can also stop the execution of commands, in either batch or interactive mode, by using the depressing the <Ctrl> and <NumLock> keys simultaneously. To restart execution, press the same keys again.

For some purposes, neither of these is totally satisfactory. PAUSE doesn't allow you to stop the execution within a command, so a PAUSE after a command that produces several screens of output will only stop the screen at the last screen. You can study earlier output by stopping the screen using the <Ctrl><Numlock> sequence, but this requires one some dexterity to catch SST at just the right moments.

The best solution to this problem is to make a copy of what appears on the screen with the SPOOL command. To save a record of an SST session, supply a filename in the FILE subop of the SPOOL command:

spool file[filename]

All output from this point on will be saved in the file you specified. To turn off spooling, type:

spool off

SST allows you to spool your commands to another file from output produced by the program. This turns out to be a very convenient feature since it allows you to create a batch file of SST commands which will reproduce your SST interactive session. To save commands only in a file, type:

spool file[filename] cmd

and your commands, from this point on, will be saved in the file specified. To turn command spooling off, give the command:

spool cmd off

while:

spool out off

would turn off output spooling only. (If neither CMD or OUT is specified, OFF turns off all spooling.) Thus, you can have up to two spool files open at once. To see which spool files are on at present, type:

spool

and SST tells you what is (or is not) currently being spooled.

SST allows several combinations of spooling depending on what subops are supplied. The possible combinations are:

  1. If neither CMD or OUT is specified, both commands and output are spooled to the file specified in filename.

  2. If CMD alone is specified, only commands are saved.

  3. If OUT alone is specified, only output will be saved. (Your commands appear in the OUT file preceded by the SST prompt)

  4. To turn spooling off, include the OFF subop.

We recommend that you give spool files the extensions `.out' and `.cmd' as appropriate. The file can be examined while still in SST by using the SYS command. For example, if you had spooled to the file file.out, this file could be displayed on the screen by entering:

sys type file.out

This allows your to recall what happened earlier during your SST session. You may also want to rerun some commands, perhaps with a few minor changes. We suggest that you spool commands to a file:

spool file[file.cmd] cmd

When you decide that you want to rerun some commands, turn off command spooling and RUN the command file for an instant replay of your SST session:

spool cmd off
run file

(The `.cmd' extension is assumed for command files by the RUN command.)

The spooled file can be edited using a text processor. This is often the easiest incorporate SST output into reports. You can spool the output to a file, edit out the unneeded output, and then incorporate the output into your report using your word processor. SPOOL appends output to whatever file you specify. Thus spooling can be turned on and off selectively if you don't want to save everything that happens during your SST session.

Sending all output to a file

SPOOL allows you to watch output as it comes to the screen while the same output is being saved in a file. If you don't want to see output on the screen, SST allows you to use a command line option to send all output to a file and suppress printing on the screen. This option can only be used in conjunction with batch input on the command line. If file.cmd contains your SST commands and you would like to send output to the file sst.out, invoke SST by:

sst file.cmd -o sst.out

The -o flag tells SST that the next command line argument will be a file for output.

Timing SST

If you want to know how long SST took to perform an operation, use the TIME command. One can include a TIME subop in most every command. It prints the elapsed time between the time SST received a command and finished executing it. The time required to print output on the screen is included.


Some Back Entering