100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
SAS BASE EXAM QUESTIONS AND ANSWERS $14.39   Add to cart

Exam (elaborations)

SAS BASE EXAM QUESTIONS AND ANSWERS

 4 views  0 purchase
  • Course
  • SAS
  • Institution
  • SAS

SAS BASE EXAM QUESTIONS AND ANSWERS

Preview 4 out of 67  pages

  • September 20, 2024
  • 67
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • SAS
  • SAS
avatar-seller
GEEKA
SAS BASE EXAM QUESTIONS AND ANSWERS

Which of the following statements is true when SAS encounters a syntax error in a
DATA step?

a. The SAS log contains an explanation of the error
b. The DATA step continues to execute and the resulting data set is complete
c. The DATA step stops executing at the point of the error and the resulting data set
contains observations up to that point
d. A note appears in the SAS log indicating that the incorrect statement was saved to a
SAS data set for further examination - Answers -A
When SAS encounters a syntax error, SAS writes an error message to the SAS log
explaining the error. SAS stops executing the code and no data set is created

Which one of the following is true when SAS encounters a data error in a DATA step?

a. The DATA step stops executing at the point of the error, and no SAS data set is
created
b. A note is written to the SAS log explaining the error, and the DATA step continues to
execute
C. A note appears in the SAS log that the incorrect data record was saved to a separate
SAS file for further examination
D. The DATA step stops executing at the point of the error, and the resulting DATA set
contains observations up to that point - Answers -B
When SAS encounters a data error, the system continues to execute the code. A
message is written to the SAS log. The field containing the data error is set as missing

Which one of the following statements is true when SAS encounters a data error?

a. The execution phase is stopped, and a system abend occurs
b. A missing value is assigned to the appropriate variable, and execution continues
c. The execution phase is stopped, and a SAS data set is created with zero
observations
d. A missing value is assigned to the appropriate variable, and execution stops at that
point - Answers -B
When SAS encounters a data error, the system continues to execute the code. A
message is written to the SAS log. The field containing the data error is set as missing

Which one of the following statements is true regarding the SAS automatic _ERROR_
variable?

a. The _ERROR_ variable contains the values 'ON' or 'OFF'
b. The _ERROR_ variable contains the values 'TRUE' or 'FALSE'
c. The _ERROR_ variable is automatically stored in the resulting SAS data set

,d. The _ERROR_ variable can be used in expressions or calculations in the DATA step
- Answers -D
The _ERROR_ variable contains either 1's or 0's. It is stored in the PDV but not the data
set. It can be used in SAS expressions or calculations

Which statement describes a characteristic of the SAS automatic variable _ERROR_?

a. The _ERROR_ variable maintains a count of the number of data errors in a DATA
step
b. The _ERROR_ variable is added to the program data vector and becomes part of the
data set being created
c. The _ERROR_ variable can be used in expressions in the DATA step
d. The _ERROR_ variable contains the number of the observations that caused the
data error - Answers -C
The _ERROR_ variable contains either 1's or 0's. It is stored in the PDV but not the data
set. It can be used in SAS expressions or calculations

What does it mean?
a. A compiler error, triggered by an invalid character for the variable Salary
b. An execution error, triggered by an invalid character for the variable Salary
c. the 1st of potentially many errors, this one occurring on the 4th observation
d. an error on the INPUT statement specification for reading the variable Salary -
Answers -B
The note shows an invalid data value being assigned to the SALARY variable. The
value assigned to the variable is 46#30. Assigning this value to a numeric variable
causes a data error. As a result, the Salary variable contains a missing value. The data
error happens during the execution phase. this is an execution error

The following program is submitted:
data test;
input animal1$ animal2$
mlgrams1 mlgrams2;
cards;
hummingbird ostrich 54000.39 90800000.87;
run;
Which one is the output?
a. animal1 animal2 mlgrams1 mlgrams2
hummingb ostrich 54000.39 90800000
b. animal1 animal2 mlgrams1 mlgrams2
hummingb ostrich 54000.39 90800000.87
c. animal1 animal2 mlgrams1 mlgrams2
hummingbird ostrich 54000.39 90800000
d. animal1 animal2 mlgrams1 mlgrams2
hummingbird ostrich 54000.39 90800000.87 - Answers -B

,Since no informat or length statement is used, the length of each variable is set to 8 by
default. Character values longer than 8 characters will get truncated. Numeric values
are not affected

Raw data:
---10---20---30
son, Travis
The following output is desired:
relation firstname
son Travis

Which one of the following SAS programs reads the data correctly?
a. data family/dm =',';
infile 'file-specification';
input relation$ firstname$;
run;
b. options dlm=',';
data family;
infile 'file-specification';
input relation$ firstname$;
run;
c. data family;
infile 'file-specification' dlm=',';
input relation$ firstname$;
run;
d. data family;
infile 'file-specification';
input relation$ firstname$/dlm=',';
run; - Answers -C
The DLM option should be specified in the INFILE statement

Raw data file is listed below:
---10---20---30
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
The following SAS program is submitted using the raw data file as input:
data work.homework;
infile 'file-specification';
input name$ age height;
if age LE 10;
run;

How many observations will the work.homework data set contain?
a. 0
b. 2

, c. 3
d. no data set is created as the program fails to execute due to errors - Answers -C
The first and last names in the external file are separated by a space. However, SAS
assumes a space to be the delimiter. The last name is actually assigned to the AGE
column. Since the AGE variable is a numeric variable, the character values assigned to
the AGE column are all set as missing. In SAS, a missing value is the smallest value in
the system. All of the records met the conditions (IF AGE LE 10).

The following SAS program is submitted and reads 100 records from a raw data file:
data work.total;
infile 'file-specification' end = eof;
input name$ salary;
totsal + salary;

run;

Which one of the following IF statements writes the last observation to the output data
set?
a. if end= 0;
b. if eof= 0;
c. if end= 1;
d. if eof= 1; - Answers -D
The END option creates a temporary variable EOF in the PDV. The EOF contains a
numeric value 1 when SAS reaches the last observation

1---+---10---+20---+----
son Frank 01/31/89
daughter June 12-25-87
brother Samuel 01/17/51
The following program is submitted using this file as input: data work.family;
infile 'file-specification';

run;
Which input statement correctly reads the values for the variable Birthdate as SAS date
values?

a. input relation$ first_name$ birthdate date9.;
b. input relation$ first_name$ birthdate mmddyy8.;
c. input relation$ first_name$ birthdate : date9.;
d. input relation$ first_name$ birthdate : mmddyy8.; - Answers -D
The informat of (mmddyy8.) matches the date format in the external file. A colon ( : ) is
needed to assign the informat to the variable in List Input

A raw data record is shown below: 07Jan2002
Which one of the following informats would read this value and store it as a SAS date
value?

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller GEEKA. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $14.39. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83637 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$14.39
  • (0)
  Add to cart