楼主: pinggu2688
8173 10

[原创博文] data步 if 0是什么意思 [推广有奖]

  • 2关注
  • 0粉丝

博士生

6%

还不是VIP/贵宾

-

威望
0
论坛币
40 个
通用积分
40.2335
学术水平
1 点
热心指数
3 点
信用等级
1 点
经验
3113 点
帖子
166
精华
0
在线时间
103 小时
注册时间
2009-11-12
最后登录
2024-8-28

楼主
pinggu2688 发表于 2012-3-18 05:21:55 |AI写论文
10论坛币
data _null_;

if 0 then set sashelp.class nobs=nobs;

call symput('nobsa',nobs);

run;
这段代码if 0是什么意思?起什么作用?

谢谢

最佳答案

webgu 查看完整内容

在此,if 0表示条年恒为假,then后面的语句永远不执行。但是nobs在编译时就可以得到,因此,上面程序是一种不打开数据集而获得数据集观测的巧妙方法。
关键词:data步 是什么意思 Data SASHELP symput null

回帖推荐

yugao1986 发表于3楼  查看完整内容

The "if 0" is a a conditional statement designed to never be executed at run-time and works since the "set sashelp.class" gives the header information of the data set class to the compiler which sets up the pdv accordingly, but is skipped in the execution time because the if condition is false.

沙发
webgu 发表于 2012-3-18 05:21:56
在此,if 0表示条年恒为假,then后面的语句永远不执行。但是nobs在编译时就可以得到,因此,上面程序是一种不打开数据集而获得数据集观测的巧妙方法。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

藤椅
yugao1986 发表于 2012-3-18 14:07:05
The "if 0" is a a conditional statement designed to never be executed at run-time and works since the "set sashelp.class" gives the header information of the data set class to the compiler which sets up the pdv accordingly, but is skipped in the execution time because the if condition is false.
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
pinggu2688 + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

三人行必有我师

板凳
tulning 发表于 2012-3-19 03:29:19
学习一下
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
pinggu2688 + 1 + 1 + 1 鼓励积极发帖讨论

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

报纸
astrozscore 发表于 2012-3-19 06:39:06
谢谢详细的解释。

地板
denver 发表于 2012-3-19 09:18:41
webgu 发表于 2012-3-18 05:21
在此,if 0表示条年恒为假,then后面的语句永远不执行。但是nobs在编译时就可以得到,因此,上面程序是一种 ...
继续问一下

call symput ('nobsa', nobs)这句如何解释?选项都表示什么意思?

我连续执行这个命令几次,返回结果不同,具体的是行数不断增加,列数不变
Denver大家一起读Paper系列索引贴:
https://bbs.pinggu.org/thread-1430892-1-1.html

7
baoaibaobao 发表于 2012-3-19 09:24:52
denver 发表于 2012-3-19 09:18
继续问一下

call symput ('nobsa', nobs)这句如何解释?选项都表示什么意思?
data步中宏变量生成语句

8
ena7777 发表于 2012-3-19 10:12:51
xuexile

9
josephwen 发表于 2012-3-20 00:07:02
解释精辟

10
sunset1986 发表于 2012-3-20 11:08:43
学习了~!
An honest tale speeds best being plainly told.
Cheers!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 16:01