请选择 进入手机版 | 继续访问电脑版
楼主: Alwaysonline21
987 6

SAS小白求助 [推广有奖]

  • 19关注
  • 2粉丝

硕士生

53%

还不是VIP/贵宾

-

威望
0
论坛币
608 个
通用积分
31.1560
学术水平
7 点
热心指数
8 点
信用等级
5 点
经验
1959 点
帖子
118
精华
0
在线时间
168 小时
注册时间
2013-10-15
最后登录
2019-9-2

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

1.jpg

这个题的选项为A  按照程序运行了一次 确实选A
对于程序中红方框的部分有点不理解   else input 中 input后面variable都没有follow   就是说这个input什么也不输入吗?
求高人帮忙解答  在此先谢谢啦
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Variable follow Input else ABLE follow 程序

1.jpg
linusx 发表于 2014-12-23 11:46:10 |显示全部楼层 |坛友微信交流群
Using a Null INPUT Statement

This example uses an INPUT statement with no arguments. The DATA step copies records from the input file to the output file without creating any SAS variables:
data _null_;
   infile file-specification-1;
   file file-specification-2;
   input;
   put _infile_;
run;

使用道具

linusx 发表于 2014-12-23 11:46
Using a Null INPUT Statement

This example uses an INPUT statement with no arguments. The DATA ste ...
@linusx  你好  谢谢你的解答  
你说的这个意思  我的理解就是  如果INPUT Statement  后面没有变量的话 就是相当于利用input语句 将infile里面的内容输入到file里面 但是没有变量写进去 实际上file也就是一个空的file 我理解错了吗  
如果我理解对了的话  请问一下 这么做的目的是什么呢

使用道具

linusx 发表于 2014-12-23 20:24:14 |显示全部楼层 |坛友微信交流群
http://analytics.ncsu.edu/sesug/2007/HW07.pdf

使用道具

星落荒原 发表于 2014-12-24 11:52:33 |显示全部楼层 |坛友微信交流群
我在SAS中跑了一下这个程序, 如果去掉  else input; 这个语句的话,SAS会把WI 这些state的值当做name address city来读。导至所有的state的值位missing(blank)。因为没有New York这个city的值了,导至所有读入顺序都变了
所以此处必需 用 else input;这个语句来hold住,让所有关于state的value不被当做其他变量的值来读入
已有 1 人评分论坛币 收起 理由
admin_kefu + 40 根据规定进行奖励

总评分: 论坛币 + 40   查看全部评分

使用道具

linusx 发表于 2014-12-23 20:24 http://analytics.ncsu.edu/sesug/2007/HW07.pdf
谢谢  我好好看一下  然后再来理解里所说的意思.....


看了你给的链接   按照原文中的例子  If the first character is an "R"(for "Regional") , we process the remainder of the record. If the first character is anything esle , we will invoke an INPUT statement that has no variables assocated with it. This null input statemtn has the sole prupose of freeing the line pointer. (In our example , the RUN statement would have released the hold automatically; however, personal preference is to explicitly code the statement in all instances.)

使用道具

星落荒原 发表于 2014-12-24 11:52
我在SAS中跑了一下这个程序, 如果去掉  else input; 这个语句的话,SAS会把WI 这些state的值当做name add ...
再次非常感谢你的回答.......




我看了linusx发给我的链接  你的说法完全正确
This null input statemtn has the sole prupose of freeing the line pointer.

Thanks your excellent answer.

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 07:37