Functions and CALL Routines |
Closes a SAS data set.
-
data-set-id
-
is a numeric variable that specifies the
data set identifier that the OPEN function returns.
CLOSE returns zero if the operation was
successful, or returns a non-zero value if it was not successful. Close all
SAS data sets as soon as they are no longer needed by the application.
Note: All data sets opened within a DATA step are closed automatically
at the end of the DATA step. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
This example uses OPEN to open the SAS data set PAYROLL.
If the data set opens successfully, indicated by a positive value for the
variable PAYID, the example uses CLOSE to close the data set.
%let payid=%sysfunc(open(payroll,is));
macro statements
%if &payid > 0 %then
%let rc=%sysfunc(close(&payid));
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.