Chapter Contents


SAS Companion for the OS/2 Environment

Starting the SAS System

The following sections describe several ways in which you can invoke the SAS System from the OS/2 environment.

Starting from WarpCenter

To start SAS from the WarpCenter:

  1. Click on the Start Application button.

  2. Select The SAS System, V8.

  3. Select The SAS System for OS/2, Version 8.

Starting from Custom Shadows or Program Items

During installation, the SAS System Setup automatically creates a program item, or shadow, that you can use to start the SAS System. However, you can create multiple SAS program items within a folder to represent several differently configured SAS sessions. Also, if you want SAS to start every time you start OS/2, you can place a program item or shadow in the Startup folder.

For information about creating shadows, see your OS/2 documentation. Starting the SAS System shows an example of a SAS item that has been accessed from the SAS System folder.

Starting from the Command Prompt in an OS/2 Window

When starting the SAS System using a command line, you might want to specify the SAS configuration file location using the CONFIG system option, even if you use the default name of SASV8.CFG, to ensure that the SAS System uses the configuration file that you want. For more information about how the SAS System searches for the configuration file, see How the SAS System Finds and Processes Configuration Files.

The WORK and SASUSER system options are specified in your default SASV8.CFG file as !sasfolder\sasuser and !sasfolder\SASWORK, where !sasfolder is set to the location of your SAS program files. When these options are set, the WORK and SASUSER data libraries reside in the specified paths regardless of the path from which you invoke SAS.

You can start either an interactive SAS session or a batch SAS job by opening an OS/2 window and typing SAS at the command prompt. For example, the following command starts an interactive session, specifies the page size and line size, and indicates the location of the SAS configuration file:

C:\SAS\SAS.EXE -LS 80 -PS 60 
               -CONFIG C:\SAS\SASV8.CFG

The following command starts a batch SAS job in a similar manner:

               -CONFIG C:\SAS\SASV8.CFG

Invoking the SAS System in Interactive Mode Compared with Batch Mode

When running the SAS System under OS/2, you can use an interactive session or you can run batch jobs. An interactive session enables you to interact with the SAS System interface to submit programs and to view the resulting output. SAS batch jobs run without any interaction from you, and you view output later. You can use any of the previously discussed methods to start the SAS System in either mode. By default, invoking the SAS System begins an interactive SAS session. If you have a SAS program that you want to submit as a batch job, specify the SYSIN option with the name of the SAS program file when you invoke the SAS System.

Submitting a Batch SAS Job

When you run SAS in batch mode, SAS displays a status window for the SAS job that you submit. This window tells you the name of the SAS job that is running and where your log and procedure output files are written. This window remains open until the SAS job is complete.

You can run windowing procedures, such as those associated with SAS/GRAPH, SAS/INSIGHT, and SAS/ACCESS software, in a batch SAS job. When the SAS System reaches a point in your program where interaction is required, it opens the main SAS window.

If you do not want to see the status window while your batch SAS job is running, invoke the SAS System with the ICON system option so that the status window becomes an icon when your job is running. You can also minimize the status window by selecting [Icon] when the status window appears. The icon shows the busy cursor (usually an hourglass) while the SAS job is running and the cursor disappears when the job is complete. You can cancel a batch job by either pressing CTRL BREAK or by clicking on [Cancel] in the status window.

There are several ways to submit a batch SAS job:

Setting the Current Folder

The SAS System uses a current folder as the default location to read and write SAS files when you do not explicitly specify a path. (In Version 7 of the SAS System, the working folder also contained the system profile catalog. In Version 8 the system profiles are kept separated from the working files.)

Under OS/2, the following rules are used to determine the working folder for the SAS System:

  1. If a working folder is specified in the OS/2 Properties Program page for the program item or shadow, the SAS System uses that path as the working folder.

  2. If you do not use the program item or shadow to start SAS (using the command line instead), and if OS/2 successfully loads the SAS.EXE file from the path that was specified in the SAS command, that path is the working folder. In other words, the working folder is the path that you specify as part of the SAS command, regardless of where OS/2 actually finds SAS.EXE. If you do not specify a path as part of the SAS command, then the working folder is the path from which you issued the command.

Note:   If OS/2 cannot find the SAS.EXE file in the specified folder, the folder specified in the SAS command still becomes the working folder, and OS/2 searches for the SAS.EXE file by using the OS/2 PATH environment variable.  [cautionend]

For example, if you specify the following command, C:\SAS is the working folder, regardless of whether the SAS.EXE file is actually in that folder:


You can change the SAS working folder from within your SAS session. For more information, see Changing the SAS Current Folder.

Note:   Do not confuse the SAS working folder with the SASWORK data library. See WORK Data Library.  [cautionend]

Sample SAS Session

This section illustrates how to invoke the SAS System from Start Application, submit a sample SAS program, examine the program output, and end the SAS session. Starting the SAS System shows a possible configuration of the SAS program item in the Start Application menu. Double-click on The SAS System for OS/2, Version 8 to start the SAS System.

Starting the SAS System


Submitting the Sample SAS Program shows the Program Editor and Log windows as well as a sample SAS program that is ready to be submitted. This program creates a SAS data set called ORANGES, which contains the results of a taste test that was conducted on four varieties of oranges. Then the program sorts the data set by the total test score and prints the data set.

Submitting the Sample SAS Program


Here is the SAS code that appears in the Program Editor window:

data oranges;
   input variety $ flavor texture looks;
navel 9 8 6
temple 7 7 7
valencia 8 9 9
mandarin 5 7 8
proc sort data=oranges;
   by descending total;
proc print data=oranges;
   title 'Taste Test Results for Oranges';

Once you submit the program, the output appears in the Output window, as shown in Looking at the Program Output.

Looking at the Program Output


The items in the menu bar at the top of the main SAS window change depending on the active window within the SAS session. In addition, you can access window-specific pop-up menus that offer the same menu choices. To access the pop-up menus, click the right mouse button in the window for which you want to see menus. Pop-up Menus in the Program Editor Window shows a series of menus in the Program Editor window. This series was generated by first clicking the right mouse button in the Program Editor window, then by selecting File and View.

Pop-up Menus in the Program Editor Window


When you are ready to end your SAS session, click on the title bar Close button (the small square icon in the upper-right corner of the main SAS window) and click on [OK] when the dialog box verifies your request.

Note:   If you have disabled the Confirm Exit of SAS option in the Preferences dialog box, your SAS session ends without asking if you are sure that you want to end the session. For more information about how to customize your SAS session, see Setting Session Preferences.  [cautionend]

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.