100% CORRECT ANSWERS
Which statement contains valid syntax for the RETAIN statement?
a. retain year 2018;
b. retain year*2018;
c. retain year=2018;
d. retain year{2018}; - Answer-a
Year is the column to retain with an initial value of 2018. A space goes between the
retain column and the initial value.
Which statement is false concerning the sum statement?
a.The sum statement ignores missing values.
b.The sum statement initially sets the accumulator column to missing.
c.The sum statements adds a numeric value to an accumulator column.
d.The sum statement automatically retains the value of the accumulating column. -
Answer-b
The SUM statement ignores missing values, initially sets the accumulator column to 0
Which of the following is a valid name for a character format?
a.country
b.$ctry
c.$country.
d._country - Answer-b)
Character formats must start with a dollar sign followed by a letter or underscore. A
format name does not end with a period.
Which of the following statements selects from a table only those rows where the value
of the Style column is RANCH, SPLIT, or TWOSTORY?
a. where Style='RANCH' or 'SPLIT' or 'TWOSTORY';
b. where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
c. where Style in (RANCH, SPLIT, TWOSTORY);
d. where Style in ('RANCH', 'SPLIT', 'TWOSTORY'); - Answer-where Style in ('RANCH',
'SPLIT', 'TWOSTORY');
Functions and CALL routines both return a value that must be used in an assignment
statement or expression.
a.True
, b.False - Answer-B. False
Which function calculates the average of the columns Week1, Week2, Week3, and
Week4?
a.mean(Week1, Week4)
b.mean(Week1-Week4)
c.mean(of Week1, Week4)
d.mean(of Week1-Week4) - Answer-D. mean(of Week1-Week4)
Which expression rounds each value of Sales to the nearest hundredth (or two decimal
places)?
a.round(Sales)
b.round(Sales, 2)
c.round(Sales, .01)
d.round(Sales, dollar10.2) - Answer-C. round(Sales, .01)
Which statement reads CityCountry and correctly assigns a value to Country?
a.Country=scan(CityCountry, 2);
b.Country=scan(CityCountry, -1);
c.Country=scan(CityCountry, 2, ',');
d.Country=scan(CityCountry, 2, ', '); - Answer-c
The SCAN function should return the second word using only the comma as a delimiter.
Which expression creates CityCountry?
a.cat(City, ", ", Country)
b.cats(", ", City, Country)
c.catx(City, ", ", Country)
d.catx(", ", City, Country) - Answer-d
The CATX function concatenates strings together, removes leading and training blanks,
and inserts the separator that is defined as the first argument.
Which of the following functions can convert the values of the numeric variable Level to
character values?
a.put(Level, 3.)
b.put(3., Level)
c.input(3., Level)
d.input(Level, 3.) - Answer-a.put(Level, 3.)
data national;
set sashelp.baseball;
BatAvg=nHits/nAtBat;