![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Companion for the CMS Environment |
SAS provides the CONTENTS, COPY, and DATASETS procedures to facilitate the management of SAS data libraries and files. Host-specific aspects of these procedures are described in Procedures. For complete discussions of these and other SAS utility procedures, see SAS Procedures Guide. The SAS procedures are described briefly in this section and are compared to the CMS commands that perform similar functions.
| Listing SAS Files |
To compare the file information that is generated by the CMS FILELIST command with the information that is generated by PROC CONTENTS, see Sample Output from the CMS FILELIST Command and Sample Output from the CONTENTS Procedure. Output 4.1 on page 34 illustrates the file information displayed by the following CMS FILELIST command .
FILELIST * mylib a
Sample Output from the CMS FILELIST Command
USER1 FILELIST A0 V 108 Trunc=108 Size=3 Line=1 Col=1 Alt=0
Cmd Filename Filetype Fm Format Lrecl Records Blocks Date Time
3RANCH MYLIB A1 F 1024 3 1 06/01/98 8:39:55
0HSCREEN MYLIB A1 F 1024 13 3 06/01/98 16:47:25
HOUSES MYLIB A1 F 1024 3 1 06/01/98 16:47:20
1=Help 2=Refresh 3=Quit 4=Sort(type) 5=Sort(date) 6=Sort(size)
7= Backward 8=Forward 9=FL /n 10= 11=XEDIT/LIST 12=Cursor
====> X E D I T 1 File |
Sample Output from the CONTENTS Procedure shows the directory information that is retrieved by PROC CONTENTS for the same group of files. The following SAS statement lists all data sets in the SAS data library MYLIB. NODS specifies that no data set descriptor information be printed. The DIRECTORY option is assumed by default.
PROC CONTENTS DATA=MYLIB._ALL_ NODS;
Sample Output from the CONTENTS Procedure
1 The SAS System 3
08:31 Monday, June 1, 1998
CONTENTS PROCEDURE
-----Directory-----
Libref: MYLIB
Engine: V7
Physical Name: MYLIB A1
# Name Memtype File Last Modified
Size
----------------------------------------
1 HOUSES DATA 9 01Jun1998:16:47:20
2 HSCREEN CATALOG 9 01Jun1998:16:47:25
3 RANCH VIEW 9 01Jun1998:08:39:55 |
Compare the CMS filenames listed by the CMS FILELIST command to the SAS filenames listed by the CONTENTS procedure. For example, look at the information for SAS file RANCH in Sample Output from the CONTENTS Procedure . You see that its memtype is VIEW. Now look at the information in Sample Output from the CMS FILELIST Command . You see an entry for a CMS file with a filename of 3RANCH. CMS recognizes the SAS file RANCH as 3RANCH because SAS added the prefix 3 to the filename so that it could recognize the file's SAS filetype. (See SAS Filename Restrictions for more information about prefix characters.)
| Copying SAS Files |
If you use a CMS command, remember to include any prefix characters in the CMS filename. (See SAS Filename Restrictions for information about prefix characters.) For example, to copy the SAS data view PROJCTS MONTHLY into another SAS data view using the CMS COPYFILE command, you can issue the following command:
COPY 3PROJCTS MONTHLY A 3RHOUSE MONTHLY B
| Deleting SAS Files |
proc fsedit data=mylib.houses screen=mylib.hscreen;
ERASE 0HSCREEN MYLIB A
(See SAS Filename Restrictions for more information about prefix characters.)
| Renaming SAS Files |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.