SAS Base Certification

87 terms by arickett

Create a new folder

Advertisement Upgrade to remove ads

c

Which of the following will select from a data set only those observations for which the value of the variable Genre is SciFi, Western, or Classic?

a.where genre='SciFi' or 'Western' or 'Classic';
b.where genre is SciFi Western Classic;
c.where genre in ('SciFi', 'Western', 'Classic');
d.where genre in (SciFi, Western, Classic);

b

What happens when the following program is run?

proc sort data=black.book;
run;
proc print data=black.book;
var name age number;
where status='Single';
run;

a. The PROC PRINT step is successful, providing list in sorted order.
b. The PROC SORT generates an error in the log, the PROC PRINT step runs.
c. The PROC SORT step permanently sorts the data set.
d. The PROC SORT runs successfully, PROC PRINT generates errors

d

In the DATA step, how can you reference the temporary SAS data set named Dating

a. Dating
b. Work.Dating
c. Pool.Dating (after assigning the libref Pool)
d. a and b

a

Which of the following is a valid variable name?

a. _Units_
b. 2Cool
c. Total$
d. Days-To-Ship

d

Which of the following contains a syntax error?
a. None of these
b.proc print data=sales.location;
label loc='Franchise Location';
run;
c.proc sort data=work.sales;
by month;
run;
d.dat homework.test;
set homework.quiz;
run;

c

A syntax error occurs when
a. the form of the elements of the SAS statement are correct but their usage is not.
b. none of these.
c. programming statements that do not conform to the rules of the SAS language.
d. some data values are not appropriate for the SAS statements.

d

What usually happens when a syntax error is detected?

a. SAS continues to process the step, and the SAS log displays messages about the error.
b. SAS continues to process the step.
c. SAS stops processing the step in which the error occurred, and the Output window displays messages about the error.
d. SAS stops processing the step in which the error occurred, and the SAS log displays messages about the error

a

What is the default length of the variable BALANCE?
Name Balance
Andrews 123.21
Smithy 92.31
Keeley 2812.23
Cist 981.99

a. 8
b. 32
c. 0
d. 16

c

Which time span is used to interpret two-digit values if the YEARCUTOFF= option is set to 1969?

a. 1969-2000
b. 1969-2069
c. 1969-2068
d. 1870-1969
e. 1970-2069

b

What does the NOOBS option do in the PROC PRINT step?

a. Relentlessly mocks you for being new to SAS.
b. Removes the default Obs column from the output
c. Prints only the the column titles with no data.
d. Prints the data with no column titles.

c

Which statement correctly accesses an Excel file?

a.libname xldat 'C:\Excel\example.xlsx.Sheet1';
b.filename xldat 'C:\Excel\example.xlsx';
c.libname xldat 'C:\Excel\example.xlsx';
d.filename xldat 'C:\Excel\example.xlsx\Sheet1$';

j

The following format substitutes full names for initials. Identify the error(s).

proc format lib=soil;
value drvfmt;
SS=Sam Smithie Smith
JR=Jim Rollins
ER=Elmer Richards
run;

a. the strings on the right of the equal sign need to have quotes.
b. the strings on the left of the equal sign need to have quotes.
c. the format needs to have a $ in front of the name
d. semicolons should be after each line
e. there should be no semicolon after the word drvfmt
f. there should be a semicolon after the final format entry
g. (a) and (b)
h. (c) and (d)
i. (e) and (f)
j. (a), (b), (c), (e), and (f)
k. all of the above
l. none of the above

a

If SAS cannot interpret a syntax error, then

a. the DATA step compiles but does not execute.
b. the DATA step does not compile.
c. the DATA step compiles and executes.
d. the variables in the data set will all be set to missing values.

d

Which statement identifies the name of a raw data file to be read with the fileref Jobs and specifies that the DATA step only read records 1-20?

a. infile jobs obs 20;
b. infile jobs 1-20;
c. input jobs 1-20;
d. infile jobs obs=20;
e. input jobs obs=20;

a

What is not created in the compilation phase of the DATA step?

a. the first observations
b. the automatic variables _N_ and _ERROR_
c. the data set descriptor
d. the program data vector

