Chapter Contents

Previous

Next
SAS Component Language: Reference

Opening SAS Tables

To open a SAS table, use the OPEN function. Opening a SAS table provides the gateway through which an SCL program and a SAS table can interact. This process does not actually access the information in a SAS table, but it makes the table available for the program's use. To access the data in the SAS table, the program must perform "read" operations on the table. When you open a SAS table, the following actions take place:

The identifier number identifies the table to the application, and you pass it to other SCL functions that manipulate the SAS table. Because this number is unique for each table that is currently open, it is useful for tracking multiple SAS tables that are open at the same time.

Note:   If for some reason a SAS table cannot be opened, the OPEN function returns a value of 0 for the table identifier. Therefore, to determine whether a SAS table has been opened successfully, you should test the value of the return code for the OPEN function in your SCL program. Doing this ensures that you don't cause a program to halt by passing a 0 to another function that uses that SAS table identifier. To determine why the table could not be opened, use the SYSMSG function to retrieve the message that is associated with the return code.  [cautionend]


Number of Open SAS Tables Allowed

An application can have a maximum of 999 SAS tables open simultaneously. However, your operating system may impose other limits. For details, see the documentation provided by the vendor for your operating system.

Although SCL permits you to have a large number of tables open simultaneously, be aware that memory is allocated for each SAS table from the time the SAS table is opened until it is closed. Therefore, try to minimize the number of tables that are open at the same time, and close them as soon as a program finishes with them for that session.


Chapter Contents

Previous

Next

Top of Page

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