由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - HELP~~About reading sas data set
相关主题
但谁能解释下truncover 吗?请教一个SAS读中文数据库的问题
[合集] SAS data input help请教sas base 70题里第29题。。。
请教一个SAS数据input的问题sas读入数据时的一个问题请教
[合集] 请教一个SAS数据input的问题SAS base 70 题第29 和 31题
关于SAS里TRUNCOVER一问help! SAS base 70 problem 17/35
[合集] 请问sas input的一个问题弱问SAS:如何找出两个data sets中missing的obs
sas base (70) problem 59 helpone quick question about concatenating data in SAS
问个SAS 数据读入的问题SAS中FORMAT问题求教
相关话题的讨论汇总
话题: sas话题: 52话题: gender话题: 50话题: score
进入Statistics版参与讨论
1 (共1页)
s********1
发帖数: 54
1
I wrote the following code in sas:
data students;
input gender score;
cards;
1
1 45
2 50
2 42
1 41
2 51
1 52
1 43
2 52
. 12
. 13
;
run;
I do not know why the output in SAS shows as follows:
Obs gender score
1 1 1
2 2 50
3 2 42
4 1 41
5 2 51
6 1 52
7 1 43
8 2 52
9 . 12
10 . 13
Who can explain to me? Thank you so much!!!!
d******9
发帖数: 404
2
Hehe..... you need use Missover.
Try below codes:
data students;
infile cards missover;
input gender score;
cards;
1
1 45
2 50
2 42
1 41
2 51
1 52
1 43
2 52
. 12
. 13
;
run;
k*******a
发帖数: 772
3
数据第一行改成 1 .
就可以了
k*****u
发帖数: 1688
4
二楼正解。
没有missover的话,sas会到下一行去读取数据。
s********1
发帖数: 54
5
Thank you so much.
(1)But can you tell me why SAS stops reading 45 and goes to read 2 and 50
for obs2? In my opinion, I thought it should be
obs1:(1,1) and obs2:(45,2) and obs3:(50,2),etc.
(2)If my data set should look like obs1:(1,1) and obs2:(45,2) and obs3:(50,2
),etc, how should write the code.
Thanks again.
I wrote the following code in sas:
data students;
input gender score;
cards;
1
1 45
2 50
2 42
1 41
2 51
1 52
1 43
2 52
. 12
. 13
;
run;
I do not know why the output in SAS shows as follows:
Obs gender score
1 1 1
2 2 50
3 2 42
4 1 41
5 2 51
6 1 52
7 1 43
8 2 52
9 . 12
10 . 13
Who can explain to me? Thank you so much!!!!

【在 d******9 的大作中提到】
: Hehe..... you need use Missover.
: Try below codes:
: data students;
: infile cards missover;
: input gender score;
: cards;
: 1
: 1 45
: 2 50
: 2 42

d******9
发帖数: 404
6
By default, if SAS can not find values for all the variables defined in
INPUT statement, it will automatically go to NEXT record to read the values
until it get all the values for all the vars.
This is called FLOWOVER, which is the default mode in SAS data step.But, as
you have seen, it may make trouble and destroy the data totally. So,
sometimes we have to disable it.
In this case, we may use Missover/TruncOver/StopOver options in INFILE
statement depending on situations.
For details, view SAS Support by google: Missover.
s********1
发帖数: 54
7
Thank you!!

values
as

【在 d******9 的大作中提到】
: By default, if SAS can not find values for all the variables defined in
: INPUT statement, it will automatically go to NEXT record to read the values
: until it get all the values for all the vars.
: This is called FLOWOVER, which is the default mode in SAS data step.But, as
: you have seen, it may make trouble and destroy the data totally. So,
: sometimes we have to disable it.
: In this case, we may use Missover/TruncOver/StopOver options in INFILE
: statement depending on situations.
: For details, view SAS Support by google: Missover.

1 (共1页)
进入Statistics版参与讨论
相关主题
SAS中FORMAT问题求教关于SAS里TRUNCOVER一问
请教SAS问题:这个code有什么办法简化吗?[合集] 请问sas input的一个问题
SAS 问题请教sas base (70) problem 59 help
SAS数据输入疑问问个SAS 数据读入的问题
但谁能解释下truncover 吗?请教一个SAS读中文数据库的问题
[合集] SAS data input help请教sas base 70题里第29题。。。
请教一个SAS数据input的问题sas读入数据时的一个问题请教
[合集] 请教一个SAS数据input的问题SAS base 70 题第29 和 31题
相关话题的讨论汇总
话题: sas话题: 52话题: gender话题: 50话题: score