SYSTEM 2000 Statements and the QUEST Procedure

Using the QUEST Procedure

SYSTEM 2000 statements in PROC QUEST might be any valid SYSTEM 2000 statement that is available in the Self-Contained Facility, which includes the following:
  • CONTROL statements to save and restore databases, to assign passwords and authorities, to create and remove indexes, and so on,
  • DEFINE statements to define, change, and delete database components in the database definition
  • QUEST statements to access a database for retrieval and updates
  • REPORT statements to produce customized reports
For more information, see the Quick Reference Guide.
Note: When you submit SYSTEM 2000 statements in PROC QUEST, the statements are subject to SAS syntax rules. For example, you must end statements with a semicolon (;) instead of a colon (:), use '/*' and '*/' to delimit comments, and so on. SYSTEM 2000 statements that contain a character literal that is more than 200 characters in length are rejected. If you want to use a single quotation mark (') or double (closing) quotation marks (”) as the delimiter in a SYSTEM 2000 where-clause, you must use one of the techniques described below. Otherwise, quotation marks cause ambiguity between the SAS parser and the SYSTEM 2000 parser.
A quoted string is required if the SYSTEM 2000 where-clause condition contains any of the following:
  • a value that is specified in mixed case
  • a where-clause keyword, such as OR, AT, or AND, in the value. For example, PRINT ENTRY WHERE C303 CONTAINS 'INSTRUCTOR AT ACC';
  • a single quotation mark (') or double (closing) quotation marks (”) in the value
You might want to use quoted strings because you are accustomed to using them in other systems.
To use a single quotation mark (') or double (closing) quotation marks (”) around a value in a where-clause condition, you can use either of the following methods:
  • Create a short SYSTEM 2000 Command File that contains the following two statements, which make the where-clause delimiter a single quotation mark ('):
       DELIMITER IS ';
       COMMAND FILE IS INPUT;
Invoke this short Command File one time to change the delimiter; the second statement returns you to your usual way of entering statements in PROC QUEST. By running this short Command File at the beginning of a PROC QUEST session, you do not have to put every statement that contains a quoted string into a separate Command File.
Note: SYSTEM 2000 commands in a Command File must be specified in uppercase or a syntax error occurs.
  • If you do not want to create the short Command File, you can submit the following statements from the Program Editor:
       delimiter is '; '; 
       'x'; 
    You will receive messages from SYSTEM 2000 and a syntax error warning, but, after the 'X' statement finishes processing, you can safely use single quotation marks (' ') as the where-clause delimiter.
If a value contains a single quotation mark, change the delimiter to double quotation marks (” ”) by using one of the preceding methods.

ECHO ON and ECHO OFF Statements

SYSTEM 2000 messages are displayed in the Log window, along with SAS messages.
The ECHO ON statement specifies that echoes of SYSTEM 2000 statements appear in theOutput window in addition to the statement output. This is convenient for debugging or interpreting results.
The ECHO OFF statement specifies that echoes of SYSTEM 2000 statements do not appear in the Output window.
Note: If you use ECHO ON and the MCS statement, you get one echo of all the commands at the same time no matter how many individual commands were submitted in one MCS. Also, only 249 characters are echoed.

SYSTEM 2000 Strings and Functions

You probably need to modify existing SYSTEM 2000 strings and functions when you use PROC QUEST because
  • the statement terminator must be the semicolon (;), not the colon(:). Any colons embedded in the strings or functions do not work correctly. Therefore, a string or function with embedded statement terminators can be invoked from within or from outside PROC QUEST, but not both.
  • statements cannot start with the default SYSTEM 2000 separator, the asterisk (*). In SAS, an asterisk signifies the beginning of a comment.
  • statements cannot contain a percent sign (%) as a system separator. In SAS, a percent sign signifies the beginning of a macro statement.
To avoid problems with system separators, submit a SEPARATOR IS statement to change the separator. For example, the following statement changes a separator to a comma (,):
      separator is ,;