Chapter Contents |
Previous |
Next |
SAS Companion for the OpenVMS Operating Environment |
You can use your terminal for other tasks while the job awaits execution, but you cannot change the submitted job in any way until after it executes.
Usually, the first step in executing a program in batch mode is to prepare two types of files:
Examples of Batch Job Files |
Following are three examples of
using command procedure
files and program files in batch mode.
In this example, we first create a file called MYPROG.SAS that contains the following simple SAS program:
libname in 'disk:[directory]'; proc print data=in.mydata; title 'A Simple SAS Program'; run;
Next we create a command procedure file called CONTROL.COM that contains the following DCL command:
$ SAS8/LINESIZE=76/NODATE [HOME.SUBDIR]MYPROG.SAS
To submit the SAS job, we enter the following command at the DCL prompt:
$ SUBMIT/NOTIFY CONTROL.COM
The job is placed in the default batch queue, and the
terminal session is available for other work. You will be notified by the
operating environment when your batch job has completed.
You can make your command procedure file more generic and pass the name of the SAS program as a parameter. This is helpful if you want to execute several programs in the same environment. To do this, you would modify the command procedure file from Example 1 as follows:
$ SAS8/LINESIZE=76/NODATE 'P1'
The 'P1' at the end of the SAS command line is the placeholder for the parameter that you are going to pass to the command.
You could then submit a program called MYPROG.SAS by executing the following command:
$ SUBMIT/NOTIFY/PARAMETER=("MYPROG.SAS")- _$ CONTROL.COM
A third alternative is to include the SAS program in the same file as the control commands. In a batch environment, the OpenVMS system assumes that the input source is the command procedure file that is executing. This input source is named by the OpenVMS logical name SYS$INPUT. To combine the control commands and the SAS program in the same file, create a command file that contains the following lines:
$ SAS8/LINESIZE=76/NODATE- /PRINT=DISK:[DIRECTORY]MYPROG.LIS- /LOG=DISK:[DIRECTORY]MYPROG.LOG SYS$INPUT libname in 'disk:[directory]'; proc print data=in.mydata; title 'A Simple SAS Program'; run; endsas;
The hyphen at the end of the first line of the SAS command indicates that the command continues on the next line. Designating SYS$INPUT as your input file tells SAS that your input will be included in the text of the command procedure file. Submit this job as you would any other batch job at your site.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.