d

Which of the following statements will process only the records above where Driver is SS?

a. a or c
b.if driver=SS
c.if driver is SS
d.if driver='SS'

b

During the compilation phase, SAS checks each statement looking for syntax errors. Which of the following is not a syntax error?

a. missing or invalid punctuation
b. improper formats and incorrect values
c. missing or misspelled keywords.
d. invalid options or variable names

c

How would you create a list report of an Excel sheet?

a.data work.new; infile xldat.'Sheet1$'; input var1 var2 var3; run; proc print data=work.new; run;
b.proc print data=xldat; sheet = 'Sheet1'; run;
c.proc print data=xldat.'Sheet1$'n; run;
d.proc print data=xldat.'Sheet1$'; run;

d

When you run a SAS program to read in biographical information, an error occurs from the 3rd to the 20th records due to a change of format in the DoB column. What is the value of _ERROR_ after the 17th record is read in?

a. 0
b. 14
c. 3
d. 1

b

The DATA step will execute

a. once for each phase of the DATA step.
b. once for each record in input file
c. once for the data set
d. once for each variable in the input statement

f

The default statistics created using PROC MEANS

i. n-count
ii. mean
iii. median
iv. min
v. max
vi. standard deviation
vii. range
viii. Q1
ix. Q3
x. P99
xi. P1

a. iv, viii, iii, ix, v
b. all of them are generated by default
c. i, xi, x
d. i, ii only
e. none of the these (where is my z statistic...)
f. i, ii, iv, v, vi
g. ii only

d

Using the ODS statements, how many different outputs (HTML, PDF, RTF, etc...) can be created at the same time?

a. 3
b. 2
c. 1
d. As many as are needed

d

If ODS is set to its default settings, what output is created by the following code?

ods html file="c:/htmlout.html";
ods pdf file="c:/pdfout.pdf";
ods rtf file="c:/rtfout.rtf";

a. HTML, RTF, listing
b. HTML, PDF
c. RTF only
d. HTML, PDF, RTF, Listing
e. none, ODS is closed by default

d

What happens when the following code is submitted in SAS?

proc report data=employees nowd;
column name month sales bonus units;
define name / order 'Employee';
define month / order 'Month';
define sales / format=8.2 'Sales';
define bonus / computed 'Monthly Bonus';
define units / format=4. 'Units Sold';
compute bonus;
bonus=sales(units/100).06;
endcomp;
run;

a. Something happens but there is no way to be sure...
b. Program runs fine (no errors found in the log).
c. Program does not run. Syntax Error causes the code not to compile correctly.
d. Program runs, but the output is missing for bonus.

b

Using the code above, what is the correct set of code to define BONUS as a computed variable?

a.
define bonus / computed 'Yearly Bonus';
computation;
bonus=(yrsemp/10)(yrsales.06);
end computation;
b.
define bonus / computed 'Yearly Bonus' format=8.2;
compute bonus;
bonus=(yrsemp/10)(yrsales.06);
endcomp;
c.
define bonus / computed 'Yearly Bonus';
compute bonus=(yrsemp/10)(yrsales.06);
endcomp;
d.
define bonus / ordered 'Yearly Bonus';
bonus=(yrsemp/10)(yrsales.06);

a

What is true of the BY statement in the context of PROC MEANS?

a. BY variables must be indexed or sorted
b. BY-grouping overwrites your data set with the newly grouped observations
c. BY functions just like the CLASS statement.
d. Summary statistics are computed on BY-variable values

a

You have a data set containing the following variables, which of them is a poor choice for PROC MEANS analysis

a. emp id num
b. bonus
c. years employeed
d. salary
e. sick days

a

What output does the following code produce?

proc report data=employees nowd;
column name yrsemp salary yrsales bonus;
run;

a. a list report that displays a row for each observation in the input data set and includes only the variables in the COLUMN statment.
b. a list report that calculates the N (frequency) statistic for character variables.
c. a list report ordered by values of the first variable in the COLUMN statement
d. a summary report ordered by values of the first variable in the COLUMN statement.

a

When you define an order variable in PROC REPORT

a. all of the above
b. none of the above
c. you are unable to create a summary report
d. PROC REPORT displays only the first occurrence of each order variable in sets of rows with duplicate order variables.
e. the detail rows are ordered according to their formatted values

a

By default, PROC FREQ creates tables of frequencies and percentages for which data set variables?

a. both character and numeric variables
b. numeric variables
c. character variables
d. none: you must always specify the variables.

d

Consider the following code.

data sandbox;
set employees(keep=Name Weight Gender);
by Gender;
if first.gender then do; n=0;
avgWeight=0;
end;
n+1;
avgWeight+Weight;
if last.gender then do;
avgWeight=avgWeight/n;
output;
end;
run;

Assuming the code runs without errors and employees starts with 200 observations, how many observations will be in sandbox?

a. 0
b. 200
c. 1
d. 2

d

The data step executes

a. once for each variable in the output data set
b. continuously if you use the POINT= option and the STOP statement.
c. until it encounters an OUTPUTstatement
d. once for each observation in the input data set.

c

Which statement correctly preserves the "date" variables in both data sets?

a.
merge employees sales; rename employees.date = dateHired sales.date=dateSold;
b.
merge employees (date=dateHired) sales (date=dateSold);
c.
merge employees sales (rename=(date=dateSold));
d.
merge employees (rename date=dateHired) sales (rename date=dateSold);

d

Which of the following can determine the length of a new variable?

a. the length of the first value
b. the assignment statement
c. the LENGTH statement
d. all of the above
e. none of the above

d

What variables are in sandbox when it is run?

data sandbox(drop=Age);
set employees(keep=Name Age Weight);
by Age;
run;

a. None.
b. Name, Age, Weight
c. Not enough information
d. Name, Weight

d

In order to use the first. and the last. variables inside a data set, what must be true?

a. The data set must be sorted.
b. The BY statement must be used in the data step.
c. You need to do nothing, they are created automatically.
d. A and B
e. None of the Above.

a

The data set julSales has 250 observations, while augSales has 600 observations. Consider the following code.

data stores;
set julSales;
set augSales;
run;

How many observations will be in the stores data set?

a. 250
b. 0. You can't use two SET statements.
c. 600
d. 850

b

The data set play contains the variable i and j, while sand contains i and k. Consider the following code.

data box;
merge play sand;
run;

What variables will be in the resulting data set box?

a. i
b. i, j, k
c. The code has a syntax error.
d. i, j

e

Which array statement option(s) would only apply when creating new variables?

a. length
b. dimension
c. initial values
d. b and c
e. a and c

a

You have a variable FUNCODE which is 123M43S3 for one occurrence and 983F23G4 for another. The fourth character is the gender and age is the numbers in the 5th and 6th characters. What is used to assign AGE to the appropriate value?

a. AGE=substr(funcode,5,2);
b. AGE=scan(funcode,5);
c. AGE=scan(funcode,5,2);
d. AGE=substr(funcode,5);

b

You have a set of variables Var1 Var2 Var3 Var4 Var5. Which function will calculate the mean?

a. mean(var)
b. mean(of var1-var5)
c. mean(of var1,var5)
d. mean(var1-var5)

b

If you have a date variable (date) whose value is 01 January 2009 and were interested in determining the month value, what function would you use?

a.
month=mdy(date,'month');
b.
month=month(date);
c.
month=today(date);
d.
month=qtr(date);

c

How can you find out the dimensions of the array sales?

a. The automatic macro variable &dimsales
b. None of the these
c. dim(sales)
d. dimensions(sales)

a

What will the following output?

data _null_;
array i{2,3} (1 2 3 4 5 6);
array j{6} (10 20 30 40 50 60);
do k=3,1;
total + i{2,k} - j{2*k};
end;
grandtotal = total + sum(of j{*});
put grandtotal=;
run;


a. grandtotal=140
b. grandtotal=-70
c. grandtotal=210
d. -70

b

How many observations are in playground after the data step is run?

data playground;
do x=0 to 9;
do y =0 to 9;
if x in(1,3,5,7,9) then do;
z=x*10+y;
output;
end;
end;
end;
run;


a. 0
b. 50
c. 100
d. 10
e. Can not determine from the output.

a

Suppose that the YEARCUTOFF= system option is set to 1910. Which MDY function creates the date value for April 22, 2010.

a. MDY(4,22,2010);
b. MDY(22,4,10);
c. MDY(4,22,10);
d. MDY(22,4,2010)

d

From the following code, what is the value of x,y,z after the data step is run?

data sandbox;
do x=1 to 10;
do y = 1 to 10;
if x le 9 then z=8;
end;
end;
run;

a. x=. y=. z=.
b. can not be determined
c. x=10 y=10 z=.
d. x=11 y=11 z=8
e. x=10 y=10 z=8

d

Which is false regarding arrays?

a. The variables are added to the program data vector during the compilation phase.
b. Arrays can be multidimensional.
c. You do not need to specify the array elements in the ARRAY statement.
d. Arrays can only have character elements.

b

What does the following statement do if firstdate and lastdate are stored as date values?

numdays = lastdate - firstdate;


a. Causes a syntax error
b. The variable numdays contains the number of days between the dates.
c. Your computer explodes.
d. The variable numdays contains a noninterpretable integer value.

b

What is the default value of YEARCUTOFF= system option?

a. 1900
b. 1920
c. 1960
d. 1961

c

SAS does not adjust for daylight savings time, but it will adjust for

a. Julian dates
b. Jewish holidays
c. leap years
d. time zones

b

The following are the first lines of an input file.

123456789|123456789|123456789|
Smith Joe 27 1892 81059
Franks Carl 24 2343 84060
Well Sam 32 4569 76182
Max Cori 21 1052 87231

Which piece of code reads the data without errors?
a.
data people; infile `people.txt'; input @21 dob @8 first $ @1 last $ @16 dues; informat dues comma5.2; informat dob julian.; run;
b.
data people; infile `people.txt'; input last $ first $ dues dob; informat dues comma4.2; informat dob julian.; run;
c.
data people; infile `people.txt'; input @21 dob @8 first @1 last dues; informat dues comma5.2; informat dob julian.; run;
d.
data people; infile `people.txt'; input last first dues dob; informat dues comma5.2; informat dob julian.; run;

a

Consider the following data.

Smith Joe 27 1892 81059
Franks Carl 24 2343 84060
Well Sam 32 4569 76182
Max Cori 21 1052 87231

The following versions of the same data are missing some values. Which file should be read in with the MISSOVER option?
a.
Smith Joe 27 1892Franks Carl 24 2343 84060Well Sam 32 4569 76182Max Cori 21 1052 87231
b.
Smith Joe 27 1892 81059Franks Carl 24 2343 84060Well Sam 32 4569 76182Max Cori 21 87231
c.
Smith Joe 27 1892 81059Franks Carl 2343 84060Well Sam 32 4569 76182Max Cori 21 1052 87231
d.
Smith Joe 27 1892 81059Franks Carl 24 2343 84060Well 32 4569 76182Max Cori 21 1052 87231

d

The min width of a the TIMEw. informat is

a. 7
b. 4
c. 6
d. 5

d

SAS date values are the number of days since which date?

a. Jan 1, 1900
b. Jan 1, 1950
c. Jan 1, 1901
d. Jan 1, 1960

b

Which informat could be use to read the date value 01MAR91?

a. mmddyy6.
b. date7.
c. weekdate6.
d. date9.

d

The advantage of storing date and time data as numeric data comes in the form that

a. they have a real world meaning.
b. they can be used in character strings like any other character value.
c. they can be easily edited.
d. they can be used in calculations like other numeric values.
e. Dates and times are not stored as numeric values at all.

d.

The following is the first few lines of an input file.

Smith^Joe^27^1892^81059 Franks^Carl^24^2343^84060 Well^Sam^32^4569^76182 Max^Cori^21^1052^87231

Which statement should be used to read in the file referenced by the fileref persons?

a.
infile persons dlm;
b.
infile persons '^';
c.
infile persons
d.
infile persons dlm='^';

d

If you know the SAS date value for a certain date is 850, in which year did the day occur?

a. 1960
b. 1922
c. 1921
d. 1962
e. 1961

c

From the following code, two data sets play and sand were created.

data play;
do i=0 to 9;
do j=0 to 9;
k=i*10 + j +1;
output;
end;
end;
run;

data sand;
do i=1 to 100;
a=byte(i); / Returns a character /
output;
end;
run;

What is the code to merge the two data sets into a new data set named box preserving all of the original variables?

a. data box; merge play sand(i=sandi); run;
b. data box; merge play sand(out=sandi); run;
c. data box; merge play sand(rename=(i=sandi)); run;
d. data box; merge play sand(in=sandi); run;

d

If I submit the code below, what will the title look like above my SAS output?
title; title1 'Stat 124 Final Exam'; title2 'Spring 2009'; title3 'Dr. Scott'; title2 'Fall 2010'; title2;

a. Stat 124 Final Exam Spring 2009 Dr. Scott
b. Stat 124 Final Exam Fall 2010 Dr. Scott
c. Dr. Scott Stat 124 Final Exam
d. Stat 124 Final Exam

d

The data step has completed processing for five records, two of which had a data error. At the end of the fifth record, which of the following could be the correct program data vector? The last values read in without errors were AC103, John, and 45330.
a. _N_ _Error_ ID Name Salary
6 1 . . 0

b. _N_ _Error_ ID Name Salary
6 2 .

c. _N_ _Error_ ID Name Salary
5 2 AC103 John 45330

d. _N_ _Error_ ID Name Salary
6 1 .

c

Which of the following correctly creates four variables which give the total quarterly sales for each quarter given that the dataset SALES contains twelve variables, month1 through month12?
a.
data Quarterly; set Sales; array quarter{4}; array month{4,3}; do i=1 to 4; quarter{i}=0; do j=1 to 4; quarter{i}+month{i,j}; output; end; end;run;

b.
data Quarterly; set Sales; array quarter{4}; array month{4,3}; do i=1 to 5; quarter{i}=0; do j=1 to 4; quarter{i}+month{i,j}; end; end;run;

c.
data Quarterly; set Sales; array quarter{4}; array month{4,3}; do i=1 to 4; quarter{i}=0; do j=1 to 3; quarter{i}+month{i,j}; end; end;run;

d.
data Quarterly; set Sales; array quarter{4}; array month{4,3}; do i=1 to dim(quarter); quarter{i}=0; do j=1 to dim(month); quarter{i}+month{i,j}; end; end;run;

c

The following program is submitted
data wally;
if AmountDue=. then AmountDue=100;
AdditionalFees=50;
AmountDue=.;
TotalDue=(AmountDue+AdditionalFees)+0;
run;

What is the value of TotalDue variable in the output data set?

a. 100
b. 0
c. . (missing value)
d. 50

a

Which of the following pieces of code appends the
observations from dataB to the end of the dataset dataA?

a.
data dataC;
set dataA dataB;
run;
b.
data dataC;
set dataA dataB;
by variable1;
run;
c.
data dataC;
set dataA;
set dataB;
run;
d.
data dataC;
merge dataA dataB;
by variable1;
run;

c

When the code below is run, what is the value of the variable TotalSales for the last observation?

data Sales;
input Month $ Jobcode $ Sales;
retain Totalsales 200;
Totalsales + Sales; datalines;
Jan EJK459 250 Feb EJK459 200 Mar EJK459 250 ;

a. 700
b. 200
c. 900
d. 1000
e. 450

a

What variables are in sandbox when it is run?

data sandbox(drop=Name Age);
set employees(keep=Name Age Weight Height Gender);
by Gender;
run;

a. Weight, Height, Gender
b. too little information to determine
c. None
d. Name, Age
e. Name, Age, Weight, Height, Gender

d

In the DATA step, how can you reference the temporary SAS data set named Employees
a. employees
b. HR.employees (after assigning the libref HR)
c. work.employees
d. a and c
e. none of the above

d

Which of the following statements correctly (without warnings) uses an array to create four numeric variables, called GPA1 GPA2 GPA3 GPA4 all with the initial value of 3.5?

a.
array GPA{5} (3.5 3.5 3.5 3.5 3.5);
b.
array GPA{5} GPA1 GPA2 GPA3 GPA4 (3.5 3.5 3.5 3.5);
c.
array GPA{4} $ GPA1-GPA4 (3.5 3.5 3.5 3.5);
d.
array GPA{4} GPA1-GPA4 (3.5 3.5 3.5 3.5);

a

How many observations are in playground after the data step is run?

data playground;
do x=0 to 9;
do y =0 to 9;
if x in(1,3,5,7,9) then do;
z=x*10+y;
output;
end;
end;
end;
run;

a. 50
b. Can not determine from the output.
c. 100
d. 0
e. 10
f. 1

a

The variable sales in the data set employees has a format of 8.3. The variable sales in the data set daily has a format of dollar6.2. The following program is submitted. Assume one of the values for name is 'John'.

data merged;
merge employees daily;
by name; /format sales comma5.2;/
run;

What is the format of the variable name in the merged data set?
a. None of the these.
b. 6.2
c. 8.3
d. comma5.2.
e. dollar6.2

d

What usually happens when a syntax error is detected?

a. SAS continues to process the step.
b. SAS continues to process the step, and the SAS log displays messages about the error.
c. SAS stops processing the step in which the error occurred, and the Output window displays messages about the error.
d. SAS stops processing the step in which the error occurred, and the SAS log displays messages about the error.

a

The YEARCUTOFF= system option is set to 1930. What are the range of dates it covers?

a. 1930-2029
b. 1930-2030
c. 1829-1930
d. 1931-2030

c

What does the following code produce? Assume gender, weight, and height are all categorical variables.

proc freq data=mydata;
tables genderweightheight;run;

a. Two tables, one for each gender, with height groups on one axis and weight groups on another. Frequency and percent are found in each cell of the table.
b. One interactive, three-dimensional table that allows you to click and discover the frequency, percent, row, column, and depth percents for each of the 3-D cells.
c. Two tables, one for each gender, with height groups on one axis and weight groups on another. Frequency, percent, row percent, and column percent are found in each cell of the tables.
d. A single table with gender, weight, and height variables along with variables for frequency, percent, cumulative frequencies, and cumulative percents.

d

Which of the following procedures will correctly display the label for the variable Coupon that is already permanently stored in the dataset?
a.
proc print data=bonds label; label Coupon='MyLabel'; run;
b.
proc print data=bonds; run;
c.
proc print data=bonds; label Coupon='MyLabel'; run;
d.
proc print data=bonds label; run;

c

What is the function of the FILENAME statement in SAS?
a. It associates a library reference with an external directory.
b. It associates a file reference with a relational database.
c. It associates a file reference with an external file.
d. It associates a library reference with a relational database.

a

Which of the following statements changes the first three letters of the variable Jobcode to 'MAN' if the variable JobDescription contains a word with the substring 'manage' (regardless of case) in it?
a.
if index(upcase(JobDescription),'MANAGE')>0 then substr(Jobcode,1,3)='MAN';
b.
if index(JobDescription,'MANAGE')>0 then substr(Jobcode,1,3)='MAN';
c.
if find(upcase(JobDescription),'MANAGE','t')=0 then substr(Jobcode,1,3)='MAN';
d.
if find(JobDescription,'MANAGE','i')>0 then substr(Jobcode,3,1)='MAN';

a

What is contained in the dataset Averages created by the following program?

proc means data=mydata mean max median;
var weight height armspan;
class gender;
output out=work.averages
mean= AvgWeight AvgHeight AvgArmspan
max= MaxWeight MaxHeight MaxArmspan
median= Minweight MinHeight MinArmspan;
run;

a. Three observations, _TYPE_ and _FREQ_ variables along with variables for mean, max, and median values for each variable listed in the var statement.
b. Thirty-six observations, one for each of the gender, weight, height, armspan combinations we created.
c. Eighteen observations, two variables, one for male and one for female, with the means, maxes, and medians of the various variables as observations.
d. Three observations, _TYPE_ and _FREQ_ variables along with mean, max, and minimum values for each variable in the var statement.

d

Which statement directs output to an HTML file?

a. the PRINTTO statement
b. the EXPORT statement
c. the HTML statement
d. the ODS HTML statement

a

Which informat could be use to read the date value 01MAR91?

a. date7.
b. mmddyy6.
c. date9.
d. weekdate6.

b

What does the NOOBS option do in the PROC PRINT step?
a. Relentlessly mocks you for being new to SAS.
b. Removes the default Obs column from the output
c. Prints only the the column titles with no data.
d. Prints the data with no column titles.

a

Consider the following code which generates a data set and creates a third variable utilizing the first two:

data Bonds;
input CouponRate $ ParValue $;
datalines;
8% $1000 9% $1200 7.8% $1500 5% $900 6% $750
;
data BondCoupons;
set Bonds;
Coupon= CouponRate/100 * ParValue;
run;
proc print data=bondcoupons;
run;

Considering the third line of the second code chunk above, which of the following statements ensures that the code runs properly, whether or not it ran properly with the code submitted above.
a.
Coupon=input(CouponRate,percent4.)*input(Parvalue,dollar5.);
b.
Coupon=input(CouponRate)*input(Parvalue);
c.
Coupon=CouponRate/100 * ParValue;
d.
Coupon=numeric(CouponRate,percent4.)*numeric(Parvalue,dollar5.);

b

The data step executes
a. once for each variable in the output data set
b. once for each observation in the input data set.
c. until it encounters an
OUTPUTstatement
d. continuously if you use the
POINT=option and the
STOPstatement.

a

Which of the following codes does NOT produce a dataset that contains the variable i which goes from 1 to 100, incrementing by one?

a.
data data3;
retain i 0;
do j=1 to 10;
do k=1 to 10;
i+1;
end;
end;
run;
b.
data data1;
do i=1 to 100;
output;
end;
run;
c.
data data4;
retain i 0;
do j=1 to 10;
do k=1 to 10;
i+1;
output;
end;
end;
run;
d.
data data2;
retain m 0;
do j=1 to 10;
do k=1 to 10;
m+2;
i=m/2;
output;
end;
end;
run;

b

With the following code present in my data step, if the value of the variable i is 32, which of the following values will j be?

if i < 32 then j=15;
else if i > 32 then j=16;
else j=20;
a. 15
b. 20
c. 16
d. . (missing)

a

Consider the following code which generates a data set and creates a third variable utilizing the first two:

data Bonds;
input CouponRate $ ParValue $;
datalines; 8% $1000 9% $1200 7.8% $1500 5% $900 6% $750 ;

data BondCoupons;
set Bonds; Coupon= CouponRate/100 * ParValue; run;
proc print data=bondcoupons;
run;

You may assume the first code chunk runs properly. When printing after running the second code chunk, which of the following will be the value of the first observation of the variable Coupon and why?

a. The variable coupon value will have missing values because SAS was not able to correctly interpret the character values as numeric values and an error resulted when creating the Coupon variable.
b. The coupon value will be 80 because SAS ran flawlessly without producing errors or special notes in the log.
c. The coupon value will be 80 because SAS automatically converts character values into numeric values before algebraic manipulation.
d. The proc print procedure will fail because the BondCoupons data set was not successfully created.

c

The SAS data set one is listed below.
x y z
1 A 27
1 A 33
1 B 45
2 A 52
2 B 69
3 B 70
3 A 82
3 C 91

The following program is submitted
data two;
set one;
by x;
if first.x then delete;
if last.x then delete;
run;
The data set two has how many observations?

a. 0
b. 8
c. 2
d. 1

Please allow access to your computer’s microphone to use Voice Recording.

Having trouble? Click here for help.

We can’t access your microphone!

Click the icon above to update your browser permissions above and try again

Example:

Reload the page to try again!

Reload

Press Cmd-0 to reset your zoom

Press Ctrl-0 to reset your zoom

It looks like your browser might be zoomed in or out. Your browser needs to be zoomed to a normal size to record audio.

Please upgrade Flash or install Chrome
to use Voice Recording.

For more help, see our troubleshooting page.

Your microphone is muted

For help fixing this issue, see this FAQ.

Star this term

You can study starred terms together

NEW! Voice Recording

Create Set