![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Companion for the CMS Environment |
include 'mycode sas a'
These statements access an external file of data that is used to create a SAS data set:
data mydata;
infile 'rawdata data b';
...
If you plan to use the same external file several times in your SAS program, it is more efficient to use the FILENAME statement to establish a fileref to the file. (See Advantages of Using the FILENAME Statement.) You can subsequently use the fileref to refer to the file instead of specifying the filename again.
Note: Use the CMS FILEDEF command to assign a DDname, which is also
a logical name, only when reading OS/390-sequential or partitioned data sets
on OS/390 disks accessed by shared DASD, or when reading OS/390-simulated
CMS files identified by filemode 4.
| Using the FILENAME Statement to Reference External Files |
![[cautend]](../common/images/cautend.gif)
| Advantages of Using the FILENAME Statement |
There are several advantages to using the FILENAME statement to identify external files.
| FILENAME Statement Syntax |
This section provides a brief overview of FILENAME statement syntax. For complete information about the FILENAME statement, see FILENAME. The general form of the FILENAME statement is
| FILENAME fileref | _ALL_ device-type <'external-file'> <options>; |
The FILENAME statement takes the following options:
filename mydata 'houses data a';
filename mydata disk 'houses data a';
filename outdata 'some file fpool:user3.data97';
filename indata 'survey march';
filename mydata punch;
filename mylib tape 'tap2' ;
filename mydir 'fpool:myuser.mydir';
filename mydata clear;
filename all ('mar file' 'apr file' 'may file');
filename a ('one maclib' 'two maclib' 'three maclib');
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.