Chapter Contents

Previous

Next
SAS/ACCESS Interface to CA-DATACOM/DB: Reference

Printing Data

Printing CA-DATACOM/DB data described by a view descriptor is exactly like printing a SAS data file, as shown by the following example:

proc print data=vlib.empinfo;
   title2 'Brief Employee Information';
run;

VLIB.EMPINFO derives its data from the EMPLOYEES table. Results of the PRINT Procedure shows the first page of output for this example.

Results of the PRINT Procedure
                           Brief Employee Information                          1
                 OBS     EMPID    DEPT      LASTNAME

                   1    119012    CSR010    WOLF-PROVENZA
                   2    120591    SHP002    HAMMERSTEIN
                   3    123456              VARGAS
                   4    127845    ACC024    MEDER
                   5    129540    SHP002    CHOULAI
                   6    135673    ACC013    HEMESLY
                   7    212916    CSR010    WACHBERGER
                   8    216382    SHP013    PURINTON
                   9    234967    CSR004    SMITH
                  10    237642    SHP013    BATTERSBY
                  11    239185    ACC024    DOS REMEDIOS
                  12    254896    CSR011    TAYLOR-HUNYADI
                  13    321783    CSR011    GONZALES
                  14    328140    ACC043    MEDINA-SIDONIA
                  15    346917    SHP013    SHIEKELESLAM
                  16    356134    ACC013    DUNNETT
                  17    423286    ACC024    MIFUNE
                  18    456910    CSR010    ARDIS
                  19    456921    SHP002    KRAUSE
                  20    457232    ACC013    LOVELL
                  21    459287    SHP024    RODRIGUES
                  22    677890    CSR010    NISHIMATSU-LYNCH

When you use the PRINT procedure, you may want to use the OBS= option, which enables you to specify the last row to be processed. This is especially useful when the view descriptor describes large amounts of data or when you just want to see an example of the output. The following example uses the OBS= option to print the first five rows described by the view descriptor VLIB.CUSORDR:

proc print data=vlib.cusordr (obs=5);
   title 'First Five Data Records Described by VLIB.CUSORDR';
run;

VLIB.CUSORDR accesses data from the table ORDER. Results of Using the OBS= Option shows the result of this example.

Results of Using the OBS= Option
            First Five Data Records Described by VLIB.CUSORDR               1
                       OBS    STOCKNUM    SHIPTO

                         1      9870      19876078
                         2      1279      39045213
                         3      8934      18543489
                         4      3478      29834248
                         5      2567      19783482

In addition to the OBS= option, the FIRSTOBS= option also works with view descriptors, but the FIRSTOBS= option does not improve performance significantly because each record must still be read and its position calculated.

For more information on the PRINT procedure, see the SAS Procedures Guide. For more information on the OBS= and FIRSTOBS= options, see the SAS Language Reference: Dictionary.


Chapter Contents

Previous

Next

Top of Page

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