CUROBS Function

Returns the observation number of the current observation.

Category:SAS File I/O
Restriction:This function is not valid on the CAS server.

Syntax

CUROBS(data-set-id)

Required Argument

data-set-id

is a numeric value that specifies the data set identifier that the OPEN function returns.

Details

If the engine being used does not support observation numbers, the function returns a missing value.
With a SAS view, the function returns the relative observation number, that is, the number of the observation within the SAS view (as opposed to the number of the observation within any related SAS data set).

Example

This example uses the FETCHOBS function to fetch the 10th observation in the data set MYDATA. The value of OBSNUM returned by CUROBS is 10.
%let dsid=%sysfunc(open(mydata, i));
%let rc=%sysfunc(fetchobs(&dsid, 10));
%let obsnum=%sysfunc(curobs(&dsid));

See Also

Last updated: March 16, 2017