Browsing Data with the SELECT Statement

You can use the SELECT statement to browse ADABAS data that is described by a view descriptor. The query in the following example retrieves and displays specified data fields and logical records in the CUSTOMERS DDM that are described by the VLIB.USACUST view descriptor. The LINESIZE= system option is used to reset the default output width to 120 columns.
Note: The following SQL procedure examples assume that the CUSTOMERS DDM has not been updated by the earlier SAS/FSP examples.
options linesize=120;

proc sql;
   title 'ADABAS Data Output by a SELECT Statement';
   select custnum, state, name, limit,signatur
      from vlib.usacust;
The following output displays the query's results. Notice in the output that the SQL procedure displays the ADABAS data field names, not the corresponding SAS variable names.
Results of Browsing Data with a PROC SQL Query
                              ADABAS Data Output by a SELECT Statement                   
                   

 CUSTOMER  STATE  NAME                                                                      LIMIT SIGNATURE
------------------------------------------------------------------------------------------------------------------
 12345678  NC                                                                                0.00  

 14324742  CA     SANTA CLARA VALLEY TECHNOLOGY SPECIALISTS                               5000.00 BOB HENSON

 14324742  CA     SANTA CLARA VALLEY TECHNOLOGY SPECIALISTS                              25000.00 KAREN DRESSER

 14569877  NC     PRECISION PRODUCTS                                                      5000.00 JEAN CRANDALL

 14569877  NC     PRECISION PRODUCTS                                                    100000.00 STEVE BLUNTSEN

 14898029  MD     UNIVERSITY BIOMEDICAL MATERIALS                                        10000.00 MASON FOXWORTH

 14898029  MD     UNIVERSITY BIOMEDICAL MATERIALS                                        50000.00 DANIEL STEVENS

 14898029  MD     UNIVERSITY BIOMEDICAL MATERIALS                                       100000.00 ELIZABETH PATTON

 15432147  MI     GREAT LAKES LABORATORY EQUIPMENT MANUFACTURERS                         10000.00 JACK TREVANE

 18543489  TX     LONE STAR STATE RESEARCH SUPPLIERS                                     10000.00 NANCY WALSH

 18543489  TX     LONE STAR STATE RESEARCH SUPPLIERS                                     50000.00 TED WHISTLER

 18543489  TX     LONE STAR STATE RESEARCH SUPPLIERS                                    100000.00 EVAN MASSEY

 19783482  VA     TWENTY-FIRST CENTURY MATERIALS                                          5000.00 PETER THOMAS

 19783482  VA     TWENTY-FIRST CENTURY MATERIALS                                         10000.00 LOUIS PICKERING

 19876078  CA     SAN JOAQUIN SCIENTIFIC AND INDUSTRIAL SUPPLY, INC.                      7500.00 EDWARD LOWE

 19876078  CA     SAN JOAQUIN SCIENTIFIC AND INDUSTRIAL SUPPLY, INC.                     25000.00  E.F. JENSEN
You can specify a WHERE clause as part of the SELECT statement to retrieve a subset of the logical records for display. The following example displays the companies that are located in North Carolina:
title 'ADABAS Data Output by a WHERE Clause';
select custnum, state, name, limit, signatur
   from vlib.usacust
   where state='NC';
Notice that the PROC SQL statement is not repeated in this query. With the SQL procedure, you do not need to repeat the PROC SQL statement unless you use another SAS procedure, a DATA step, or a QUIT statement between PROC SQL statements. The following output displays the companies from North Carolina described by VLIB.USACUST.
Results of Browsing Data Subset by a WHERE Clause
                                ADABAS Data Output by a WHERE Clause                       
                

 CUSTOMER  STATE  NAME                                                                      LIMIT SIGNATURE

---------------------------------------------------------------------------------------------------------------
 12345678  NC                                                                                0.00

 14569877  NC     PRECISION PRODUCTS                                                      5000.00 JEAN CRANDALL

 14569877  NC     PRECISION PRODUCTS                                                    100000.00 STEVE BLUNTSEN