Friday, March 2, 2012


input a $ b;
cards;
$ 250 $100
;
What will be the value of b in the above step?
a)$100 b)100 c) . d) character missing”;

;

  1. infile x obs=100 lastobs=200;
  2. infile x firstobs=101 lastobs=201;
  3. infile x obs=101 lastobs=200;
  4. infile x firstobs=101 obs=201;
  5. infile x firstobs=100 obs=200;


  1. 5,5,5
  2. 5,7,5
  3. 7,7,5
  4. 7,5,5
;
  1. TEST1 Only
  2. TEST2 Only
  3. TEST3 Only
  4. Both TEST2 and TEST3
  5. None of the above

  1. You must put &LIB in %NRSTR().
  2. You must put &DSN in %STR().
  3. You must add a period.
  4. You must add OPTIONS DLM='.' before the PROC step.
  5. Nothing - the sample code is correct.
;
  1. Yes.
  2. No. if ABS(x,.0001)=.3333 then
  3. No. if ROUND(x,.0001)=.3333 then
  4. No. if MOD(x,3)=0 then
  5. No. if PUT(x,.00001)=.3333 then
  1. %STR
  2. %QSCAN
  3. %QUOTE
  4. %SYMPUT
  5. %UNQUOTE
  1. If VAR1's value was repeated in TEST, then all but one of the observations with that value were removed.
  2. If VAR1's value was repeated in TEST, then all the observations with that value were removed, but only if the rest of the variables had identical values.
  3. If VAR1's value was repeated in TEST, then all the observations with that value were removed.
  4. The value of first.VAR1 and last.VAR1 are both equal to zero.
  5. If VAR1's value was repeated in TEST, then all the by variables are set to missing.
  1. It specifies a width of the decimal value - in this case 3 decimal places.
  2. It indicates that if a variable falls within .3 of the value specified in the value statement, the corresponding label is used to print the value.
  3. It prints the label defined in the value if the variable value contains a .3.
  4. It multiplies the value of the variable times .3, and if the result equals the label (a certain number as defined in the DATA step), then prints the label.
  5. It divides the value of the variable by .3, and if the result equals the label (a certain number as defined in the DATA step), then prints the label.

  1. The variable VAR1 is a character variable, and if it has a non-blank value, then assign 'added to income' to salary.
  2. If the variable VAR1 earned is present, then go to label marked salary=added to income.
  3. If the variable VAR1 is in the program data vector, then assign 'added to income' to salary.
  4. Select all of the observations where salary is 'added to income'.
  5. If the variable VAR1 is not equal to '.' or 0, then salary = 'added to income'.
  1. It advances the pointer to column 5 of the next input line.
  2. It moves the column pointer to column 5.
  3. It moves the pointer 5 columns.
  4. It moves the pointer to the line 5.
  5. It inputs 5 lines into one observation.
;
  1. A=1 B=4 C=wren D=not missing E=1
  2. A=1 B=3 C=W D=missing E=1
  3. A=3 B=3 C=blank D=missing E=1
  4. A=1 B=3 C=wren D=wren E=1
  5. A=1 B=4 C=W D=not missing E=1

191. The following is an example of.... (Choose one)
data employee;
infile 'employee.dat'; /* Assuming directory-based system */
input id $6. name $20. @30 locale $10.;
run;
A. List
B. Column
C. Formatted
D. Mixed
E. Standard

192. True or False...(Choose one)
The extesion of ".sas" is required for sas program files.
A. True
B. False

193. Which of the following are valid statements concerning reading raw data files using list input: (Choose all
that apply)
A. The DLM= is an option for the infile statement for specifying delimiters.
B. All variables have a default length of 8 bytes.
C. When the input statement runs into an end-of-line marker, it stops reading data even
though there are more fields specified.
D. You use a $ after a variable name to specify a character variable.
E. Fields are read from left to right.

194. Given the following raw data file, offices.dat, in a directory-based system, which data step would create a
SAS data set with one observation for each region: (Choose One)

1 1 2 2 3 3 4
1234567890123456789012345678901234567890
East Maryland Vermont Maine
Central Illinois Iowa Kansas Missouri
West California Washington

195. The double trailing "@@" in an input statement...(Choose all that apply)
A. holds the current data line in the buffer for another input statement to process
B. can be used to read multiple observations from a single data line
C. loads a new record into the input buffer if an end-of-record is found in the current record
D. is a syntax error.
E. None of the above.

196. Which SAS statement below will change the characteristics of a variable if it was used in a data step?
A. SCAN
B. ATTRIB
C. FORMAT
D. PUT
E. ARRAY

197. Which X variable has a value of 1 at the end of an input file?
A. END = X
B. OBS = X
C. EOF = X
D. LASTOBS = X
E. NOOBS = X

198. Given a data file with 100 columns of data, you only need to read in the first 70 columns. Which of the
following could you use:
A. infile x line = 70;
B. infile x length = 71;
C. infile x missover = 70;
D. infile x ls=70;
E. infile x linesize=70;

199. In the following code sample:
data xyz;
infile abc;
input h i +3 j;
run;
What does the +3 do?
A. It moves the pointer down 3 records
B. It moves the column pointer to column 3
C. It adds 3 to the value read into variable i
D. It advances the column pointer 3 places
E. It advances the column pointer 4 places

200. What does the following SAS statement do?
if location =: 'C';
A. It selects the observation if there is a 'C' in the location value.
B. It selects the observation if there is a 'C' at the first position in the location value.
C. It selects the observation if the location value is 'C'.
D. It selects the observation if the location value contains a lowercase 'c'.
E. None of the above, it's a typo.



2 comments:

Note: Only a member of this blog may post a comment.