Chapter Contents


SAS/ACCESS Software for Relational Databases: Reference

Printing Data

The DATASETS procedure shows you the SAS variables and their attributes, but it does not display the data values. You can use the PRINT procedure to print all or some of the data values.

In this example, you use the PRINT procedure to print data that is described by the VLIB.CUSORDR view descriptor; VLIB.CUSORDR gets its data from the table SASDEMO.ORDERS.

Note:   The OBS= data set option limits the output to five observations.  [cautionend]

proc access dbms=db2;
/* create access descriptor    */ 
   create adlib.order.access;
   list all;

/* create vlib.cusordr view  */
   create vlib.cusordr.view;
   select ordernum stocknum shipto;
   rename ordernum ordnum;
   format ordernum 5.0
          stocknum 4.0;

/* example             */
proc print data=vlib.cusordr(obs=5);
title 'Five Observations Described by VLIB.CUSORDR';

Results of Using the OBS= Option shows the results of this example.

Results of Using the OBS= Option
         Five Observations Described by VLIB.CUSORDR


            1     11269        9870      19876078
            2     11270        1279      39045213
            3     11271        8934      18543489
            4     11272        3478      29834248
            5     11273        2567      19783482

In addition to the OBS= option, the SAS system option FIRSTOBS= also works with view descriptors. However, because of the way data is stored in a relational DBMS table, there is no true first observation, and the FIRSTOBS= option might not consistently retrieve the same observation. In addition, the FIRSTOBS= option might not improve performance significantly because each row might still be read and its position must be calculated.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.