![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Companion for the CMS Environment |
| Writing to SAS Files on Disk |
To write a disk-format SAS file, you usually only need to specify the file's two-level name in the appropriate SAS statement. That is, in most cases you do not need to assign a libref to the file because SAS automatically assigns librefs for permanent SAS files on disk. (However, see When to Assign a Libref for a SAS File on Disk for exceptions and performance considerations.) For example, suppose you specify the SAS filename MYLIB.TASTEST in a SAS statement. In CMS terms, this is equivalent to filename TASTEST and filetype MYLIB:
SAS name |
CMS name |
|
MYLIB.TASTEST |
|
TASTEST MYLIB |
libref.filename |
filename filetype |
| Reading SAS Files on Disk |
To read an existing SAS file that is in disk format, you usually only need to specify the file's two-level name in the appropriate SAS statement. That is, in most cases, you do not need to assign a libref to the file. (However, see When to Assign a Libref for a SAS File on Disk for exceptions and performance considerations.) For example, suppose you specify the SAS file MYLIB.TASTEST in a SAS statement. In CMS terms, this is equivalent to filename TASTEST and filetype MYLIB:
SAS name |
CMS name |
|
MYLIB.TASTEST |
|
TASTEST MYLIB |
libref.filename |
filename filetype |
| When to Assign a Libref for a SAS File on Disk |
Under CMS, when you are reading from and writing to disk, you do not always have to assign a libref. (See Reading SAS Files on Diskand Writing to SAS Files on Disk for explanations of why librefs generally are not required for disk-format files.) You may want to do so, though, for portability and clarity.
In the following examples, filemode can be specified in either of two ways:
You should assign a libref under the following circumstances:
| LIBNAME libref 'physical-name'; |
A physical name can be specified as either a filemode or an SFS directory.
| LIBNAME MYLIB '.MYLIB'; |
| LIBNAME libref 'filetype filemode'; |
LIBNAME MYLIB 'REPORTS A';
| LIBNAME libref engine 'physical-filename'; |
LIBNAME MYLIB V6 'REPORTS A';
Note:
If you omit the engine argument,
BASE is assumed by default. ![[cautend]](../common/images/cautend.gif)
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.