27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CACHE<br />

CACHE.<br />

Although the virtual active file can vastly reduce the amount of temporary disk space<br />

required, the absence of a temporary copy of the "active" file means that the original data<br />

source has to be re-read for each procedure. For data tables read from a database source this<br />

means the SQL query that reads the information from the database must be re-executed for<br />

any command or procedure that needs to read the data. Since virtually all statistical analysis<br />

procedures and charting procedures need to read the data, the SQL query is re-executed for<br />

each procedure you run, which can result in a significant increase in processing time if you<br />

run a large number of procedures.<br />

If you have sufficient disk space on the computer performing the analysis (either your local<br />

computer or a remote server), you can eliminate multiple SQL queries and improve<br />

processing time by creating a data cache of the active file with the CACHE command. The<br />

CACHE command tells SPSS to copy all the data to a temporary disk file the next time the<br />

data are passed to run a procedure. If you want the cache written immediately, use the<br />

EXECUTE command after the CACHE command.<br />

• The only specification is the command name CACHE.<br />

• A cache file will not be written during a procedure which uses temporary variables.<br />

• A cache file will not be written if the data are already in a temporary disk file and that<br />

file has not been modified since it was written.<br />

Example<br />

CACHE.<br />

TEMPORARY.<br />

RECODE alcohol(0 thru .04 = ’sober’) (.04 thru .08 = ’tipsy’)<br />

(else = ’drunk’) into state.<br />

FREQUENCIES var=state.<br />

GRAPH...<br />

No cache file will be written during the FREQUENCIES procedure. It will be written during<br />

the GRAPH procedure.<br />

170

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!