Query and Reporting |
The Query and Reporting Query window is a menu-driven interface that enables you to query SAS or DB2 data. You can create queries that access one or more tables or views. It is not necessary to know your system's SQL syntax. In the Query window you can
create queries on one or more tables or views that you select
view, browse, and save the SQL statements that are automatically generated by the queries
create SAS tables, DB2 tables, tables from other DBMSs, or flat files from the queries' output
perform inner and outer (left, right, and full) joins that retrieve matching and non-matching rows from the contributing tables.
The Query window supports subsetting data, arithmetic expressions, and column functions, as well as group processing and ordering. Queries can contain an unlimited number of prompts. A prompt displays a window that asks users for values when the query is executed.
The output from queries can be saved as SAS tables (that is, SAS data files or data views), as DB2 tables, as tables in any other database for which you have SAS/ACCESS software licensed, or as external files. The generated SQL code can be browsed, and queries can be saved for editing in the SQL Editor window.
To select data for your queries, you use the Select window, which is accessed from the Query window. You select the tables, views, and columns that you use to create your queries. Then in the Query window, you can customize your queries further. The following figure illustrates this process.
The Query Process
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.