@cstopp, check out...
By @ChrisHemedinger
SAS manages the memory for you, so it's similar to Java or .NET in that way. But there isn't a garbage collection mechanism per se. SAS programs consist of a series of "steps" -- the DATA step and PROC steps (for SAS procedures). For the most part, memory is allocated as needed during the running step, then released when the step is complete.
Some SAS procedures can use a lot of memory during the course of their work, and you can run out of memory when working with large data or data sets with large cardinality. For example, PROC FREQ can compute n-way frequencies quickly, but if the variables you're analyzing have lots of distinct values, you can bump into memory limits. When this happens, SAS will issue an ERROR message to the SAS log indicating that there wasn't enough memory to complete the operation.
The SAS DATA step also offers some constructs that are inherently memory-dependent. The most popular is thehash object, which allows you to load lots of data values into memory and manipulate them quickly. It's good for building fast data management algorithms, as long as the data values can fit into memory.
Finally, when we talk about memory management in SAS, we also have to address the WORK area: the temporary scratch space on disk where SAS can write files as intermediate results while SAS procedures run. In practice, most SAS programs that deal with large data sets will run into WORK space limitation before they hit memory constraints. On administered SAS environments, it's important to ensure that SAS programs have access to enough WORK space (ideally with fast I/O performance) to accomplish their work.
For more admin-friendly tips, see this series of blog posts from my colleague Margaret Crevar.
Check out this How does memory management work in SAS?
... View more