When the following SAS program is submitted, the data set SASDATA.PRDSALES contains 5000 observations:
libname sasdata 'SAS-data-library';
options obs = 500;
proc print data = sasdata.prdsales (firstobs = 100);
run;
options obs = max;
proc means data = sasdata.prdsales (firstobs = 500);
run;
How many observations are processed by each procedure?
A. 400 for PROC PRINT
4500 for PROC MEANS
B. 401 for PROC PRINT
4501 for PROC MEANS
C. 401 for PROC PRINT
4500 for PROC MEANS
D. 500 for PROC PRINT
5000 for PROC MEANS
Click Comment link to get answer
Corret answer is b)
ReplyDeleteB
ReplyDeletecan somebody explain how its B
ReplyDeleteOBS option will let SAS know last observation to process. FIRSTOBS option will let SAS know first observation to process. So for first proc print FIRSTOBS =100 and OBS (i like to call it LASTOBS) = 500, so there are 401 observation (including 100th observation) processed by it.
ReplyDeleteNow for proc means FIRSTOBS=500 and OBS (or LASTOBS) = Max (or 5000 in this case), so there are 4501 observation (including 500th observation) is processed by it.
So answer is B. Hopefully that helps.
very nicely explained
Deletethank you
B
ReplyDeletecan u explan it breifly???
ReplyDeleteIam not understanding...
read the documentation for obs and firstobs
ReplyDeletebcz if we give fstobs value it takes observations from data sets as (obs-fstobs+1) hence in abv pgm it have obs=500 n fstobs=100 so 500-100+1=401
ReplyDeleteAn easy way to figure out how many observations are between a first observation at 100 (firstobs=100) and a last observation (obs=500) at 500 is to simplify it first.
ReplyDeleteLet's say I want to know how many observations are between my first observation (firstobs=1) at 1, and my last observation (obs=5) at 5. There are: 1.. 2.. 3.. 4.. 5. If I'm subtracting (5-1=4), I'm not counting that last observation. And you know, even just by counting your fingers, there are 5 observations between 1 and 5. So it's really (5-1+1=5). This is the same thing with firstobs=100 and obs=500. (500-100+1=401).
c
ReplyDeletebB
ReplyDeleteFor latest and updated SAS certification dumps in PDF format contact us at completeexamcollection@gmail.com
ReplyDeleteRefer our blog for more details http://completeexamcollection.blogspot.in/2015/12/sas-certification-dumps.html
Very useful blog and very informative article thank you sharing keep posting sas training, sas admin training, sas clinical training,sas platformadmin training
ReplyDeleteOBS is the end of observations ans firstobs ís the begin.
ReplyDeletefirstobs = 100 then proc print will begin in 100 until 500.
ReplyDeletethen the first observation will begin in 100 and the last in 500, of 100 to 500 we have 401 observation because start in 100
b 500-(100 -1 )
ReplyDelete