Chapter Contents

Previous

Next
SAS/AF Software: Class Dictionary

Overview

The Data Set Data Vector class is used for communication between the Data Set Data Model class and the Data Set Model class. It is also used by the Data Table and Data Form classes.

Most users of the Data Table and Data Form classes need not be concerned with the Data Set Data Vector class. In these classes, the Data Set Data Vector class is used internally. The Data Set Data Vector class is useful to users who want to do either of the following:

The following output shows the relationship between the elements of a table (or SAS data set) and the methods of the Data Set Data Vector class.

CONTENTS Procedure Output
                               The SAS System

                             CONTENTS PROCEDURE

Data Set Name: SASUSER.CLASS                        Observations:         19
Member Type:   DATA                                 Variables:            5      
Engine:        V611                                 Indexes:              0
Created:       16:32 Friday, February 28, 1992      Observation Length:   33
Last Modified: 11:05 Thursday, May 25, 1995         Deleted Observations: 0
Protection:                                         Compressed:           NO
Data Set Type:                                      Sorted:               NO
Label:         Student information

                -----Engine/Host Dependent Information-----

                     Data Set Page Size:       4096
                     Number of Data Set Pages: 1
                     File Format:              607
                     First Data Page:          1
                     Max Obs per Page:         123
                     Obs in First Data Page:   19
                     FILETYPE:                 REGULAR

                             CONTENTS PROCEDURE

            -----Alphabetic List of Variables and Attributes-----
                                                             
   #   Variable   Type   Len   Pos   Format   Informat   Label
   ----------------------------------------------------------------------
   3   AGE        Num      8     9   BEST8.   F8.        Age in years
   4   HEIGHT     Num      8    17   BEST8.   F8.        Height in inches
   1   NAME       Char     8     0   $8.      $8.        First name
   2   SEX        Char     1     8   $1.      $1.        Gender
   5   WEIGHT     Num      8    25   BEST8.   F8.        Weight in pounds

#
the number of columns (variables) in the data set. this value is passed to the _setnumberofcolumns method and is returned by the _getnumberofcolumns method.

Variable
the column name. Use the _setName method to set the name and _getName to retrieve the name of a column.

Type
the column type. Use the _getType method to retrieve the type of a column.

Pos
index of the column in the data set. Pass this value as a column number.

Format
the column format. Use the _setFormat method to set the format and _getFormat to retrieve the format of a column.

Informat
the column informat. Use the _setInformat method to set the informat and _getInformat to retrieve the informat of a column.

Label
the column label. Use the _setLabel method to set the label and _getLabel to retrieve the label of a column.

When you use the Data Set Data Model class, the class automatically creates an instance of the Data Set Data Vector class, which it uses to communicate with the Data Set Model class.

The Data Set Data Vector class enables you to read data from a data set (using the _getRow method of the Data Set Model class) and write data to a data set (using the _setRow method of the Data Set Model class). The Data Set Data

Vector class also enables you to access the column information passed between the Data Set Data Model and Data Set Model classes.

In order to use an instance of the Data Set Data Vector class, you must first call the _setNumberOfColumns method. This method, in turn, calls the _describeColumns method on the specified instance of the Data Set Data Model class or the Data Set Model class. The _describeColumns method initializes the Data Set Data Vector class instance with the format, informat, label, name, and type for the columns in a row.

If you are using the Data Set Data Vector class to read from a data set, pass the Data Set Data Vector class instance to the _getRow method of the Data Set Model class. Upon returning from this method call, you can use the _getText and _getValue methods (depending on the data type of the column) to retrieve the values from the row that was read.

If you are using the Data Set Data Vector class to write to a data set, use the _setText and _setValue methods to set the values you want to write to the data set in the Data Set Data Vector class instance. Once you have set the column values to be written to the data set, pass the Data Set Data Vector class instance to the _setRow method of the Data Set Model class.

If you are creating your own subclass of the Data Set Model class, you may use the _setFormat, _setInformat, _setLabel, _setName, _setText, and _setValue methods to override the column attributes set by the superclass. If you are creating your own subclass of the Data Set Data Model class, you may use the _getFormat, _getInformat, _getLabel, _getName, _getText, _getType, and _getValue methods to retrieve column attributes set by the Data Set Model class.

Parent:
SASHELP.FSP.OBJECT.CLASS

Class:
SASHELP.FSP.DSDVEC.CLASS


Chapter Contents

Previous

Next

Top of Page

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