Chapter Contents

Previous

Next
SAS Component Language: Reference

Changing the Sequence of Reading Records

To start reading a file from its beginning, you can move the "read" pointer to the first record in a file. Then, the next FGET or FPUT function manipulates the first record. To return the "read" pointer to the file's first record, use the FREWIND function.

In addition to reading records sequentially, you can generally designate records for later reading, or you can re-read a file's first record. However, some file types do not support this feature.

When a record is in the FDB, you can mark it so that the "read" pointer can read it later. For example, because there are no search functions for files, you may want to mark a found record so you can use it again. To designate a record for later reading, perform these steps:

  1. Use FNOTE to mark the record that is in the FDB for later reading.

  2. Use FPOINT to return the "read" pointer to the marked record when you are ready to read it.

  3. Use FREAD to read the record marked by the "read" pointer.

  4. After you are finished using the marked record, use DROPNOTE to delete the note marker and to free the memory that was allocated to store the note.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.