BookmarkSubscribeRSS Feed
ChrisT
Calcite | Level 5

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

4 REPLIES 4
art297
Opal | Level 21

I think the short answer would be both, but mostly in a temporary file.

ChrisT
Calcite | Level 5

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

Doc_Duke
Rhodochrosite | Level 12

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

Tom
Super User Tom
Super User

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. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 896 views
  • 0 likes
  • 4 in conversation