Data Set Options for Relational Databases SCHEMA= Data Set Option 211
run;
SCHEMA= Data Set Option
Enables you to read a data source, such as a DBMS table and view, in the specified schema
Valid in: DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
software)
DBMS support:
DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server,
SYBASE, Teradata
Default value:
LIBNAME setting
Syntax
SCHEMA=schema-name
Syntax Description
schema-name
is the name assigned to a logical classification of objects in a relational database.
Details
For this option to work, you must have appropriate privileges to the schema that is
specified.
The values for SCHEMA= are usually case sensitive, so be careful when you specify
this option.
Oracle Details: If PRESERVE_TAB_NAMES= NO, SAS converts the SCHEMA=
value to uppercase because all values in the Oracle data dictionary are converted to
uppercase unless quoted.
Teradata Details: If you omit this option, a libref points to your default Teradata
database, which often has the same name as your user name. You can use this option to
point to a different database. This option enables you to view or modify a different
user’s DBMS tables or views if you have the required Teradata privileges. (For
example, to read another user’s tables, you must have the Teradata privilege SELECT
for that user’s tables.) The Teradata interface alias for SCHEMA= is DATABASE=. For
more information about changing the default database, see the DATABASE statement
in your Teradata documentation.
Examples
In the following example, SCHEMA= causes MYDB.TEMP_EMPS to be interpreted
by DB2 as SCOTT.TEMP_EMPS.
proc print data=mydb.temp_emps
schema=SCOTT;
run;
In the following example, SAS sends any reference to Employees as Scott.Employees.