Displaying the Definition for a PROC SQL View

Overview

You can use a DESCRIBE VIEW statement to display a definition of a view in the SAS log.
General form, DESCRIBE VIEW statement:
DESCRIBE VIEW proc-sql-view-1<,...proc-sql-view-n>;
Here is an explanation of the syntax:
proc-sql-view
specifies a PROC SQL view and can be one of the following:
  • a one-level name
  • a two-level libref.view name
  • a physical pathname that is enclosed in single quotation marks.
Tip
If you use a PROC SQL view in a DESCRIBE VIEW statement that is based on or derived from another view, then you might want to use the FEEDBACK option in the PROC SQL statement. This option is displayed in the SAS log how the underlying view is defined and expands any expressions that are used in this view definition.

Example

The following PROC SQL step writes the view definition for Sasuser.Faview to the SAS log:
proc sql;
   describe view sasuser.faview;
Table 7.2 SAS Log
NOTE: SQL view SASUSER.FAVIEW is defined as:
      select lastname, firstname, gender,
             INT((TODAY()-dateofbirth)/365.25) as Age,
      SUBSTR(jobcode, 3, 1) as Level, salary
      from SASUSER.PAYROLLMASTER, SASUSER.STAFFMASTER
      where jobcode contains 'FA' and
            (staffmaster.empid=payrollmaster.empid);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.16.81