这个SAS数据集是如何清空的?

时间:2014-11-12 12:20:54

标签: sas

在Windows上运行支持MXG 32.10的SAS 9.3

我有一个数据集,WORK.SMFLISTD,有15个obs。在处理结束时,即使我找不到任何修改,它也有0个。我在这两个州之间找不到WORK.SMFLISTD的参考。在SASLOG中搜索SMFLISTD没有找到它的参考。搜索WORK找到许多DATASETS DELETE语句但没有引用SMFLISTD。 WORK库没有整体DATASETS KILL。在任何情况下,如果有,SMFLISTD仍然存在,但0 obs。鉴于这些条件,该数据集如何变为空?

选项包括:

options source source2 symbolgen mprint;

在跑步开始时:

77         data work.smflistd(keep=refdate dsname volser);
78           set
78       ! work.smflist(obs=&getcnt);
SYMBOLGEN:  Macro variable GETCNT resolves to 15
79         run;

NOTE: There were 15 observations read from the data set WORK.SMFLIST.
NOTE: The data set WORK.SMFLISTD has 15 observations and 3 variables.

在跑步结束时:

MPRINT(RUNCICSSMF):   proc print data=work.smflistd;
MPRINT(RUNCICSSMF):   title "SMFLISTD After";
NOTE: No observations in data set WORK.SMFLISTD.

MPRINT(RUNCICSSMF):   data daily.smflist;
MPRINT(RUNCICSSMF):   set work.smflistd;
MPRINT(RUNCICSSMF):   modify daily.smflist key=dsnid;
MPRINT(RUNCICSSMF):   procdt = datetime();
MPRINT(RUNCICSSMF):   run;
3223                                     The SAS System        06:41 Wednesday, November 12, 2014


NOTE: There were 0 observations read from the data set WORK.SMFLISTD.
NOTE: The data set DAILY.SMFLIST has been updated.  There were 0 observations rewritten, 0 
      observations added and 0 observations deleted.

2 个答案:

答案 0 :(得分:3)

有很多方法可能会发生这种情况,因此搜索对表的引用可能无效。

您可以将代码运行到创建表的位置。打开表(以便锁定),然后完成其余代码的运行。由于该表已被锁定,因此尝试清空该表的步骤将失败,并在日志中显示为ERROR:WARNING:

答案 1 :(得分:0)

正如罗伯特所说,有很多可能性。一个"陷阱"是全球性的设置:

options obs=0;

你可以检查一下..