全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1136 6
2014-12-21

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

原图尺寸 51.3 KB

1.jpg

二维码

扫码加我 拉你入群

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

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

全部回复
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;
二维码

扫码加我 拉你入群

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

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

2014-12-23 19:18:10
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 我理解错了吗  
如果我理解对了的话  请问一下 这么做的目的是什么呢
二维码

扫码加我 拉你入群

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

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

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不被当做其他变量的值来读入
二维码

扫码加我 拉你入群

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

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

2014-12-24 19:31:34
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.)
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群