Sample 24828: Reading a SAS Data Set into Real Memory
If you open and read a SAS data set multiple times during a session, and have sufficient real memory available, you may want to consider transferring data from disk (or some other storage medium) to memory. By specifying a SASFILE statement, the necessary buffers are automatically allocated to store the data in memory. Once data is read into real memory, the file remains open to accommodate other requests against the data until another SASFILE statement closes the file, or the program or session ends. By specifying the SASFILE statement, the following example opens and reads the MOVIES data set transferring PG-rated movies from disk to memory.
SASFILE PATH.MOVIES OPEN;
DATA PG_MOVIES;
SET PATH.MOVIES(WHERE=(RATING=”PG”));
RUN;
SASFILE PATH.MOVIES CLOSE;
|

About the Author
If you would like more information or have any questions about this tip, please contact Kirk Lafler, Software Intelligence Corporation at KirkLafler@cs.com. Kirk's new book, Power SAS: A Survival Guide is published by Apress and provides SAS users with the largest and most comprehensive collection of SAS tips and techniques ever offered. Power SAS can be purchased on Amazon.com and BarnesandNoble.com.
This sample shows how to transfer SAS data from storage to memory.
| Type: | Sample |
| Topic: | SAS Reference ==> DATA Step Common Programming Tasks ==> Utilities Non SAS Authors ==> Kirk Paul Lafler
|
| Date Modified: | 2005-12-08 11:34:38 |
| Date Created: | 2004-10-14 07:43:36 |
Operating System and Release Information
| SAS System | Base SAS | Tru64 UNIX | n/a | n/a |
| Solaris | n/a | n/a |
| Linux | n/a | n/a |
| OpenVMS Alpha | n/a | n/a |
| HP-UX IPF | n/a | n/a |
| HP-UX | n/a | n/a |
| AIX | n/a | n/a |
| ABI+ for Intel Architecture | n/a | n/a |
| 64-bit Enabled Solaris | n/a | n/a |
| 64-bit Enabled HP-UX | n/a | n/a |
| 64-bit Enabled AIX | n/a | n/a |
| Windows | n/a | n/a |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | n/a | n/a |
| OpenVMS VAX | n/a | n/a |
| CMS | n/a | n/a |
| z/OS | n/a | n/a |