SAS Companion for the OS/390 Environment |
To work with an
external file in the SAS System,
you must first allocate the file. File allocation is the process of identifying
an external file to the SAS System. If you are allocating a new data set,
such as a sequential file, partitioned data set (PDS), or partitioned data
set extended (PDSE), you must specify that it is new and you must describe
its structure and format. These actions are not required for new files in
the Hierarchical File System (HFS).
You can allocate external files in the following ways:
- If you plan to use an existing
external file only
once in your SAS program, then you can allocate it by simply specifying the
physical file name in a SAS statement or command. For example, this INCLUDE
command allocates an existing sequential data set and includes it into the
PROGRAM EDITOR window:
include 'myid.report.data'
Similarly, this PROC PRINTTO statement allocates a new
PDS member:
proc printto
print='userid.output.data(rockport)'
new;
- If you plan to use the same external file several
times in your SAS program, then use one of the following methods to allocate
the file.
- SAS FILENAME statement or function
- You can use these methods in all modes for
most types of files. See Using the FILENAME Statement or Function to Allocate External Files
or FILENAME
for more information.
- JCL DD statement
- You can use this method if you use OS/390
in batch mode. See Using the JCL DD Statement to Allocate External Files
for more information.
Note: Unlike the other two methods,
if you use the JCL DD statement to allocate a file, there is no way to deallocate
the file until the job ends.
- TSO ALLOCATE command
- You can use this method if you use OS/390
under TSO. See Using the TSO Allocate Command to Allocate External Files
for more information.
Each of these methods establishes a fileref or a DDname
that you can subsequently use to refer to the file instead of specifying the
data set name again. See Referring to External Files
for more information.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.