SAS Chapter 3 Editing And Debugging SAS Programs

11 Questions

Settings
SAS Quizzes & Trivia

Practice preparing for the basic SAS certification exam


Questions and Answers
  • 1. 
    As you write and edit SAS programs it's a good idea to
    • A. 

      Begin DATA and PROC steps in column one.

    • B. 

      Indent statements within a step.

    • C. 

      Begin RUN statements in column one

    • D. 

      Do all of the above.

  • 2. 
    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?
    • A. 

      Correct the errors. Clear the Log window. Resubmit the program. Check the Log window.

    • B. 

      Correct the errors. Resubmit the program. Check the output window Check the Log window.

    • C. 

      Correct the errors. Clear the Log window. Resubmit the program. Check the Output window.

    • D. 

      Correct the errors. Clear the Output window. Resubmit the program. Check the output window.

  • 3. 
    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;
    • A. 

      Log messages indicate that the programs ran successfully.

    • B. 

      A "PROC SORT running" message appears a the top of the active window, and a log message may indicate an error in a statement that seems to be valid.

    • C. 

      A log message indicates that an option is not valid or not recognized.

    • D. 

      A "PROC PRINT running" message appears at the top of the active window, and a log message may indicate that a quoted string has become too long or that the statement is ambiguous.

  • 4. 
    What generally happens when a syntax error is detected?
    • A. 

      SAS continues processing the step.

    • B. 

      SAS continues to process the step, and the Log window displays messages about the displays messages about the error.

    • C. 

      SAS stops processing the step in which the error occurred, and the Log window displays messages about the error.

    • D. 

      SAS stops processing the step in which the error occurred and the Output window displays messages about the error.

  • 5. 
    A syntax error occurs when
    • A. 

      Some data values are not appropriate fore the SAS statements that are specified in a program.

    • B. 

      The form of the elements in a SAS statement is correct, but the elements are not valid for that usage.

    • C. 

      Program statements that do not conform to the rules of the SAS language.

    • D. 

      None of the above

  • 6. 
    How can you tell whether you have specified an invalid option in a SAS program?
    • A. 

      A log message indicates an error in a statement that seems to be valid.

    • B. 

      A log message that indicates that an option is not valid or not recognized.

    • C. 

      The message "PROC running" or "DATA step running" appears at the top of the active window.

    • D. 

      You can't tell until you view the output from the program.

  • 7. 
    • A. 

      Proc sort data=sasuser.mysales;      by region; run;

    • B. 

      Dat sasuser.mysales;      set mydata.sales99; run;

    • C. 

      Proc print data=sasuser.mysales label;      label region='Sales Region'; run;

    • D. 

      None of the above

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

      Submit a RUN statement to complete the PROC step.

    • B. 

      Recall the program. Then add a quotation mark and resubmit the corrected program.

    • C. 

      Cancel the submitted statements. Then recall the program, add a quotation mark, and resubmit the corrected program.

    • D. 

      Recall the program. Then replace the invalid option and resubmit the corrected program.

  • 9. 
    Which of the following commands opens a file in the code editing window?
    • A. 

      File 'd:\programs\sas\newprog.sas'

    • B. 

      Include 'd:\programs\sas\newprog.sas'

    • C. 

      Open 'd:\programs\sas\newprog.sas'

    • D. 

      All of the above

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

      You misspelled a keyword.

    • B. 

      You forgot to end the DATA step with a RUN statement.

    • C. 

      You specified an invalid data set option.

    • D. 

      Some data values weren't appropriate for the SAS statements that you specified.

  • 11. 
    Match the five types of errors with their description.
    • A. syntax
    • A.
    • B. semantic
    • B.
    • C. execution-time
    • C.
    • D. data
    • D.
    • E. macro-related
    • E.