初学者 - SAS中的出生日期
在此处输入图像描述我是初级班的 SAS 编码新手,我正在努力与基础知识。我试图首先创建一个 date_of_birth 变量,但我不断发现month_of_birth、day_of_birth 和year_of_birth 未初始化。我已将代码放在下面,任何帮助将不胜感激!
code:
data dob;
set Assign6_sp2022;
date_of_birth = MDY (Month_of_Birth, Day_of_Birth, Year_of_Birth);
run;
log:
48 data dob;
49 set Assign6_sp2022;
50 date_of_birth = MDY (Month_of_Birth, Day_of_Birth, Year_of_Birth);
51 run;
NOTE: Variable Month_of_Birth is uninitialized.
NOTE: Variable Day_of_Birth is uninitialized.
NOTE: Variable Year_of_Birth is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 50:17
NOTE: There were 1 observations read from the data set WORK.ASSIGN6_SP2022.
NOTE: The data set WORK.DOB has 1 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
enter image description hereI'm new to SAS coding in a beginning class and I'm struggling with the basics. I'm trying to first create a date_of_birth variable but I keep getting that month_of_birth, day_of_birth, and year_of_birth is uninitialized. I've put the code below, any help would be appreciated!
code:
data dob;
set Assign6_sp2022;
date_of_birth = MDY (Month_of_Birth, Day_of_Birth, Year_of_Birth);
run;
log:
48 data dob;
49 set Assign6_sp2022;
50 date_of_birth = MDY (Month_of_Birth, Day_of_Birth, Year_of_Birth);
51 run;
NOTE: Variable Month_of_Birth is uninitialized.
NOTE: Variable Day_of_Birth is uninitialized.
NOTE: Variable Year_of_Birth is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 50:17
NOTE: There were 1 observations read from the data set WORK.ASSIGN6_SP2022.
NOTE: The data set WORK.DOB has 1 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的表似乎位于
Assn6
库中。确保在
set
语句中使用它:set Assn6.Assign6_sp2022
。另外,您的变量名称中似乎有空格。
如果是这种情况,您需要使用带引号的字符串,后跟字母 N。
请改用
“出生月份”n
、“出生日期”n
和“出生年份”n
。It seems your table is in the
Assn6
library.Make sure to use it in the
set
statement :set Assn6.Assign6_sp2022
.Also it seems your variables have spaces in their names.
if that is the case, you need to use a quoted string followed by the letter N.
Use
"Month of Birth"n
,"Day of Birth"n
and"Year of Birth"n
instead.