SAS Component Language Dictionary |
Returns the number of the current row in a SAS table
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
- CAUTION:
- This function should be used only
with an uncompressed SAS table that is accessed using a native library engine.
![[cautionend]](../../../../common/64368/HTML/default/images/cautend.gif)
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.
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);
In an FSEDIT SCL program, retrieve the number of the
row that is currently displayed:
rownum=curobs();
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.