SAS Chapter 3 Editing And Debugging SAS Programs

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,992
| Attempts: 972 | Questions: 11
Please wait...
Question 1 / 11
0 %
0/100
Score 0/100
1. How can you tell whether you have specified an invalid option in a SAS program?

Explanation

When you submit a SAS statement that contains an invalid option, a log message notifies you that the option is not valid or not recognized. You should recall the program, remove or replace the invalid option, check your statement syntax as needed, and resubmit the corrected program.

Submit
Please wait...
About This Quiz
Debugging Quizzes & Trivia

This quiz evaluates skills in editing and debugging SAS programs, focusing on error correction, log evaluation, and syntax adherence. It prepares learners for effective SAS programming troubleshooting, enhancing their proficiency in managing real-world data tasks.

Personalize your quiz and earn a certificate with your name on it!
2. What generally happens when a syntax error is detected?

Explanation

Syntax errors generally cause SAS to stop processing the step in which the error occurred. When a program that contains an error is submitted, messages regarding the problem also appear in the Log window. When a syntax error is detected, the Log window displays the word ERROR, identifies the possible location of the error, and gives an explanation of the error.

Submit
3. Which of the following programs contains a syntax error?

Explanation

The DATA step contains a misspelled keyword (dat instead of data). However, this is such a common (and easily interpretable) error that SAS produces only a warning message, not an error.

Submit
4. As you write and edit SAS programs it's a good idea to

Explanation

Although you can write SAS statements in almost any format, a consistent layout enhances readability and enables you to understand the program's purpose.

Submit
5. A syntax error occurs when

Explanation

Syntax errors are common types of errors. Some SAS system options, features of the code editing window, and the DATA step debugger can help you identify syntax errors. Other types of errors include data errors (a), semantic errors (b), and execution-time errors.

Submit
6. Suppose you submit a short, simple DATA step.  If the active window displays message "DATA step running" for a long time, what probably happened?

Explanation

Without a RUN statement (or a following DATA or PROC step), the DATA step doesn't execute, so it continues to run. Unbalanced quotation marks can also cause the "DATA step running" message if relatively little code follows the unbalanced quotation mark. The other three problems above generate errors in the Log window.

Submit
7. Suppose you have submitted a SAS program that contains spelling errors.  Which set of steps should you perform, in the orders shown to revise and resubmit the program?

Explanation

To modify programs that contain errors, if you use the Program Editor window, you usually need to recall the submitted statements from the recall buffer to the Program Editor window, where you can correct the problems. After correcting the errors, you can resubmit the revised program. However, before doing so, it's idea to clear the messages from the Log window so that you don't confuse the old error messages with the new messages. Remember to check the Log window again to verify that you program ran correctly.

Submit
8. Match the five types of errors with their description.
Submit
9. What happens if you submit the following program? proc sort data=clinic.stress out=maxrates;      by maxhr; run; proc print data=maxrates label double noobs;      label rechr='Recovery Heart Rate;      var resthr maxhr rechr date;      where toler='I' and resthr>90;      sum fee; run;

Explanation

The missing quotation mark in the LABEL statement causes SAS to misinterpret the statements in the program. When you submit the program, SAS is unable to resolve the PROC step, and a "PROC PRINT running" message appears at the top of the active window.

Submit
10. What should you do after submitting the following program in the Windows or Unix operating environments? proc print data=mysales;      where state='NC; run;

Explanation

This program contains an unbalanced quotation mark. When you have an unbalanced quotation mark, SAS is often unable to detect the end of the statement in which it occurs. Simply adding a quotation mark and resubmitting your program does not solve the problem. SAS stills considers the quotation marks to be unbalanced. To correct the error, you need to resolve the unbalanced quotation mark before you recall, correct, and resubmit the program.

Submit
11. Which of the following commands opens a file in the code editing window?

Explanation

One way of opening a file in the code editing window is by using the INCLUDE command. Using INCLUDE command enables you to open a single program or combine stored programs in a single window. To save a SAS program, you can use the FILE command.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 10, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (11)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
How can you tell whether you have specified an invalid option in a SAS...
What generally happens when a syntax error is detected?
Which of the following programs contains a syntax error?
As you write and edit SAS programs it's a good idea to
A syntax error occurs when
Suppose you submit a short, simple DATA step.  If the active...
Suppose you have submitted a SAS program that contains spelling...
Match the five types of errors with their description.
What happens if you submit the following program?...
What should you do after submitting the following program in the...
Which of the following commands opens a file in the code editing...
Alert!

Advertisement