由买买提看人间百态

topics

全部话题 - 话题: syslast
(共0页)
c*****s
发帖数: 180
1
来自主题: WaterWorld版 - PURE WATER DO NOT NETER PLEASE
Complete the following code so that the macro Prtlast will be compiled and
stored in Macrolib.
libname macrolib 'c:\storedlib';
options mstored sasmstore=macrolib;
%macro
%if &syslast ne _NULL_%then %do;
proc print data=&syslast(obs=5);
title "Listing of &syslast data set";
run;
%end;
%else
%put No data set has been created yet.;
%mend;
z*******e
发帖数: 32
2
来自主题: Statistics版 - 请教sas adv的题
第8题
¯o houses(dsn=houses,sub=RANCH);
data &dsn;
set sasuser.houses;
if style = "&sub";
run;
%mend;
%houses(sub=SPLIT);
%houses(dsn=ranch);
%houses(sub=TWOSTORY);
which one of the following is the value of macro variable SYSLAST?
A. work.ranch
B. work.houses
C. WORK.RANCH
D. WORK.HOUSES
我的理解是syslast是系统最后generated一个dataset,所以在最后一次call这个叫
houses的macro的时候,dsn值是缺损的,那么就使用default值就是dsn=houses, 所以
生成的dataset就是houses。这样理解对吗?如果是的话,答案B和D的区别又在哪里呢
?从没觉得大小写有区别啊?
跪谢!!
Z********6
发帖数: 10
3
来自主题: Statistics版 - 请教sas adv的题
The answer is D. syslast, the name of the most recently created SAS data set
, seems always uppercased.
%macro cars(dsn=cars,sub=Acura);
data &dsn;
set sashelp.cars;
if make = "&sub";
run;
%mend;
%cars(sub=Audi);
%cars(dsn=ACURA);
%cars(sub=BMW);
%put &syslast.;
*WORK.CARS;
u*****o
发帖数: 1224
4
来自主题: Statistics版 - 再次请教 SAS ADV 题
The following SAS code is submitted:
%macro houses(dsn =houses,sub =RANCH);
data &dsn;
set sasuser.houses; if style ="&sub";
run;
%mend;
%houses(sub =SPLIT)
%houses(dsn =ranch)
%houses(sub =TWOSTORY)
Which one of the following is the value of the automatic macro variable
SYSLAST?
A. work.ranch
B. work.houses
C. WORK.RANCH
D. WORK.HOUSES
Answer: D
这个题我在版上搜过,没人问。可是我却不会。。。想知道为何houses变大写了?
G********t
发帖数: 334
5
来自主题: Statistics版 - 再次请教 SAS ADV 题
SYSLAST references the last dataset u used. it is ALWAYS in capital letters.
k*****u
发帖数: 1688
6
data ss;
input id eventDay;
cards;
001 3
002 2
003 4
003 5
004 3
004 4
004 5
004 11
004 20
;
run;
proc sort data=ss;
by id;
run;
data new;
set ss;
by id;
retain stop;
if first.id then start=0;
else start=stop;
stop=eventday;
run;
proc print data=&syslast;
var id eventday start stop;
run;
g******7
发帖数: 1739
7
来自主题: Statistics版 - 求助一道SAS advanced题目
The following SAS code is submitted:
%macro houses(dsn = houses,sub = RANCH);
data &dsn;
set sasuser.houses;
if style = "&sub";
run;
%mend;
%houses(sub = SPLIT)
%houses(dsn = ranch)
%houses(sub = TWOSTORY)
Which one of the following is the value of the automatic macro variable
SYSLAST?
A. WORK.HOUSES
B. work.ranch
C. WORK.RANCH
D. work.houses
Answer: A
求解释,为什么啊?多谢大家乐
c*****e
发帖数: 37
8
来自主题: Statistics版 - 求助一道SAS advanced题目
&SYSLAST always stores data set name in capital letters.
(共0页)