由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - One question about data step in sas
相关主题
[请教]Q20in sas advance new (dec)2013 January 刚考过SAS Adv
a question regarding sas programmingSAS ADV 63题第11题求助
sas adv问题讨论3道SAS ADV题目
今天刚去考了SAS ADV请教SAS base 123 一题
ADV 12月真题一问[合集] SAS data input help
sas advance 12月真题Q20请教SAS BASE Questions
sas adv 63题 第11question about SAS BASE 123 NO.110
sas adv 63题 11 (重发)请问base(123题)的第114题
相关话题的讨论汇总
话题: length话题: data话题: question话题: sas话题: error
进入Statistics版参与讨论
1 (共1页)
s********1
发帖数: 54
1
Question(1)The following is my sas code: Who can tell me why it is wrong?
###############################
data temm;
length A B 3 X;
input A B X;
cards;
10 20 3
23 34 56
run;
#################################3
Error message:
##########################
78 data temm;
79 length A B 3 X;
-
22
1 1
-
352
ERROR 22-322: Expecting a numeric constant.
ERROR 352-185: The length of numeric variables is 3-8.
80 input A B X;
81 cards;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEMM may be incomplete. When this step was
stopped there were 0
observations and 3 variables.
WARNING: Data set WORK.TEMM was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
84 run;
#########################################################
Question(2)The following SAS program is submitted:
data WORK.TEMP;
length A B 3 X;
infile RAWDATA;
input A B X;
run;
########################################
Why is the above length of A is 3? rather than "Unknown"?
thank you!!!
x**********0
发帖数: 163
2
For the first question, SAS expects you to assign a length for X
For the second question, if you run the proc contents, you will see that the
length for variable A is 3. Even thought there is an error
in the lenght statement, that is only for X. And X is still have length of 8.
I hope this is clear.
H**********1
发帖数: 3056
3
I think you don't understand this:
LENGTH A B 3 =LENGTH (A B) 3
SO BOTH A B ARE DEFINED 3

【在 s********1 的大作中提到】
: Question(1)The following is my sas code: Who can tell me why it is wrong?
: ###############################
: data temm;
: length A B 3 X;
: input A B X;
: cards;
: 10 20 3
: 23 34 56
: run;
: #################################3

1 (共1页)
进入Statistics版参与讨论
相关主题
请问base(123题)的第114题ADV 12月真题一问
SAS.Base(11月)疑问sas advance 12月真题Q20请教
一个sas base问题不明白,请教sas adv 63题 第11
SAS问题请教:Numeric Variable Length的设定sas adv 63题 11 (重发)
[请教]Q20in sas advance new (dec)2013 January 刚考过SAS Adv
a question regarding sas programmingSAS ADV 63题第11题求助
sas adv问题讨论3道SAS ADV题目
今天刚去考了SAS ADV请教SAS base 123 一题
相关话题的讨论汇总
话题: length话题: data话题: question话题: sas话题: error