USING SAS ON THE MAINFRAME
December 3, 2002
VERSION 8.2
INTRODUCTION
The Statistical Analysis System (SAS) is a set of computer
programs used with relatively simple commands to produce a
variety of statistical analyses. SAS will perform simple
descriptive statistics, crosstabulations, analysis of
variance, regression and factor analysis, and time series
analysis, as well as user-formatted reports. This
documentation gives information about using SAS at USC,
including which SAS release is current, a listing of available
documentation, examples of JCL needed for submitting batch SAS
jobs through MVS, and procedures for running SAS programs
under VM/CMS.
Please call Academic Services at 777-6015 for assistance with
SAS procedures.
NOTE: For information on SAS modules under USC site license
for Windows and Macintosh operating systems, refer to the
handout Computer Services' Software Distribution web site,
http://www.sc.edu/software/others.shtml#sas.
[RETURN TO TOP]
CURRENT RELEASE
The current release of SAS in batch mode (MVS) is version 8.2
SAS data sets created with versions 5 and 6 can be read using
version 8.2
[RETURN TO TOP]
RELATED DOCUMENTATION
Documentation is available online within the USC domain
(129.252) at
http://csd.sc.edu/ars/saspss/sashtml/online.doc.
Licensing restrictions prohibit availability of this site to
the public. Faculty, staff and students who purchase
SAS/Windows can get a CD containing all of the SAS
documentation.
The following SAS manuals are available from the SAS Series in
Statistical Applications:
SAS System for Elementary
Statistical Analysis.
Teaches how to perform a variety of data analysis tasks and
interpret the results. Topics include comparing two or more
groups, simple regression and basic diagnostics, as well as
basic DATA steps.
SAS System for Linear Models,
Fourth Edition. Uses tutorials and examples to
teach you the most appropriate SAS procedures for linear
models.
SAS System for Regression, Third
Edition. Illustrates
simple and multiple regression with a wide variety of
examples. Examples feature numerous SAS procedures including
REG, PLOT, GPLOT, NLIN, RSEG, AUTOREG, PRINCOMP, and others.
You can search for publications on many topics at the SAS
Publishing site:
http://www.sas.com/apps/pubscat/welcome.jsp
You can subscribe to various electronic newsletters from
SAS as well at:
http://www.sas.com/subscriptions/index.html
[RETURN TO TOP]
SAS INSTITUTE TRAINING
SAS Institute offers training courses on numerous SAS topics
throughout the year. SAS Institute also offers a variety of
training packages for instructor-based, video-based, and
computer-based educational programs. Persons interested in
registering for SAS courses or in ordering SAS courseware
products should consult the
SAS
Institute Training page.
[RETURN TO TOP]
RELATED DOCUMENTS & TRAINING
Following are other documents available from Academic
Services which deal with SAS-related topics:
Installations instructions for
SAS 6.12 for Windows.
Installations instructions for
SAS 8.1 for Windows.
Updating SAS Licensing Information for Mac.
Updating SAS 6.12 Licensing Information for Windows.
Updating SAS 8.1 Licensing Information for Windows.
Enhancements and new procedures in
SAS 8.1.
SAS and Y2K Information
Job Control Language used in MVS batch
system.
Procedures for submitting batch jobs
from CMS.
Installation Instructions for SAS
8.2 for Windows
Updating SAS 8.2 Licensing
Information for Windows
In addition to these documents, Academic Services has
available the following other SAS-related documentation:
SAS Usage Notes - Lists
known problems in SAS and useful tips for dealing with common
difficulties encountered by SAS users.
In addition to these publications, Computer Services IT
Training and Support offers regular short courses in SAS.
Shorter presentations on special topics can be scheduled upon
request. For information on the next regularly scheduled short
course, series interested persons should contact the Academic
Service Support at 803-777-6015.
[RETURN TO TOP]
SAS UTILIZATION ON MVS (BATCH)
Following is the basic Job Control Language (JCL) needed
for running SAS Version 6.09 in regular batch mode on the USC
system:
JOB statement
// EXEC SAS
Optional DD statements
//SYSIN DD *
SAS program statements
//
Following are examples of optional DD statements used in
executing SAS batch jobs. For a more involved explanation of
the DD statements listed in this document, consult the
JCL
documentation for an explanation of DD statements and
parameters.
Following are examples of DD statements for a variety of
functions:
1. Reading raw data from a disk storage data set
named N123456.DATASET:
//FILEIN DD DSN=N123456.DATASET,DISP=SHR
NOTE: The DD name (FILEIN in
this example) must match the name on the SAS INFILE statement.
2. Reading raw data from the first file on a
standard-label, cartridge tape with a serial number of 456789:
//TAPEIN DD DSN=N123456.TAPEFILE,UNIT=CTAPE,
// VOL=SER=456789,LABEL=(1,SL),DISP=SHR
NOTE: The DD name (TAPEIN in
this example) must match the name on the SAS INFILE statement.
3. Outputting a SAS file called N123456.SASFILE
(requiring approximately 7 tracks) to disk storage (1 track on
disk storage equals 56,664 bytes):
//OUTFILE DD DSN=N123456.SASFILE,
// UNIT=DASD,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(7,3),RLSE)
NOTE 1: No DCB information should be coded. The DD
name ( OUTFILE in this example)
must match the first part of the two-part name for the output
file.
NOTE 2: To determine how many tracks of storage space a
SAS data set will require, run a test job with the OPTIONS
statement "OPTIONS OBS=50;" for the data step that create the
files in question. The SAS log will report how many
observations per track were used for creating the data file.
Based on the expected number of observations in the entire
file, you can extrapolate the number of tracks needed to store
the file.
4. Outputting a SAS file called N123456.SASFILE as the
second file on a standard-label cartridge tape with serial
number 456789:
//OUTFILE DD DSN=N123456.SASFILE,UNIT=CTAPE,
// VOL=SER=456789,LABEL=(2,SL),DISP=(NEW,CATLG,DELETE)
See note for Example 3.
5. Reading the SAS file, N123456.SASFILE from disk
storage:
//IN DD DSN=N123456.SASFILE,DISP=SHR
NOTE: The DD name (IN in this
example) must match the first part of the two-part name used
to read it.
6. Reading the SAS file, N123456.SASFILE from the
second file of a standard-label cartridge tape with serial
number 456789.
//INTAPE DD DSN=N123456.SASFILE,UNIT=CTAPE,
// LABEL=(2,SL),VOL=SER=456789,DISP=OLD
See Note for Example 5.
7. Outputting raw data in card image to a disk storage
data set called N123456.OUTSAS, allocating approximately 14
tracks:
//OUTFILE DD DSN=N123456.OUTSAS,UNIT=DASD,
// DCB=(LRECL=80,BLKSIZE=9040,RECFM=FB),
// SPACE=(TRK,(14,1),RLSE),DISP=(NEW,CATLG,DELETE)
NOTE: The DD name (OUTFILE in
this example) must match the the name on the FILE statement
used to create it.
8. Outputting raw data to paper:
//OUT DD SYSOUT=A
9. Produce ten copies of printed SAS output without
getting multiple copies of the JCL, system messages, and SAS
log:
//SASLIST DD SYSOUT=A,COPIES=10
NOTE: The SASLIST DD statement
is not normally coded in the JCL because it is part of the
cataloged SAS procedure. The effect, when used as in this
example, is to override the DD statement in the cataloged
procedure. This DD statement
should follow the EXEC statement
and precede the SYSIN DD *
statement.
When running SAS jobs there are two aspects of space to
consider: workspace and memory. Workspace is
the amount of temporary disk space needed to store SAS data
sets while the SAS job is running. Memory is the CPU REGION
required to execute the job.
The amount or workspace a job will require depends on such
factors as the size of the data set read into SAS, the number
of new variables created in the job, whether the data set is
sorted during the job, the number of times it is subset, etc.
By default workspace is set at 12 cylinders of primary
allocation and 5 cylinders of secondary allocation. If there
is not enough workspace, SAS issues the following message:
ERROR: WRITE TO WORK.XXXX.DATA FAILED. FILE IS FULL AND
AND MAY BE DAMAGED.
where "xxxx" is the name of the current SAS data set
To increase workspace, add the following statement after
the "// EXEC SAS" line in your job setup.
//WORK DD SPACE=(CYL,(xx,yy))
Replace "xx" and "yy" with the primary and
secondary allocations. Version 8.2 of SAS requires at least
4096K of REGION. If you specify less REGION on the JOB or
EXEC statements of the SAS job, it will not execute.
If a job abends due to insufficient REGION, SAS issues a
message indicating that more memory is needed to complete the
task, and suggests an amount to use. To increase memory to
the required amount, use the REGION parameter on the JOB
statement to specify the required amount. For example,
REGION=6000K.
|