General form, SASFILE
statement:
SASFILE SAS-data-file <(password-option(s))> OPEN
| LOAD | CLOSE;
SAS-data-file
is a valid SAS data
file (a SAS data set with the member type DATA).
password-option(s)
specifies one or more
password options.
OPEN
opens the file and
allocates the buffers, but defers reading the data into memory until
a procedure or statement is executed.
LOAD
opens the file, allocates
the buffers, and reads the data into memory.
CLOSE
closes the file and
frees the buffers.
|
sasfile company.sales load; proc print data=company.sales; var Customer_Age_Group; run; proc tabulate data=company.sales; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; sasfile company.sales close;
Name of Data File
|
Number of Rows
|
Page Size
|
Number of Pages
|
Number of Bytes
|
---|---|---|---|---|
Retail.Small
|
45,876
|
24,576
|
540
|
13,279,232
|
Retail.Medium
|
458,765
|
24,576
|
5,398
|
132,669,440
|
Retail.Large
|
4,587,654
|
24,576
|
53,973
|
1,326,448,640
|
Small Data File without the SASFILE Statement
This program creates
reports using the PRINT, TABULATE, MEANS, and FREQ procedures. The
SAS data file Retail.Small is
opened and closed with each procedure.
proc print data=retail.small; where cs=100; var Customer_Age_Group; run; proc tabulate data=retail.small; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; proc means data=retail.small; var Customer_Age; class Customer_Group; output out=summary sum=; run; proc freq data=retail.small; tables Customer_Country; run; |
Medium Data File without the SASFILE Statement
This program creates
reports using the PRINT, TABULATE, MEANS, and FREQ procedures. The
SAS data file Retail.Medium is opened and closed with each procedure.
proc print data=retail.medium; where cm=100; var Customer_Age_Group; run; proc tabulate data=retail.medium; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; proc means data=retail.medium; var Customer_Age; class Customer_Group; output out=summary sum=; run; proc freq data=retail.medium; tables Customer_Country; run; |
Large Data File without the SASFILE Statement
This program creates
reports using the PRINT, TABULATE, MEANS, and FREQ procedures. The
SAS data file Retail.Large is opened and closed with each procedure.
proc print data=retail.large; where cl=100; var Customer_Age_Group; run; proc tabulate data=retail.large; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; proc means data=retail.large; var Customer_Age; class Customer_Group; output out=summary sum=; run; proc freq data=retail.large; tables Customer_Country; run; |
Small Data File with the SASFILE Statement
In this program, the
SASFILE LOAD statement opens the SAS data file Retail.Small and loads
the entire file into memory. The data is then available to the PRINT,
TABULATE, MEANS, and FREQ procedures. The SASFILE CLOSE statement
closes Retail.Small and frees the buffers.
sasfile retail.small load; proc print data=retail.small; where cs=100; var Customer_Age_Group; run; proc tabulate data=retail.small; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; proc means data=retail.small; var Customer_Age; class Customer_Group; output out=summary sum=; run; proc freq data=retail.small; tables Customer_Country; run; sasfile retail.small close; |
Medium Data File with the SASFILE Statement
In this program, the
SASFILE LOAD statement opens the SAS data file Retail.Medium and loads
the entire file into memory. The data is then available to the PRINT,
TABULATE, MEANS, and FREQ procedures. The SASFILE CLOSE statement
closes Retail.Medium and frees the buffers.
sasfile retail.medium load; proc print data=retail.medium; where cm=100; var Customer_Age_Group; run; proc tabulate data=retail.medium; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; proc means data=retail.medium; var Customer_Age; class Customer_Group; output out=summary sum=; run; proc freq data=retail.medium; tables Customer_Country; run; sasfile retail.medium close; |
Large Data File with the SASFILE Statement
In this program, the
SASFILE LOAD statement opens the SAS data file Retail.Large and loads
the entire file into memory. The data is then available to the PRINT,
TABULATE, MEANS, and FREQ procedures. The SASFILE CLOSE statement
closes Retail.Large and frees the buffers.
sasfile retail.large load; proc print data=retail.large; where cl=100; var Customer_Age_Group; run; proc tabulate data=retail.large; class Customer_Age_Group; var Customer_BirthDate; table Customer_Age_Group,Customer_BirthDate*(mean median); run; proc means data=retail.large; var Customer_Age; class Customer_Group; output out=summary sum=; run; proc freq data=retail.large; tables Customer_Country; run; sasfile retail.large close; |