全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2837 1
2008-07-03

周五要考ADVANCE了

题目如下

WHICH ONE OF FOLLOWING SAS PROGRAMS USES THE MOST AMOUNT OF MEMORY RESOURCES FOR OUTPUT BUFFERS?

A )  data new(bufsize=1000 bufno=5);

set temp;

run;

b) data new(bufsize=1000 bufno=2);

set temp;run;

c) data new(bufsize=2000 bufno=3);

set temp; run;

d)data new(bufsize=4000 bufno=1);

set temp;run;

我觉得答案是C,因为2000*3=6000,是最大的.

可老师说,如果问的是MEMORY,就只要看BUFNO,那个BUFNO大,就那个USE MOST AMOUNT OF MEMORY,如果问的是I/O,那么就算乘积.所以老师觉得应该是A.

我想问问,到底是那个呢

第二题

data a b(view=b);

input age @@;

if age<24 then output a;

else output b;

cards;

21 23 26 21 27 23 24 25 26

;

proc print data=a;

run;

a) data a is not existed.

b)there are three observations in the data a;

c) there are five observation in the data b;

d) none of above

答案是A

是不是因为第一句应该写成 DATA  A B\VIEW=B

不该用括号,谁能告诉我,为什么A不存在.

先谢谢各位帮我解答.

二维码

扫码加我 拉你入群

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

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

全部回复
2008-7-3 20:16:00
I am beginner too. But I found the answer to your second question. It is about 'SAS Views'.

SAS Views provide all the functionality and flexibility of SAS data sets,    but occupy only a minuscule fraction of the space of a full SAS data set. The View acts as sort of a "map" to the source data, instead of making a complete copy of it in SAS data format.
SAS Views are documented in the SAS OnlineDoc(tm).

To create a SAS View, add the VIEW= option to the DATA statement. The SAS data view name provided after VIEW= must be the same as at least one of the SAS data set names mentioned in the DATA step statements, but may not be the same as a SAS View or SAS data set already in the same library. Virtually all the language of the DATA step is the same as it would be if a true SAS data set were being created, except that the VIEW= option is added. For example, the following statements read raw data and create a SAS View called view1.ssv01:

            libname viewout '~/sasviews';
            filename raw1 '~/rawdata/file1.raw';

            data viewout.test1 / view=viewout.test1;
              infile raw1;
              input var1 var2 var3;
            run;
      Later, all that is needed to access the data with a PROC are the global statements (LIBNAME, FILENAME) and the PROC itself. For example,

            libname viewout '~/sasviews';
            filename raw1 '~/rawdata/file1.raw';
            proc print data=viewout.test1;

Views can be used to access other SAS data sets, allowing the use of subsets without wasteful usage of space. Imagine you have a master SAS data set, and routinely you need to process subsets of the data. Instead of storing potentially redundant subsets in the form of SAS data sets, Views could be used to save space. Consider the following:

            libname allsas '~/sasdata';
            libname viewstor '~/sasviews';
            data viewstor.females / view=viewstor.females;
                set allsas.master;
                if sex='f';
               
            data viewstor.males / view=viewstor.males;
                set allsas.master; if sex='m';

This would allow you the functionality of two subsets in addition to the master data set, while using only a tiny bit more disk space than the master data set itself. If real SAS data sets were used for the subsets, together they would have doubled the amount of disk space used.

To the first one, please refer to SAS support file:
http://www.sas.com/offices/NA/canada/downloads/presentations/Vancouver_Fall_2005/SAS_Efficiency_considerations.pdf

The BUFSIZE = system option or data set option to control the page size of an output SAS data set. The BUFNO= system option or data set option to control the number of SAS buffers open simultaneously in memory. You can get more details from the above link and SAS website.




Hope it helps

SAS support file
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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