Previous Page | Next Page

SAS Component Language Dictionary

CLOSE



Closes a SAS table
Category: SAS Table

Syntax
Details
Example
See Also

Syntax

sysrc=CLOSE(table-id);


sysrc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

table-id

is the identifier that was assigned when the table was opened. A table-id value of -999 closes all tables that were opened with OPEN. If table-id is invalid, the program halts.

Type: Numeric


Details

Close all SAS tables as soon as they are no longer needed by an application. You do not need to open and close a SAS table in each program of an application. If an application contains several programs that use the same table, the first program can open the table and can use the parameter passing mechanism with the DISPLAY routine or method calls to make the table identifier value available to other programs.


Example

Use OPEN to open a SAS table. If the table opens successfully, as indicated by a positive value for the PAYID variable, then use CLOSE to close the PAYROLL table.

payid=open('payroll','u');
   ...SCL statements...
if (payid>0) then payid=close(payid);


See Also

OPEN

Previous Page | Next Page | Top of Page