Accessing Sequential-Format Libraries in UNIX Environments

Benefits and Limitations of Sequential Engines

The sequential engines enable you to access libraries in sequential format on disk. The sequential engines do not support indexing and compression of observations.
Note: Before using sequential engines, read the information about sequential libraries in SAS Language Reference: Concepts.

Reading and Writing Sequential Files

Using a Staging Directory

If you have files on tape, use a staging directory so that files can be processed directly from disk. You can use the UNIX tar command to move SAS data sets between the staging directory and tape. (Do not use the UNIX cp command.)

Writing Sequential Data Sets to Named Pipes

Why Use Named Pipes?

You can send output to and read input from the operating environment by using named pipes. For example, you might want to compress a data set or send it to a sequential access management system without creating intermediate files.

Syntax of the LIBNAME Statement

You can read from and write to named pipes from within your SAS session by specifying the pipe name in the LIBNAME statement:
LIBNAME libref 'pipename';
Because you cannot position a pipe file, SAS uses a sequential engine to ensure sequential access. You do not have to specify the engine name.

Example: Creating a SAS Data Set Using a Named Pipe

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.