To create a SAS data
set and compress the data set without creating an intermediate, uncompressed
data set, create a named pipe (such as
mypipe
) and enter the
compress
command:
mkfifo mypipe; compress <mypipe >sasds.Z
In your SAS session,
assign a libref to the pipe and begin writing to the data set:
libname x 'mypipe';
data x.a;
...more SAS statements...
output;
run;
The data is sent to
mypipe
and then compressed and written to the data
set. When SAS closes the data set, compression finishes, and you
have a compressed, sequential data set in
sasds.Z
.
If you begin writing
to a named pipe before the task on the other end (in this case, the
compress
command) begins reading, your SAS session
will be suspended until the task begins to read.