You can create an
SQL view that contains the syntax of your query. For this example,
you use a view to create an outer join query.
In the
SQL
QUERY TABLES window, select
SAMPLE.EMPINFO and
SAMPLE.SALARY from the Available Tables
list and add them to the Selected Tables list. Select
OK.
In the
SQL
QUERY COLUMNS window, select
NAME, the two
ADDRESS items,
Identification
Number,
Employee number,
Salary,
BEGDATE, and
ENDDATE and add them to the Selected Columns list.
Select
ViewWhere Conditions for Subset to display the
WHERE EXPRESSION window.
Select
EMPINFO.Identification
Number from the Available Columns list. Select
EQ from the list of operators. Select
Salary.Identification
Number from the Available Columns list. Select
OK.
This WHERE expression
creates an inner join of EMPINFO and Salary based on Identification
Number. To save the query as a view, select
ToolsShow Query to display the
SQL QUERY window. Select
Create View.
Select the right arrow
next to the
Library field to display a list
of SAS libraries.
The list of libraries
displayed at your site might be different from the ones in the illustration.
Select
SAMPLE from the Libraries list. Select
OK.
Type
MYVIEW
in the
View field. Select
OK to return to the
SQL QUERY window. Select
Goback to return to the
SQL QUERY COLUMNS window.