全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1500 2
2016-08-03



请教下各位,以下这道题看了好多遍,始终觉得应该是第五次iteration就会出现答案B的效果,为啥题目说是in the sixth iteration?英文不太好,求教了。谢谢!


After the value for code is read in the sixth iteration, which illustration of the program data vector is correct?

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

H Lettuce

P Green Leaf  Quality Growers

P Iceberg     Pleasant Farm

P Romaine     Quality Growers

H Squash

P Yellow      Tasty Acres

P Zucchini    Pleasant Farm


data perm.produce (drop=code);    infile orders;   retain Vegetable;   input code $1. @;   if code='H' then input @3 vegetable $6.;   if code='P';   input @3 Variety : $10. @15 Supplier : $15.;run;proc print data=perm.produce;run;
a.  
_N_

Vegetable

code

Variety

Supplier

6

P




b.  
_N_

Vegetable

code

Variety

Supplier

6

Squash

P




c.  
_N_

Vegetable

code

Variety

Supplier

6

Squash

H




d.  
_N_

Vegetable

code

Variety

Supplier

6

Squash

H

Yellow




二维码

扫码加我 拉你入群

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

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

全部回复
2016-8-4 13:22:06
因为程序里面有retain vegetable 这句话. 所以 vegetable这个变量在没有被改写之前还是保持着前一个iteration时的值. 题目中说第六次iteration只读到code, 也就是还没读到第六行的其他值, 因此vegetable这个变量依然保持着在第5次iteration 的值, 也就是squash. 因为其他变量还没读到,所以为缺失值.
第五次iteration不会出现B答案, 因为在第五次iteration的时候code 为 H
二维码

扫码加我 拉你入群

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

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

2016-8-4 19:56:10
lee_jiayong 发表于 2016-8-4 13:22
因为程序里面有retain vegetable 这句话. 所以 vegetable这个变量在没有被改写之前还是保持着前一个iterati ...
谢谢回复,确实是我英文不够好所致,把Code跟整个Coding搞混淆了,以为问题是PGM完成第6个Iteration之后结果会是啥,题目也未细阅读,谢谢指教!
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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