Previous Page | Next Page

SAS Component Language Dictionary

CUROBS



Returns the number of the current row in a SAS table
Category: SAS Table

Syntax
Details
Examples
Example 1: Getting the Row Number of a Control
Example 2: Getting the Current Row Number

Syntax

row-number=CUROBS(table-id);

row-number

is the current row number.

Type: Numeric

table-id

is the table identifier that was assigned when the table was opened. If table-id is invalid, the program halts.

Type: Numeric


Details

CAUTION:
This function should be used only with an uncompressed SAS table that is accessed using a native library engine.   [cautionend]

If the engine that is being used does not support row numbers, the function returns a missing value.

In FSEDIT and FSVIEW applications, specifying a value for table-id is optional. If the argument is not specified, CUROBS returns the value for the SAS table displayed by FSEDIT or FSVIEW. For a SAS table view, the function returns the relative row number. Also, on engines that do not support absolute row numbers, such as ORACLE, CUROBS returns the relative row number.


Examples


Example 1: Getting the Row Number of a Control

Use FETCHOBS to fetch the tenth row in the SAS table MYDATA. CUROBS returns a value of 10 for row-number.

tableid=open('mydata','i');
rc=fetchobs(tableid,10);
rownum=curobs(tableid);


Example 2: Getting the Current Row Number

In an FSEDIT SCL program, retrieve the number of the row that is currently displayed:

rownum=curobs();

Previous Page | Next Page | Top of Page