如何计算 SAS 表中的观察数? [英] How to count the number of observations in a SAS table?
本文介绍了如何计算 SAS 表中的观察数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对 SAS 很陌生.现在,我有一个 SAS 数据表如下:
I am very new to SAS. Now, I have a SAS data table as following:
ID score
-------------------
01 1
02 3
03 4
04 2
有没有办法仅使用 PROC SORT 和 DATA 步骤保存此表中的观察次数?我想将值保存在日志窗口中,就像 SAS 日志脚本中的hold N=4".
Is there any way to save the number of observations in this table using only PROC SORT and DATA step? I want to hold the value in the log window, which is like "hold N=4" in the SAS log script.
对不起,我的描述不专业.提前致谢.
Sorry for my unprofessional description. Thanks in advance.
推荐答案
在 set 语句中使用 nobs
=.
Use the nobs
= in the set statement.
data _null_;
set xyz nobs=nobs;
put "HOLD N=" nobs ;
stop;
run;
这篇关于如何计算 SAS 表中的观察数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文