免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1836 | 回复: 0
打印 上一主题 下一主题

[新手入门] Deleting SAS Data Sets [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-02 18:50 |只看该作者 |倒序浏览
Specifying Data Sets to Delete
Use the DELETE statement to delete one or more data sets from
a SAS data library. If you want to delete more than one data set, then simply
list the names after the DELETE keyword with a blank space between the names,
or use an abbreviated member list if applicable (such as YRDATA1-YRDATA5).
CAUTION:SAS immediately deletes the files
in a SAS data library when the program statements are submitted.
You are not asked to verify the delete operation before
it begins, so be sure that you intend to delete the files before submitting
the program.  

For example, the following program specifies USCLIM
as the procedure input library, then deletes the data set RAIN from the library:
proc datasets library=usclim;
   delete rain;
run;
The following output shows that SAS sends messages to
the SAS log when it processes the DELETE statement:
Deleting the Data Set RAIN from the Library USCLIM
212  proc datasets library=usclim;
                              -----Directory-----
                   Libref:            USCLIM               
                   Engine:            V8                    
                   Physical Name:     external-file
                   File Name:         external-file
                   Inode Number:      1864992               
                   Access Permission: rwxr-xr-x            
                   Owner Name:        userid               
                   File Size (bytes): 4096                  
                                       File
               #  Name      Memtype    Size  Last Modified
               -------------------------------------------------
               1  BASETEMP  CATALOG   20480   15NOV2000:14:38:35
               2  HIGHTEMP  DATA      16384   16NOV2000:12:14:50
               3  LOWTEMP   DATA      16384   16NOV2000:12:14:54
               4  RAIN      DATA      16384   16NOV2000:12:14:59
               5  REPORT    CATALOG   20480   15NOV2000:14:39:02
               6  TEMPCHNG  DATA      16384   15NOV2000:14:30:41
               7  USHIGH    DATA      16384   15NOV2000:14:26:48
               8  USLOW     DATA      16384   15NOV2000:14:30:08
213     delete rain;
214  run;
NOTE: Deleting USCLIM.RAIN (memtype=DATA).
Specifying Data Sets to Save
To delete all data sets but a few, you can use the SAVE statement
to list the names of the data sets that you want to keep. List the data set
names with a blank space between the names, or use an abbreviated member list
(such as YRDATA1-YRDATA5) if applicable.
The following statements delete all the data sets except
TEMPCHNG from the library USCLIM:   
   save tempchng;
run;
The following output shows the SAS log from the delete
operation. SAS sends messages to the SAS log, verifying that it has kept the
data sets that you specified in the SAVE statement and deleted all other members
of the library.  
Deleting All Members of the Library USCLIM Except the Data Set TEMPCHNG
232     save tempchng;
233  run;
NOTE: Saving USCLIM.TEMPCHNG (memtype=DATA).
NOTE: Deleting USCLIM.BASETEMP (memtype=CATALOG).
NOTE: Deleting USCLIM.HIGHTEMP (memtype=DATA).
NOTE: Deleting USCLIM.LOWTEMP (memtype=DATA).
NOTE: Deleting USCLIM.REPORT (memtype=CATALOG).
NOTE: Deleting USCLIM.USHIGH (memtype=DATA).
NOTE: Deleting USCLIM.USLOW (memtype=DATA).
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14556/showart_2044198.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP