SAS Base Certification Practice Questions and Answers, Exams of Nursing

A set of practice questions and answers for the sas base certification exam. It covers various topics related to sas programming, including data manipulation, syntax, procedures, and output delivery system (ods). The questions are designed to test the understanding of fundamental sas concepts and their application in solving real-world problems. This resource is valuable for students and professionals preparing for the sas base certification exam, offering a practical way to assess their knowledge and improve their skills in sas programming. Questions on topics such as data set selection, proc sort, proc print, variable names, syntax errors, yearcutoff option, proc print options, excel file access, proc format, data step compilation, infile statement, proc means, ods statements, proc report, and proc freq.

Typology: Exams

2024/2025

Available from 12/01/2025

whitegiraffe69485
whitegiraffe69485 ๐Ÿ‡ฌ๐Ÿ‡ง

6.3K documents

1 / 42

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SAS Base Certification questions with
correct answers
c - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a

Partial preview of the text

Download SAS Base Certification Practice Questions and Answers and more Exams Nursing in PDF only on Docsity!

SAS Base Certification questions with

correct answers

c - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” Which of the following is a valid variable name? a. Units b. 2Cool c. Total$ d. Days-To-Ship d - correct answer โœ”โœ” 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;

d. 16 c - correct answer โœ”โœ” Which time span is used to interpret two-digit values if the YEARCUTOFF= option is set to 1969? a. 1969- b. 1969- c. 1969- d. 1870- e. 1970- b - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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.

b - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” The default statistics created using PROC MEANS i. n-count ii. mean iii. median iv. min v. max vi. standard deviation vii. range viii. Q ix. Q x. P xi. P 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

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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” What output does the following code produce?

d - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” What variables are in sandbox when it is 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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.

a. grandtotal= b. grandtotal=- c. grandtotal= d. - b - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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 - correct answer โœ”โœ” 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= e. x=10 y=10 z= d - correct answer โœ”โœ” Which is false regarding arrays?