楼主: Hollycherry
3434 7

[原创博文] SAS adv 中的两题 [推广有奖]

  • 1关注
  • 1粉丝

讲师

77%

还不是VIP/贵宾

-

威望
0
论坛币
91 个
通用积分
0.0498
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
85040 点
帖子
98
精华
0
在线时间
1072 小时
注册时间
2011-1-12
最后登录
2025-3-8

楼主
Hollycherry 发表于 2012-2-14 12:38:37 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
诚心请教两题,多谢。
第一题
Given the following OPTIONS statement:
libname A 'SAS library reference';
libname F 'SAS library reference';
options fmtsearch = (A F.X);
What is the second location searched for formats?
A.F.X
B.A.FORMATS
C.WORK.FORMATS
D.SAS supplied formats
为啥答案是c, 问的是second location 呀?

第二题
The following SAS program is submitted:

  %macro COLS1;
     Name Age;
  %mend;      
  %macro COLS2;
     Height Weight;     
  %mend;      
  proc print data=SASHELP.CLASS;
     [_insert_VAR_statement_here_]      
  run;

  Which VAR statement successfully completes   
  the program to produce a report containing   
  four variables?


A. var %COLS1 %COLS2;     
B. var %COLS1-%COLS2;     
C. var %COLS1 Weight Height;      
D. var Weight Height %COLS1;   
为什么答案是d? 请解释一下原因。
二维码

扫码加我 拉你入群

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

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

关键词:Successfully successful statement Reference following following reference supplied library formats

沙发
yunqingwang 在职认证  发表于 2012-2-14 16:33:19
我知道第二题
两个macro里面字段都有分号的,只有D解析完之后没有语法错误

藤椅
Hollycherry 发表于 2012-2-15 09:38:06
还是不太明白。

板凳
yunqingwang 在职认证  发表于 2012-2-15 09:45:29
var Weight Height %COLS1;
调用%cols1 macro时候得到  Name Age;
解析完之后就是var Weight Height Name Age;;
而 var %COLS1 %COLS2;     
解析完得到
var name age; weight height;;解析完语法错误
其他几个选项类似
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
wzzlz117 + 1 + 1 + 1 分析的有道理

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

报纸
Hollycherry 发表于 2012-2-15 11:36:23
谢谢

地板
ly1231cn 发表于 2012-2-16 12:41:45
Syntax
FMTSEARCH=(catalog-specification-1... catalog-specification-n)

Syntax Description
catalog-specification
searches format catalogs in the order listed, until the desired member is found. The value of catalog-specification can be either libref or libref.catalog. If only the libref is given, SAS assumes that FORMATS is the catalog name.

Details
The WORK.FORMATS catalog is always searched first, and the LIBRARY.FORMATS catalog is searched next, unless one of them appears in the FMTSEARCH= list.
If a catalog appears in the FMTSEARCH= list, the catalog is searched in the order in which it appears in the list. If a catalog in the list does not exist, that particular item is ignored and searching continues.

7
wzzlz117 发表于 2013-4-14 20:40:04
yunqingwang 发表于 2012-2-15 09:45
var Weight Height %COLS1;
调用%cols1 macro时候得到  Name Age;
解析完之后就是var Weight Height Name ...
解释很彻底,谢谢

8
smalllaugh 发表于 2013-4-14 21:15:48
第二题 先排除b(语法错误)。而c和d比较,好像是宏要放在后面,所以排除c.
但是为什么不选a,我还是需要思考

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

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