SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Quiz: Editing and Debugging SAS Programs

Select the best answer for each question and click Score My Quiz.

  1. In the Program Editor window, you can include

     a.   any SAS program in your operating environment
     b.   only a SAS program that you have assigned a file shortcut
     c.   any kind of SAS file
     d.   only a file with the extension .sas

  2. Suppose you submit a short, simple DATA step. If the active window displays the 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 you specified.

  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 tolerance='I' and resthr>90;
            sum fee;
         run;

     a.   log messages indicate that the program ran successfully
     b.   a "PROC SORT running" message appears at the top of the active window, and a log message may indicate an error on a statement that looks valid
     c.   a log message indicates that an option is invalid 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 type of error does the following program contain?
         proc tabulate data=maxrates;
            class tolerance;
            var resthr maxhr rechr date
            table tolerance, minhr maxhr rechr;
            table tolerance*timeminutes;
         run;             

     a.   execution-time
     b.   syntax
     c.   semantic
     d.   data

  5. Suppose you submit the DATA step below. Then you submit the PROC step. To edit the DATA step, what should you do?
         data sasuser.mynewdata;
            merge data1 data2 data3;
            by id;
         run;
    
         proc print data=mysales;
            var date salesrep total commission;
         run;            

     a.   Recall the submitted statements once. Edit the DATA step and resubmit both steps.
     b.   Recall the submitted statements twice. Edit the DATA step and resubmit both steps.
     c.   Recall the submitted statements twice. Delete the PROC step, edit the DATA step, and resubmit the DATA step.
     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 on a statement that looks valid
     b.   a log message indicates that an option is invalid 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. Which of the following programs contains a syntax error?

     a.   proc sort data=sasuser.mysales;
       by region;
    run;
     b.   dat sasuser.mysales;
       set mydata.sales1999;
    run;
     c.   proc print data=sasuser.mysales label;
       label region='Sales Region';
    run;
     d.   none of the above

  8. What should you do about the mistake in the following program?
         proc print data=mysales;
            where state='NC;
         run;

     a.   Submit a RUN statement to complete the PROC step.
     b.   Add a semicolon and resubmit the corrected program.
     c.   Submit a quotation mark followed by a semicolon and a RUN statement.
     d.   Remove or replace the invalid option and resubmit the corrected program.

  9. To insert lines in a SAS program, you can use

     a.   text editor commands
     b.   block text editor commands
     c.   the recall buffer
     d.   all of the above

  10. Which type of error occurs when the form of the elements in a SAS statement is correct, but the elements are not valid for that usage?

     a.   execution-time
     b.   syntax
     c.   macro related
     d.   semantic



back||next

Terms of Use & Legal Information | Privacy Statement