Site Map Online Directory
  Search Information Technology   Northwestern University  
YOU ARE HERE >   NUIT > SSCC > Bulletins > SAS PIPES
SAS PIPES

About the SSCC

Cluster Report (NU Restricted)

HOWTOs

Bulletins

Statistical Software

Statistical Software Manuals

Additional Resources

Migration Information

Social Science Data Services

Kellogg Research Computing

Depot File Service

Improving Social Science Research Computing (PDF)

Contact List

Services

Get Connected

Support

Educational Resources

NUIT

SAS PIPES


Reading compressed files with the SAS PIPE feature


ABSTRACT

The SAS PIPE feature can be used to read compressed raw data files on the fly, without decompressing them in a separate step before running SAS.


DESCRIPTION

The unix ``gzip'' command commonly achieves compression ratios of 80% for raw data files (see ``man gzip''). These compressed files (.gz files) can easily be read by SAS using its PIPE feature.

As an example, suppose you compress a raw data file named ``labor'':

   gzip -v labor
The resulting compressed file will be named ``labor.gz''. You can uncompress it with the ``gunzip'' command:
   gunzip labor.gz
The resulting *uncompressed* file will be named ``labor''.

You can also view the file without uncompressing it to another file with the combination of two commands, piping the results of the first command into the second:

   gunzip -c labor.gz | more
The ``gunzip'' command uncompresses the file ``labor.gz'' putting its results to standard output, which is piped via the operator ``|'' as standard input to the ``more'' command.

The SAS PIPE feature works in the same way, piping the results (i.e. standard output) of a program to the SAS I/O system. To read the compressed ``labor.gz'' file, use the following SAS FILENAME statement:

   FILENAME labor PIPE 'gunzip -c labor.gz';
With this statement, SAS will use gunzip to decompress the file directly, without having to create an intermediate (uncompressed) disk file. Try it!


For further information

See the ``SAS Companion for the UNIX Environment and Derivatives'' in the section ``Reading from and Writing to UNIX Commands'' on page 119 of the Version 6 First Edition.

And see the man page for gzip, gunzip and gzcat, `man gzip'.

Computer and Network Security

E-mail, NetID, and Password

Hardware

Listserv

Network Services

NUTV and TV Services

Policies and Guidelines

Reserve a Facility

Service Status

Software

Telephone Services

Videoconferencing Services

Web Publishing Services

Webcasting

Webmail

Off-campus Connections

Safe access to the NU Network (VPN)

Wired Connection

Wireless access

Departmental Desktop and Server Support

NUIT Help

Student Support

Computer Labs

Course Management System (Blackboard)

Learning Opportunities

Smart Classrooms

about NUIT

Job Opportunities in NUIT

News, Press, and Publications

What's New & Changing with Technology @ NU?