SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Editing and Debugging SAS Programs
Resolving Common Problems


Unbalanced Quotes

Some syntax errors, such as the missing quotation mark after HIGH in the program below, cause SAS to misinterpret the statements in your program.

     data clinic.admitfee;
        set clinic.admit;
        where actlevel='HIGH;
     run;
     proc print data=clinic.admitfee;
        var id name actlevel fee;
     run;
When the program is submitted, the SAS System is unable to resolve the DATA step, and a "DATA STEP running" message appears at the top of the active window.

Program Editor Window


When unbalanced quotation marks appear in a program with TITLE or FOOTNOTE statements, there is sometimes a warning in the SAS log which indicates that
  • a quoted string has become too long
  • a statement with quotes (such as a TITLE or FOOTNOTE statement) is ambiguous due to invalid options or unquoted text.

SAS Log


CAUTION: When you have unbalanced quotation marks, the SAS System is often unable to find a statement to resolve the current step. Correcting the unbalanced quotation marks and resubmitting your program usually does not solve the problem. SAS still considers the quotes to be unbalanced.


Resolving the Problem

To resolve the error, submit a quote followed by a semicolon and a RUN statement.

     '; run;
Submitting the line of code above will resolve the error. However, the requested output may not appear. In this situation, it is almost always necessary to also
  1. select Run --> Recall Last Submit twice to recall the program
  2. delete the line containing the quotation mark followed by the semicolon and the RUN statement
  3. insert the missing quotation mark in the appropriate place
  4. submit the corrected program.

Hot Tip Submit the following line to resolve more complex occurrences of unbalanced quotes.
     *'; *"; run;

back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement