Chapter Contents |
Previous |
Next |
Data Set Model: _keyCount |
Syntax | |
Details | |
See Also |
Syntax |
CALL SEND (object-id, '_keyCount', rc, count); |
Argument | Type | Description | |
---|---|---|---|
rc |
N | returns whether the count was successful | |
0 | count was successful | ||
not 0 | otherwise | ||
count |
N | returns the number of rows in the data set that match the current index key that is specified with the _setKey method |
Details |
The _keyCount method returns the number of rows that meet the criteria specified by the index key column. The index key column is specified with the last _setKey method used on the table. After the _keyCount method executes, the table is positioned at the first row that meets the criteria defined by the last _setKey method. Use the _getRow or _fetchRow method to read the row.
The _keyCount method sets SYSRC for error, note, and warning conditions.
For all other conditions (GT, GE, LT, or LE) specified with _setKey
for a composite key, the composite key columns are concatenated together to
form the index key. The number returned by the _keyCount method is the number
of rows in the table that satisfy the composite key. For example, if the
composite index consists of columns SEX and AGE and the condition is GT (greater
than), the values to search for are concatenated such that key values of
F
for SEX and 13 for AGE yield an index key of
F13
.
Because the search is performed on the concatenated values, some values may
meet the search condition that you did not expect, such as SEX of
M
and AGE of 11, because the string
M11
is considered greater
than the string
F13
.
See Also |
_setKey.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.