全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3392 7
2012-02-14
诚心请教两题,多谢。
第一题
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? 请解释一下原因。
二维码

扫码加我 拉你入群

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

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

全部回复
2012-2-14 16:33:19
我知道第二题
两个macro里面字段都有分号的,只有D解析完之后没有语法错误
二维码

扫码加我 拉你入群

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

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

2012-2-15 09:38:06
还是不太明白。
二维码

扫码加我 拉你入群

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

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

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;;解析完语法错误
其他几个选项类似
二维码

扫码加我 拉你入群

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

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

2012-2-15 11:36:23
谢谢
二维码

扫码加我 拉你入群

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

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

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.
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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