Wednesday, March 27, 2013

Base SAS Example Question 5.1

Fill in the blank to output the first 5 observations from the filename col_inp.


data work.column_file;
     infile col_inp _____;
     input id 1 Name $ 3-16 Address $ 18-35;
     where Name contains 'Ziggy';
run;


a) maxobs=5
b) obs=5
c) datalines=5
d) lines=5


Leave your answer as a comment below...good luck!

SAS Cert

9 comments:

  1. Actually, CONTAINS does not work with IF. You need to change that statement to a WHERE statement. Alternatively, you can use the INDEX function with the IF statement:

    http://support.sas.com/kb/43/303.html

    The answer to the question is, as other posters have noted, b.

    ReplyDelete
  2. Answer for the above question is b) obs=5

    ReplyDelete