Hi,
I have a question regarding the memory usage of the DATA step. In a sample program like:
DATA weight;
input ID $ Week1 Week16;
WeightLoss=Week1-Week16;
datalines;
2477 195 163
2431 220 198
2456 173 155
2412 135 116
;
run;
Where SAS stores the dataset "weight" while this step is running? Does it store it in RAM or in a temporary file in the filesystem? What if much more data is being read in this step?
Thanks,
Chris
I think the short answer would be both, but mostly in a temporary file.
Thanks art297.
Is there a way to prevent SAS from doing that and instead instruct it to just keep the dataset in RAM?
This way we avoid the I/O involved in writing temporary data out to the disk.
Chris
Not really. The data is stored in the WORK directory. WORK is part of a file system in whatever OS you are using. You might be able to store it in RAM if you created a virtual disk by using some of your RAM for that. You could also create the data set as a VIEW; however, it would then do the I/O processing each time you went to use it.
In general, the advantage of SAS is that it can work with arbitrarily large data. The flip side is that it is an I/O hog sometimes.
Doc Muhlbaier
Duke
Why? If you want to do everything in RAM try using PROC IML.
Once you have a dataset you can use the SASFILE command to load it into RAM, but I cannot think of anyway to do it while creating the file.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.