Chapter Contents


Moving and Accessing SAS Files across Operating Environments

Traditional Move Operations

Here are the traditional types of move operations:

Transporting a File between Hosts

The process of moving a file between incompatible hosts is known as transporting; for example, from CMS to Windows. Such a process is necessary in order to account for binary incompatibilities between different host architectures.

Because compatible hosts share a common internal architecture, you do not need to transport SAS files between them. Instead, you just copy the file from one host to the other.

Do not unnecessarily transport a file between hosts. The possibility for loss of numeric precision increases each time a file is translated to or from transport format. Therefore, perform the transport operation only when moving a file between incompatible hosts.  [cautionend]

The process of moving a file between incompatible hosts, where the SAS releases are different, is known as converting; for example, between CMS running at Release 6.12 and Windows running at Version 8. The file is automatically converted to the more recent release as it is transported. In this instance, you do not perform an explicit conversion operation.

Note:   The direction of a SAS file release conversion (from an earlier to a later release or from a later to an earlier release) is restricted by the particular transport method used. For more information, see Traditional Methods for Creating and Restoring Files in Transport Format.  [cautionend]

Copying a File between Hosts

In order to move a file between compatible hosts (such as HP-UX and Solaris) that run the same or different SAS release, you use the appropriate communications software commands to copy the file over the network to the target host. No transporting or converting is performed. In order to access the file, at the target host, you use the LIBNAME statement to assign the location (such as the directory) of the transferred file.

Deciding Whether to Convert the Copied File

If the SAS release that the target host runs (for example, Version 8) and the format of the file that was copied to the target host (for example, Version 6) are different, then you must decide whether you want to convert the copied file to the release that is running on the target host.

You must convert a Version 6 file to Version 8 format under these circumstances:

However, if you do not plan to use Version 8 features, you can still read, write, and update Version 6 files from a Version 8 session.

An advantage of not converting is that you do not have to copy the file to a Version 8 library. If only Version 6 files reside in a library, you can access the files by using the LIBNAME statement. SAS automatically invokes the appropriate engine to allow file access.

A disadvantage of accessing Version 6 files from a Version 8 session is that mixed libraries can result. Although Version 6 files and Version 8 files can exist in the same library for most hosts, their management can be difficult.

Note:    The OS/390 host does not support mixing Version 6 and Version 8 files in the same library.  [cautionend]
For example, global operations that you intentionally apply to an entire library are, in fact, restricted to either the Version 6 files or the Version 8 files in the library, but not to both.

Note:    To find out the contents of a library, use PROC DATASETS. For details about PROC DATASETS, see SAS Procedures Guide. To see the filename extensions of files in a directory which forms a library, use the file list command for your operating system.  [cautionend]

In order to create Version 8, Version 7, or Version 6 files, you must specify the appropriate engine option in the LIBNAME statement. To subsequently access the file, you may optionally specify the appropriate engine option. Here are examples:

LIBNAME grades v6 'SAS-data-library;
LIBNAME grades v8 'SAS-data-library;
LIBNAME grades 'SAS-data-library;

On supported hosts, the specified engine locates the appropriate files according to the filename extension. For example, a Version 6 engine on a Windows host locates Version 6 data sets whose filename extension is .sd2. A Version 8 engine on a Windows host locates Version 8 data sets whose filename extension is .sas7bdat.

Note:   Version 7 and Version 8 filename extensions are identical.  [cautionend]

Note:   CMS and OS/390 hosts do not support filename extensions.  [cautionend]

If you omit an engine option from a statement that is executed in a Version 8 SAS session, SAS automatically invokes the engine that is appropriate to the files in the library. For example, if all files are appended with a Version 8 filename extension, the V8 engine is invoked. Likewise, if only files that have a Version 6 filename extension are present, the V6 engine is invoked. However, if a mix of files inhabit the library, then the native engine for the SAS session being run is used. For example, a Version 8 session invokes the V8 engine to access only Version 8 files, ignoring Version 6 files.

For a list of Version 8 and Version 6 filename extensions, see SAS Filename Extensions and File Headers.

Converting a Version 6 File to Version 8 Format

Use the COPY procedure to convert a Version 6 file to a Version 8 format. This action converts the SAS file to the newest release without transporting its internal representation. Here is a UNIX example:

libname shipped v6 '/dept/612lib';
libname new v8 '/dept/701_lib';
proc copy in=shipped out=new;

The LIBNAME statements include the appropriate engines that define the format of the files in either Version 6 or Version 8 format. PROC COPY copies the SAS files in the Version library that is identified in the IN= option to a Version 8 library that is identified in the OUT= option.

Accessing a Version 6 File in a Version 8 Mixed Library

If you do not want to convert a Version 6 file to Version 8 format, you have no more steps to perform. To access the Version 6 file on a Version 8 host, you specify the LIBNAME statement with the V6 engine. Here is a UNIX example:

libname shipped V6 '/dept/801_lib';

Note:   If you access Version 6 files in a Version 8 environment, you cannot use features that are specific to Version 8.  [cautionend]

Note:   Omission of the V6 engine in this LIBNAME statement would cause the V8 engine, which is the base engine, to be used. The V8 engine would locate only Version 8 files.  [cautionend]

Converting a File on the Same Host

In order to convert (or upgrade) a file from an earlier release to a later release on a single host, then you explicitly convert the file. For example, you use the COPY procedure to upgrade your SAS system files from Release 6.12 to Version 8 format.

Instructions for performing this operation are not given here because this book addresses operations between hosts that may be optionally attached to a network. This conversion operation is confined to a single host. See SAS Language Reference: Concepts for complete information.

Summary of Traditional Move Operations

Actions Required for Traditional SAS File Move Operations gives a summary of the traditional move scenarios and associated operations to be performed.

Actions Required for Traditional SAS File Move Operations
Between Compatible Hosts? Between Different SAS Releases? Example Operation Performed
no yes UNIX 6.12 to CMS 8 Transport with Implicit Convert
no no UNIX 8 to CMS 8 Transport
yes yes HP-UX 6.12 to AIX 8 Convert¹
yes no HP-UX 7 to AIX 8² Copy
yes yes HP-UX 6.12 to HP-UX 8 (same host) Convert³

¹ If you do not convert Version 6 files to Version 8 format, you may access Version 6 files in a Version 6 or Version 8 environment. However, you are limited to using features of Version 6.
² Version 7 and Version 8 file formats are identical.
³ See SAS Language Reference: Concepts for details about this operation. This book addresses all other cases.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.