由买买提看人间百态

topics

全部话题 - 话题: sashelp
1 2 下页 末页 (共2页)
s*******f
发帖数: 148
1
要不自己写一个@@? (sql代码是我describe view从log里拷出来的,应该没错)
PROC SQL;
create view Sashelp.Vcolumn as
select *
from DICTIONARY.COLUMNS;
QUIT;
s******y
发帖数: 352
2
what did you do? V* tables are just views.
proc sql;
describe view sashelp.vmacros;
quit;
you will see the underlying table is Dictionary.macros. not sure what have
you done can damage that table.
f*****k
发帖数: 110
3
来自主题: Statistics版 - SAS中FORMAT问题求教
看完之后很受启发,谢谢。不过链接中前几个程序可能不适用我的dataset,因为在我
的dataset中missing values是有不同数字代表的,而且我也不能列出所有的代表。
不过最后的一个程序可能会解决我的问题,尤其是这个程序似乎和kirklanda 提到的
sashelp.vcolumn有点关联。但当我运行了这个程序之后,却不知道这结果意味着什么
。我把程序贴在下面了,令人迷惑的结果在附件里。哪位能解释一下把原来sashelp.
column中的missing values用‘missing’或0来代替有什么意义啊?
********************************************************************;
data missing;
set sashelp.column;
array chars _character_;
do over chars;
if chars='' then chars='Missing';
end;
array nums _numeric_;
do over nums;
if nums=. then ... 阅读全帖
t*****w
发帖数: 254
4
来自主题: Statistics版 - ask SAS question for advance certificate
I have not understood the following question meaning yet.
what does "inside" or "outside" in %put statement mean?
Item 62 of 63 Mark item for review
Given the following macro program
and invocation:
%macro MAKEPGM(NEWNAME, SETNAME);
data &NEWNAME;
set &SETNAME;
run;
%put ---> inside macro &NEWNAME &SETNAME;
%mend;
%MAKEPGM(WORK.NEW, SASHELP.CLASS)
%put ---> outside macro &NEWNAME &SETNAME;
Which of these choices shows the correc... 阅读全帖
h*******d
发帖数: 272
5
来自主题: Statistics版 - killtest Q78 79 80
KILLTEST 关于MACRO 的一系列题 我都错了 想破脑袋还是不明白
先放3道 请大家指点我一下吧 真的真的十分感谢
78
The following is submitted:
%macro print(dsn=sashelp.class, var1,var2=name);
Proc print data=&dsn;
Var&var1&var2;
Run;
%mend;
%print(dsn=sashelp.prdsale, age name, var2=height)
What is the result?
答案: the macro variable VAR1 has no value , the macro failed to compile.
为什么不是C:the value of the macro variable VAR1 is age name.
79
The following is submitted:
%macro test;
Data out;
Set sashelp.prdsale end=final;
If predict>500 then
c*******u
发帖数: 12899
6
☆─────────────────────────────────────☆
Lydia (lydia) 于 (Fri Sep 24 05:17:59 2010, 美东) 提到:
我看了版上有几位有打通abbott的电话,但具体处理结果还没出来。我觉得在处理这次
事件中一定要集中力量,建议所有邮寄过奶粉回国的人统一提交资料,可以是大概的,
比如包括以下几项:
美国联系人, 所在城市,联系电话,奶粉所在国内城市,存货情况(把批号写上),
国内联系人,还可以列出奶粉邮寄回去的邮寄费
如果牵扯的范围和数量较多,可以分几个区,每个区推荐代表和abbott谈判。必要的时
候我们还可以保留诉讼的权利。
我目前在chicago,给国内外甥邮寄奶粉一年半,可怜他从今年的五一开始一直拉肚子
,看医生无数,就是没想到千里迢迢邮寄回去的奶粉会有问题。目前她有存货14桶,包
括一岁前吃光的6桶(空的)。
如果觉得建议可行,请转各大网站。我愿意做本次事件的志愿者。
☆─────────────────────────────────────☆
Lydia (lydia) 于 (Fri Sep... 阅读全帖
c*******u
发帖数: 12899
7
☆─────────────────────────────────────☆
mtshui (人间四月天) 于 (Sat Oct 16 04:37:25 2010, 美东) 提到:
update:谢谢大家!昨天晚上在电话里都没有哭,今天看到大家的祝福忍不住哭了。真的很感动。妈妈其实刚刚做完子宫和双附件切除的手术,还在住院恢复,昨天我给她打电话,正好她的医生过来查房,医生在电话里告诉我的,因为她一共切除了3个肿瘤,其中有两个是良性的,有一
裥缘模且缴桓杪杷盗肆夹缘哪歉觥N蚁衷谝不姑挥芯龆ǖ降子Ω迷谑裁辞榭鱿氯盟溃蛘吒纱嗄芤鞯幕耙鞯降住J翟谑遣幌肴盟俪惺苷庵执蚧髁耍诖蟀肽曛谘壅稣龅乜醋帕礁龀ο喽缘那兹死肴ィ衷谧约河终庋惺艿暮沃故俏业陌俦肚П丁O衷谥慌瓮
恶性肿瘤是早期的。
再次感谢这么多好心的姐妹们。希望所有的好心人都有好运气。
去年4月份在怀孕20周的时候失去了肚子里的宝宝,后来8月份发现自己竟然又怀上了。
在这次孕程里,家里两位至亲(外婆和父亲)相继去世,我自己因为28周宫颈变短住院
卧床直到37周,现在宝宝6个多月,以为一切不好的事情终于都过去了。结果今天接到
家里电话,... 阅读全帖
c*******u
发帖数: 12899
8
☆─────────────────────────────────────☆
marionette (hehe) 于 (Fri Dec 3 12:25:48 2010, 美东) 提到:
发信人: marionette (hehe), 信区: Reunion
标 题: 父母离美,能不能送到登机口?
发信站: BBS 未名空间站 (Fri Dec 3 12:24:00 2010, 美东)
我记得以前有人说过可以来着?跟航空公司要送客票?
谢谢
☆─────────────────────────────────────☆
SEPA (SEPA) 于 (Fri Dec 3 12:27:08 2010, 美东) 提到:
UA能
☆─────────────────────────────────────☆
daxue (开心) 于 (Fri Dec 3 12:27:22 2010, 美东) 提到:
可以. I did the same for my parents.
☆─────────────────────────────────────☆
... 阅读全帖
m****x
发帖数: 2506
9
☆─────────────────────────────────────☆
knli79 (knli79) 于 (Fri Mar 11 15:53:20 2011, 美东) 提到:
记不得,那么多情与仇,
只记得,我们同为人父母,同为人子女
虽然日本曾在中国犯过不可饶恕的罪过,可是,新一代的人们是没有错的。不管是何种
情况,都该以人道主义的准则对待人类,不管他是哪个种族,祈祷在地震中有更多的幸
存者,祈祷日本的民众可以坚强的面对灾难。
日本强震海啸已造成至少500人死亡
http://news.sina.com.cn/z/japanearthquake0311/index.shtml
华网东京3月11日电 日本东北部海域当天发生的里氏8.8级(中国地震局测定为里氏8.6
级)地震及其引发的海啸迄今已造成至少500人死亡,大量人员受伤或失踪,尚不清楚有
无中国公民伤亡。
日本媒体报道说,由于地震影响范围较广,统计尚不全面,死伤数字势将继续上升。
首相菅直人当天在记者招待会上说:“地震在日本北部的广大区域造成了重大损失
。”
宫城县警方说,一艘载着100来人的船被海浪卷走。救... 阅读全帖
b*****9
发帖数: 8922
10
☆─────────────────────────────────────☆
lily321 (lily) 于 (Sat Dec 4 15:41:06 2010, 美东) 提到:
谢谢大家的祝福,他们已经拿到签证了。看来中信代签还是挺容易的。
爸妈回去已经一年了,这次用中信代签,希望一切顺利。一定会来汇报结果。谢谢。
☆─────────────────────────────────────☆
alvincy79 (automon) 于 (Sat Dec 4 18:23:30 2010, 美东) 提到:
bless
☆─────────────────────────────────────☆
singe (shi nan) 于 (Sat Dec 4 23:34:21 2010, 美东) 提到:
Bless
☆─────────────────────────────────────☆
baozi09 (包子拿来) 于 (Sun Dec 5 01:28:36 2010, 美东) 提到:
bless
☆─────────────────... 阅读全帖
y*****n
发帖数: 6302
11
☆─────────────────────────────────────☆
yangjin (洋金) 于 (Thu Feb 17 07:14:55 2011, 美东) 提到:
1. 黄昏(打一古时地名)-- 洛阳
2. 初一(打一成语)-- 日新月异
3. 人无信不立(打一字)-- 言
4. 说他忘,他没忘,心眼长在一边上(打一字)-- 忙
5. 架上爬秧结绿瓜,绿瓜顶上开黄花,生着吃来鲜又脆,炒熟做菜味道佳(打一植物)-- 黄瓜
6. 十(打一成语)-- 纵横交错
7. 指着你的脸,按着你的心,通知你主人,赶快来开门(打一电器) -- 门铃
8. 小姑娘,夜纳凉。带灯笼,闪闪亮(打一动物名)-- 萤火虫
9. 生于元宵,属兔(打一五言唐诗)-- 举头望明月
10. 皮黑肉儿白,肚里墨样黑,从不偷东西,硬说他是贼(打一动物名)-- 乌贼
11. 武断(打一成语)-- 不容分说
12. 兔(打一电影名)-- 龙兄虎弟
13. 生在山中,颜色相同,来到人间,有绿有红。(打一植物)-- 茶叶
14. 不洗真干净,洗了不干净,不洗有人吃,洗了无人用。(打一自然物)-- 水
15.... 阅读全帖
y*********u
发帖数: 14561
12
☆─────────────────────────────────────☆
faithjing (蛋,blue的妈咪) 于 (Fri Jan 7 12:43:43 2011, 美东) 提到:
今天blue送去KC了,刚才上线看到昨天四猫家的孩子也去了,恢复的挺快,真希望blue
也能那样坚
强。
另外就是我的命运,明天也许会是人生一个转折点,具体事情等明天回来再说,先埋个
伏笔。
希望大家能祝福我和blue。大家都说pets版是净土,我也来求一份祝福。
明天晚上回来报道。如果成功,发伪币1800。
更新——————————————————————————————————————————————
回来了,一切顺利。
blue昨天回来,我把他放出来,蛋蛋发现blue身上有异味,跟着blue闻屁股,被blue给
揍一顿,看着他们满屋跑的样子,怀疑blue根本没做手术,于是小心翼翼解开blue的尾
巴,发现两只毛茸茸的蛋蛋没了,才确认blue的确做手术了。这两天玩的很好,一点都
没有变,看来公猫就是皮实。
我呢,今天下午去模特中介报名,中介老板说我身材长相都不错,有潜力。以后打... 阅读全帖
t****e
发帖数: 25
13
来自主题: Statistics版 - two sas adv questions
1.
** sashelp.prdsale has more than 100 observations
%macro test;
data out;
set sashelp.prdsale nobs=totalobs;
if totalobs>10 then do;
%let rc=high; end;
else do; %let rc=low; end; run;
%mend;
%let rc=Before Execution;
%put &rc;
why is the result low?
2.
libname A 'SAS library reference';
libname F 'SAS library reference';
options fmtsearch=(A F.X);
what is the second location searched for formats?
The tutorial says
work.formats->library.formats->A.formats->F.X
why is the answer work.formats as
u*****o
发帖数: 1224
14
来自主题: Statistics版 - 再请教adv
Given data set SASHELP.CLASS:
NAME AGE
Mary 15
Philip 16
Robert 12
Ronald 15
The following submitted: %let value = philip;proc print data=sashelp.class;
run;
Which WHERE statement successfully completes the program and produces a
report?
D: where upcase(name)="%upcase(&value)";
upcase(&value)不是得到PHILIP 么,难道不是应该只把P大写?
y*********4
发帖数: 76
15
来自主题: Statistics版 - 请问一道SAS ADV中的题目
第80题:
%let rc=Begin;
%macrotest;
data out;
set sashelp.prdsale nobs=totalobs;
if totalobs>10 then do;
%let rc=high;
end;
else do;
%let rc=low;
end;
run;
%mend;
%let rc=Before Execution;
%test
The data set SASHELP.PRDSALE has 50 obs, what is the value of the variable
RC when the macro finishes exectuion?
答案是A,可是怎么也想不通为什么是A呢?
o******6
发帖数: 538
16
来自主题: Statistics版 - [合集] 求教一道Advanced SAS
☆─────────────────────────────────────☆
jstmj2002 (Jeff) 于 (Mon Mar 9 04:22:10 2009) 提到:
%let rc=Begin;
%macro test;
data out;
set sashelp.prdsale nobs=totalobs;
if totalobs>10 then do;
%let rc=high;
end;
else do;
%let rc=low;
end;
%mend;
%let rc=Before Excution;
%test
the data set sashelp.pdrsale has 50 observations. What is the value of the
variable RC when the macro finishes excution?
A. low
B. high
C. Begin
D. Before Excution
Answer is A.
Why not B?
☆────────────
w*******n
发帖数: 469
17
来自主题: Statistics版 - 问个SAS题目,
80. The following SAS program is submitted:
%let rc = Begin;
%macro test;
data out;
set sashelp.prdsale nobs = totalobs;
if totalobs > 10 then do;
%let rc = high; end; else do;
%let rc = low; end; run;
%mend;
%let rc = Before Execution;
%test
The data set SASHELP.PRDSALE has 50 observations. What is the value of the
variable RC when the macro finishes execution?
A.low
B.high
C.Begin
D.Before Execution
为什么不是B?
l**********9
发帖数: 148
18
来自主题: Statistics版 - 一道ADV 130 题目
我想online TUTOR的意思只是说在代码仅被编译未被执行时,symput初始化的变量时
local的,举例说明,如果这道题的代码变成:
%macro one;
data _null_;
call symput('proc','means');
run;
%mend;
proc &proc data=sashelp.class;
run;
则程序出错,因为call symput('proc','means');语句仅仅被编译,没有被执行,所以
他还是局部变量,只能被%macro里面的语句调用。但是如果代码改成:
%macro one;
data _null_;
call symput('proc','means');
run;
%mend;
%one();
proc &proc data=sashelp.class;
run;
则输出结果和原始代码一样。说到底,macro就是让系统执行一段事先设置好的代码,
和直接在macro外部定义全局变量没有区别,只是简化了操作而已。
d*******o
发帖数: 493
19
proc sql;
create table out as
select mean(age) as a from sashelp.class
union
select mean(weight) as a from sashelp.cars
;quit;
a*****3
发帖数: 601
20
来自主题: Statistics版 - A problem on PROC SQL
多谢伪币 总算有人给我红包过年了。
这个问题说穿了吧,就是你想查阅dataset的基本信息,比如合适创建,修改,多少记
录,多少字段,什么长度,格式,标签,位置,数据类型,是不是已经排了序, 都可
以到一个表里去找, dictionary.Tables 。
其实还有个表有类似的功能, sashelp.Vtable, 和sashelp.VColumn.
s*********e
发帖数: 944
21
来自主题: Statistics版 - 请问SAS ADV 130中74 和80题
74. The following SAS program is submitted:
%macro one(input);
%two
%put the value is &date;
%mend;
%macro two;
data _null_;
call symput('date', '12SEP2008');
run;
%mend;
%let date = 31DEC2006;
%one(&date)
What is the result when the %PUT statement executes?
A.A macro variable DATE with the value 12SEP2008 is retrieved from the
global symbol table.
B.A macro variable DATE with the value 31DEC2006 is retrieved from the
global symbol table.
C.A macro variable DATE with the value 12SEP2008 is retri... 阅读全帖
o****o
发帖数: 8077
22
来自主题: Statistics版 - 请问sas如何做两万次ttest不崩溃?
作T检验,只需要三个统计量嘛,N,MEAN,STD
先求summarized statistics,再用BY-processing。跑得时间不见得少,不过至少不会
崩溃。而且这个用BY-PROCESSING可以很容易并行,最后合并结果也很容易。
134
135
136 options fullstimer;
137 data class;
138 set sashelp.class;
139 array col{20000};
140 do j=1 to dim(col); col[j]=rannor(0); end;
141 drop j;
142 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 20005 variables.
NOTE: DATA statement used (Total process time):... 阅读全帖
b******s
发帖数: 345
23
来自主题: Statistics版 - 问道 SAS BASE 的 Sample Questions
不懂这道题的考点在哪?知道的请说说。
Item 9
Given the following SAS error log
44 data WORK.OUTPUT;
45 set SASHELP.CLASS;
46 BMI=(Weight*703)/Height**2;
47 where bmi ge 20;
ERROR: Variable bmi is not on file SASHELP.CLASS.
48 run;
What change to the program will correct the error?
A.Replace the WHERE statement with an IF statement
B.Change the ** in the BMI formula to a single *
C.Change bmi to BMI in the WHERE statement
D.Add a (Keep=BMI) option to the SET statement
correct_answer = ... 阅读全帖
s****u
发帖数: 1200
24
来自主题: Statistics版 - 急问这个SAS的code该怎么写
你有两种选择:如果全部都是numeric的话,你就先transpose,不用写var statement.
再用proc SQL 把这个转置的column的var name读如macro, 分隔符随便。调用的时候
就用%scan来选读第几个。
法二,你要是有categorical var,我能想的就是用metadata了。用sashelp.vcolumns
表,也是用sql来读var names.很久不碰sashelp的表了,你需要去查证下

Var
★ 发自iPhone App: ChineseWeb 7.8
g****y
发帖数: 188
25
来自主题: Statistics版 - 求教2道sas advance题目,包子答谢。
Q17:
Given the SAS data set ONE:
ONE
DIVISION SALES
A 1234
A 3654
B 5678
The following SAS program is submitted;
Data _null_;
Set one;
By division;
If first.division then
Do;
%let mfirst=sales;
end;
run;
What is the value of the macro variable MFIRST when the program finishes
execution?
A. 1234
B. sales
C. 5678
D. null
我用程序跑过,确实是B. 但为什么不是C呢,想不明白。
Q80:
The following SAS program is submitted:
%let rc=Begin;
%macro test;
data out;
set sashelp.prdsale nobs = to... 阅读全帖
d******9
发帖数: 404
26
Below code may be not a perfect method, but it works.
Use the SASHELP Class data set to create a sample data set.
data A;
retain X Name Y Sex Z Age Height Weight;
set sashelp.class;
if ranuni(7546)<0.3 then X='Yes';
else if ranuni(7546)<0.5 then X='No';
else X=' ';
if ranuni(32681)<0.4 then Y='Yes';
else if ranuni(32681)<0.8 then Y='No';
else Y='***';
if ranuni(510)<0.6 then Z='Yes';
else if ranuni(33201)<0.8 then Z='No';
else Z='N/A';
run;
*******************************
Use array, find all the... 阅读全帖
e******o
发帖数: 644
27
来自主题: ZJU版 - 哪有zip code对state的对照表
SAS sashelp.zipcode 有专门对付这个的
搜搜相关资料看看
a****r
发帖数: 1486
28
来自主题: Statistics版 - 想练习使用SAS,不过没有data
sas自己本身就带很多data啊,看看libraries底下,sashelp之类有很多
b*****e
发帖数: 14
29
来自主题: Statistics版 - 再请教一道SAS ADV
The following SAS program is submitted:
%macro cols1;
name age;
%mend;
%macro cols2;
height weight;
%mend;
proc print data=sashelp.class;
run;
which Var statement successfully completes the program and produces a report?
A. var %cols2 %cols1;
B. var height %cols1;
C. var %cols1 heitht;
D. var %cols1 %cols2 height;
Answer: B
为什么不是A
c***y
发帖数: 50
30
来自主题: Statistics版 - 诚心请教一道sas adv题
The following SAS program is submitted:
%macro cols1;
name age;
%mend;
%macro cols2;
height weight;
%mend;
proc print data=sashelp.class;
???
run;
which statement successfully completes the programa and produces a report?
1, var %cols2 %cols1; 2,var height %col1;
3,var %cols1 height; 4,var %cols1 %cols2 height;
请问为虾米选2????
其他几个选项错在哪里
s*********h
发帖数: 16
31
来自主题: Statistics版 - 请帮忙看3道SAS题。
1。
At the start of a new SAS session; the following program is submitted:
%macro one;
data _null_;
call symput(’proc’,’means’);
run;
proc &proc data=sashelp.class;
run;
%mend;
%one()
What is the result?
(A) The marco variable PRCO is stored in the SAS catalog WORK.SASMACR
(B) The program fails to execute because PROC is a reserved word
(C) The macro variable PROC is stored in the local symbol table
(D) The macro variable PROC is stored in the global symbol table
2。
The following SAS program is s
x***i
发帖数: 135
32
来自主题: Statistics版 - 请教SAS BASE 11月真题54题-谢谢了
Q54
Consider the following data step:
data WORK.TEST;
set SASHELP.CLASS(obs=5);
retain City 'Beverly Hills';
State='California';
run;
The computed variables City and State have their values assigned using two
different methods, a RETAIN statement and an Assignment statement. Which
statement regarding this program is true?
A. The RETAIN statement is fine, but the value of City will be truncated to
8 bytes as the LENGTH statement has been omitted.
B. Both the RETAIN and assignment stat
c********s
发帖数: 483
33
来自主题: Statistics版 - 一个关于macro的问题,多谢。
Do you mean label for variable name?
If you do not know how many variables on dataset
You may use 1>. sashelp to get variable name,
2>. Proc sql select into: to get macro list
3>. proc sql select n() to get count macro
4>. Using do loop or array to label variable using your label
rule.
D*********2
发帖数: 535
34
来自主题: Statistics版 - 求助:Import .sas7bdat to R
Thanks. Although the problem is solved. I am still interested in this read.
ssd. I am so confused, would you please give me a hand?
I tried the example in the help document for windows,
read.ssd(file.path(sashome, "core", "sashelp"), "retail",
sascmd = file.path(sashome, "sas.exe"))
no problem, successfully imported.
But back to my case,
statdat <- "/Users/Dreamer1122/Documents/My SAS Files/9.2"
read.ssd(file.path(statdat), "dat_corr_03232010", sascmd = file.path(sashome
, "sas.exe
g********d
发帖数: 2022
35
proc sql;
select name
into :v1 - :v40
from sashelp.vcolumn
where libname='yourlibname'
and name contains 'READING'; quit;
data youroutputdata;
set youroriginaldata(keep=&v1 &v2 &v3 ... &v40);run;
d*******1
发帖数: 854
36
在SAS 界面左边的SASHELP里有不少
b*********e
发帖数: 29
37
SASHelp里边的好像不是例子用到的哈。还是我没找对路子?
有些例子自带了datalines,有些例子没有。(我猜这些没有的,可能在第一次用到的时
候,也给出了datalines了。可是,我们不可能一个一个例子翻阅这些help file呀。)
h*******d
发帖数: 272
38
来自主题: Statistics版 - killtest Q78 79 80
hi sorry ,but请再帮我看一道题吧
82 the following is submitted:
% macro cols1;
Name age;
%mend;
%macro cols2;
Height weight;
%mend;
Proc print data=sashelp.class;
Run;
Which VAR statement successfully completes the program and produces a report
?
答案 var height%cols1;
为什么不是: Var%cols2%cols1;
really appreciate it .
p*****o
发帖数: 543
39
我以为这个DATA SET是RUN SAS的时候,系统自动生成的,可是删除之后,发现再也没
有这个DATA SET了。。。请问,我该如何恢复这个呢。。。。
p*****o
发帖数: 543
40
thanks a lot.
I just copied one from SAS9.1 (i have both sas9.1 and
sas9.2 on my computer)
s******y
发帖数: 352
41
not entirely understand what you are trying to accomplish. but you don't
have to resort the macro, especially as you hate it so much.
alternatively, you can dynamically write statement to a temp file, then
later included with %inc. it is all data-driven.
something like this you could give it a try.
filename temp temp;
data _null_;
set yourvar; *<<-----this is a dataset contains all the variables (name &
format) need
transformation. you can get it from sashelp.vcolumns or
diction
f*******e
发帖数: 51
42
想不出简单的。。。
proc sql noprint;
select name into : varlst separated by " "
from sashelp.vcolumn
where libname="yourlib" and memname="yourfile" and type="char";
quit;
%put &varlst;
proc transpose data=yourfile out=yourfile2;
var &varlst;
run;
data yourfile2;
set yourfile2;
array char _character_ ;
count=0;
do over char; if char =" " then count+1;
end;
keep _name_ count;
run;
s******y
发帖数: 352
43
Code works only on SAS9.2.
data class;
set sashelp.class;
array temp $10. name sex cheight cweight cage;
cheight=cats(height);
cweight=cats(height);
cage=cats(age);
do over temp;
if ranuni(123456)<0.3 then call missing(temp);
end;
keep name sex c:;
run;
proc print;
run;
proc format;
value $miss " "="missing"
other="nomissing";
run;
proc tabulate data=class missing out=out;
class _character_;
table _all_,N;
format _character_ $miss.;
run;
data want(keep=var N rename=(N=miss));
set out;
array all
P******V
发帖数: 83
44
来自主题: Statistics版 - 请教SAS ADV真题里一道题目
还有三道130题里的问题:
81 At the start of a new SAS session, the following program is submitted:
%macro one;
data _null_;
call symput('proc','means');
run;
proc &proc data=sashelp.class;
run;
%mend;
%one()
what is the result?
A the macro variable proc is stored in the local symbol table.
B the macro variable proc is stored in the global symbol table.
C the macro variable proc is stored in the SAS catalog WORK.SASMACR
D the program fails to execute because PROC is a reserved word
这倒题答案是B,不过我不明白为什么proc是GLO
g********d
发帖数: 2022
45
你那个方法我没看懂,详细说说?
可以这样生成一个macro v:
proc sql noprint;
select crdate into :crdate
from sashelp.vtable
where libname="" and memname="";
quit;
%put &crdate;
p********a
发帖数: 5352
46
包子发放--投过票的ID每人发包子3个,以资鼓励。再次感谢同学们的大力配合。(包
子会通过MITBBS包子版让系统发,可能需要好几天。如果漏掉了谁,请PM版主)
zwto
lippo
sina1898
ultrabo
wilmic
summerice510
catkins
susujiejie
nickel
flyerr
lzh18291
zhongdianshi
freyjaa
today2008
yyll51
Pharmd
littlebirds
seashoregirl
sleephare
providential
YMcDullY
charleshuang
evaeva
killniu
fishc
lucialucia
yishengnanwz
biteshark
lym326
Junliwang
sashelp
TC999
twelfthfloor
doublefish
darkmatter
emstat
xmmm
kachen
scimitar
Bighappy
papertigra
libra
sheepsheep
Happy1976
QiaoKeLi
singlebea
h****o
发帖数: 119
47
来自主题: Statistics版 - 一道ADV 130 题目
SAS ADV 130的第81题:
%macro one;
data _null_;
call symput('proc','means');
run;
proc &proc data=sashelp.class;
run;
%mend;
%one()
What is the result?
A. The macro variable PROC is stored in the local symbol table.
B. The macro variable PROC is stored in the global symbol table.
C. The macro variable PROC is stored in the SAS catalog WORK.SASMACR.
D. The program fails to execute because PROC is a reserved word.
被GLOBAL和LOCAL SYMBOL TABLE弄晕了.为什么答案是B而不是A呀?
CALL SYMPUT不是用在MACRO DEFINITION中吗?那么,所生成的MACR... 阅读全帖
j**********3
发帖数: 305
48
Use macro variable to read variable name in the sashelp.vcolumn dataset.
m****r
发帖数: 202
49
来自主题: Statistics版 - 请教SAS advanced 真题中最后一道题
63
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,谢谢
l**********9
发帖数: 148
50
来自主题: Statistics版 - 请教SAS advanced 真题中最后一道题
仔细回忆一下macro的本质....macro就是把预先输入的代码用简单的关键词替换了而已
,遵照这个定义,把macro带入源代码中,如果空缺部分填写A答案的话就变成了:
proc print data=SASHELP.CLASS;
var Name Age;Height Weight;
run;
这时候一定会执行出错,因为AGE后面的分号说明var这个statement已经结束了,接下
来换行执行一下一个statement,而下一个statement就变成了Height...没有这个
statement所以就出错,正确的格式应该是:
var Name Age Height Weight;
看一看四个答案里,哪一个和这个是等价的?
1 2 下页 末页 (共2页)