楼主: wangzhuo422
2710 5

[问答] 求教啊!!informat的问题,50题里面的关于mmddyy [推广有奖]

  • 0关注
  • 1粉丝

已卖:423份资源

大专生

31%

还不是VIP/贵宾

-

威望
0
论坛币
1135 个
通用积分
0.0600
学术水平
1 点
热心指数
1 点
信用等级
0 点
经验
413 点
帖子
43
精华
0
在线时间
25 小时
注册时间
2010-1-17
最后登录
2019-1-30

楼主
wangzhuo422 发表于 2013-3-4 06:27:28 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

1.A raw data file is listed below.

1---+----10---+----20---+---

son Frank 01/31/89

daughter June 12-25-87

brother Samuel 01/17/51

The following program is submitted using this file as input:data work.family;

infile 'file-specification';

<insert INPUT statement here>run;


Which INPUT statement correctly reads the values for the variable Birthdate as SASdate values?

a.input relation $ first_name $ birthdate date9.;

b.input relation $ first_name $ birthdate mmddyy8.;

c.input relation $ first_name $ birthdate : date9.;

d.input relation $ first_name $ birthdate : mmddyy8.;

Correct answer: d

41.A raw data file is listed below.

1---+----10---+----20---+---

01/05/1989 Frank 11

12/25/1987 June 13

01/05/1991 Sally 9

The following SAS program is submitted using the raw data file as input:data work.family;

infile 'file-specification';

input @1 date_of_birth mmddyy10.

@15 first_name $5.

@25 age 3;run;

proc print data=work.family noobs;

run;

Which one of the following is the result?

a. The program executes, but the age values are missing in the output.

b. The program executes, but the date values are missing in the output.

c. The program fails to execute because the age informat is coded incorrectly.

d. The program fails to execute because the date informat is coded incorrectly.

Correct answer: a

这个是第一题和第41题,为什么一样的东西第一个不加冒号就错,41题里面不加就对了啊?


二维码

扫码加我 拉你入群

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

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

关键词:informat informa inform format FORMA following relation values file

沙发
webgu 发表于 2013-3-4 08:35:00
第一个,b 选项也是可以的。不过first_name 和birthdate 之间只能有一个空格。当然加:是更保守的方法。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

藤椅
wangzhuo422 发表于 2013-3-4 09:46:45
webgu 发表于 2013-3-4 08:35
第一个,b 选项也是可以的。不过first_name 和birthdate 之间只能有一个空格。当然加:是更保守的方法。
我觉得大概是因为第二个observation的日期格式跟别的不一样所以要加冒号吧

板凳
webgu 发表于 2013-3-4 10:08:08
加冒号 主是因为长度的问题。加了冒号可以从第一个非空字符读取,不管前面有多个少空隔。后面碰到空隔or指定格式的长度的末尾or数据行末尾,结束读取。
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
冰雨狼 + 1 + 1 + 1 分析的有道理

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

报纸
webgu 发表于 2013-3-4 10:09:14
wangzhuo422 发表于 2013-3-4 09:46
我觉得大概是因为第二个observation的日期格式跟别的不一样所以要加冒号吧
楼上一点补充说明。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

地板
wangzhuo422 发表于 2013-3-4 10:28:00
webgu 发表于 2013-3-4 10:08
加冒号 主是因为长度的问题。加了冒号可以从第一个非空字符读取,不管前面有多个少空隔。后面碰到空隔or指定 ...
明白了,谢谢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-29 01:21