全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
41437 12
2009-04-08
<br/>各位大侠,sas 中 input 变量1   变量2  @ 与 @@ 有什么区别?output时会有什么不同,万分谢谢<br/>
二维码

扫码加我 拉你入群

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

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

全部回复
2009-4-8 08:42:00

lz,你将两者在SAS上运行一下,区别不就出来了吗?比如:第一次运行 input x1 x2 @;第二次运行 input x1 x2 @@;这样一比较,二者的不同不就一目了然了吗?

二维码

扫码加我 拉你入群

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

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

2009-4-12 10:20:00
One @ sign means conditional input. That is, the data record from the raw data will be saved in the input buffer and will not be saved to the corresponding variable. Only when the second "input" statement is encountered can the raw data be read into the SAS data set.

For double @@, sometimes each line of the raw data is longer than the size of SAS input variables, and the input will only stop once the end of line is encountered in the raw data set. For example,

data example
    input group $ score @@;
    datalines;
    1 100 1 200 1 300
    2 120 2 210 2 320
    3 310 3 420 3 540;
run;

proc print;
run;

In the example above you need to use double trailing @@ sign since each row of the embedded data has three observations

The output of the example looks like:

ob     group    score
1         1         100
2         1         200
3         1         300
4         2         120
5         2         210
6         2         320
7         3         310
8         3         420
9         3         540




二维码

扫码加我 拉你入群

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

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

2009-4-15 04:43:00

谢谢了
二维码

扫码加我 拉你入群

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

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

2010-2-2 08:51:33
多谢!!!!
二维码

扫码加我 拉你入群

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

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

2010-2-2 11:31:26
可以解释下下面的@是什么作用吗?


data NYC;
input city $ 18-32 @;

if city='New York';

input FLNO 1-4 AirLine $6-18 city $ 18-32 Time $34-40;

cards;

9238 American      New York       10:00
4235 United          Philadelphia    5:00pm
798   Delta            New York       8:50
4824 North West   Houston         12:30pm
1639 South West  Chicago          4:15pm
5417 North West   New York       11:25
;
run;
Proc print data=NYC;
title 'Flight to New York City';

run;



3# liugxhk
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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