Saving Data in SAS System Files - SAS Programming

If you plan to run many analyses on a particular collection of data, make sure to save the data as a permanent SAS data set.This way you can avoid recreating it from raw data each time you do a run.

Example – INEFFICIENT

DATA TEMP;
INFILE ' input_file_spec';
INPUT . . .;
RUN;
PROC anyproc DATA=TEMP;
(SAS Statements)
RUN;
(at a future time)
DATA TEMP;
INFILE 'input_file_spec'; * SAME AS BEFORE ;
INPUT . . .;
RUN;
PROC anotherproc DATA=TEMP;
(SAS Statements)
RUN;

Here the SAS data set TEMP is created from the same set of raw data each time a new procedure is run. This DATA step creation work only needs to be done once.

Example– EFFICIENT

LIBNAME libref 'SAS_data_liJbrary';
DATA libref.PERMAN;
INFILE 'input_file_spec';
INPUT . . 7;
PROC anyproc DATA=libref.PERMAN;
(SAS statements)
RUN;
(At a future time)
PROC anotherproc DATA=libref.PERMAN;
(SAS Statements)
RUN;

Permanent SAS data sets and how to use a LIBNAME statement to create a libref are covered in, "SET, MERGE, and UPDATE," .


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAS Programming Topics