| SAS Component Language Dictionary |
| 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); |
is the table identifier that was assigned when the table was opened. If table-id is invalid, the program halts.
| Details |
![[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.
| Examples |
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.