The SASDATA.BANKS data set has five observations when the following SAS program is submitted: libname sasdata 'SAS-data-library'; data allobs; set sasdata.banks; capital=0; do year = 2000 to 2020 by 5; capital + ((capital+2000) * rate); output; end; run; How many observations will the ALLOBS data set contain?
Exp: year=2000 to 2020 by 5 (includes the 2020 also, so 5 iterations)
5 observations 5 iterations
the output statement is inside the do loop, an observation will be created each time through the loop, so 5 observations, 5 loops, 25 observations total.
Question :
The SAS data set named COMPANY.PRICES is listed below: COMPANY.PRICES prodid price producttype sales returns K12S 5.10 NETWORK 15 2 B132S 2.34 HARDWARE 300 10 R18KY2 1.29 SOFTWARE 25 5 3KL8BY 6.37 HARDWARE 125 15 DY65DW 5.60 HARDWARE 45 5 DGTY23 4.55 HARDWARE 67 2 The following SAS program is submitted: libname company 'SAS-data-library'; data hware inter soft; set company.prices (keep = producttype price); if price le 5.00; if producttype = 'HARDWARE' then output HWARE; else if producttype = 'NETWORK' then output INTER; else if producttype = 'SOFTWARE' then output SOFT; run; How many observations does the HWARE data set contain?
Exp: Following three observation satisfy condition if price le 5. B132S 2.34 HARDWARE 300 10 R18KY2 1.29 SOFTWARE 25 5 DGTY23 4.55 HARDWARE 67 2 Out of the above 3 observation only 2 observation have producttype = 'HARDWARE', so number of observation in HWARE is 2, hence answer is 2
Question :
The following SAS program is submitted: data allobs; set sasdata.origin (firstobs = 75 obs = 499); run; The SAS data set SASDATA.ORIGIN contains 1000 observations. How many observations does the ALLOBS data set contain?
Correct Answer : Get Lastest Questions and Answer : Exp: when it read from 75 to 499 ,it will include 75 ,from 75 to it will read upto 499 so , 499 - 75 +1 = 425