REWIND Function


Positions the data set pointer at the beginning of a SAS data set

Category: SAS File I/O

Syntax

REWIND ( data-set-id )

Arguments

data-set-id

  • specifies the data set identifier that the OPEN function returns.

  • Restriction: The data set cannot be opened in IS mode.

Details

REWIND returns 0 if the operation was successful, ‰  0 if it was not successful. After a call to REWIND, a call to FETCH reads the first observation in the data set.

If there is an active WHERE clause, REWIND moves the data set pointer to the first observation that satisfies the WHERE condition.

Examples

This example calls FETCHOBS to fetch the tenth observation in the data set MYDATA, then calls REWIND to return to the first observation and fetch the first observation.

 %let dsid=%sysfunc(open(mydata,i));  %let rc=%sysfunc(fetchobs(&dsid,10));  %let rc=%sysfunc(rewind(&dsid));  %let rc=%sysfunc(fetch(&dsid)); 

See Also

Functions:

  • 'FETCH Function' on page 523

  • 'FETCHOBS Function' on page 524

  • 'FREWIND Function' on page 559

  • 'NOTE Function' on page 671

  • 'OPEN Function' on page 690

  • 'POINT Function' on page 715




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net