ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 118

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

17 comments:

  1. Anonymous12:53 PM

    Corret answer is b)

    ReplyDelete
  2. Anonymous2:20 AM

    can somebody explain how its B

    ReplyDelete
  3. Anonymous11:22 AM

    OBS 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.
    Now 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.

    ReplyDelete
    Replies
    1. very nicely explained
      thank you

      Delete
  4. can u explan it breifly???
    Iam not understanding...

    ReplyDelete
  5. Anonymous5:01 PM

    read the documentation for obs and firstobs

    ReplyDelete
  6. Anonymous2:38 PM

    bcz 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

    ReplyDelete
  7. Anonymous1:39 PM

    An 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.

    Let'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).

    ReplyDelete
  8. For latest and updated SAS certification dumps in PDF format contact us at completeexamcollection@gmail.com

    Refer our blog for more details http://completeexamcollection.blogspot.in/2015/12/sas-certification-dumps.html

    ReplyDelete
  9. Very useful blog and very informative article thank you sharing keep posting sas training, sas admin training, sas clinical training,sas platformadmin training

    ReplyDelete
  10. Anonymous5:05 AM

    OBS is the end of observations ans firstobs ís the begin.

    ReplyDelete
  11. Anonymous5:08 AM

    firstobs = 100 then proc print will begin in 100 until 500.
    then the first observation will begin in 100 and the last in 500, of 100 to 500 we have 401 observation because start in 100

    ReplyDelete
  12. Anonymous12:20 PM

    b 500-(100 -1 )

    ReplyDelete