Chapter Contents |
Previous |
Next |
Moving and Accessing SAS Files across Operating Environments |
Here are the traditional types of move operations:
Transporting a File between Hosts |
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.
Copying a File between Hosts |
Deciding Whether to Convert the Copied File |
You must convert a Version 6 file to Version 8 format under these circumstances:
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.
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.
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.
Note: CMS and OS/390 hosts do not support filename
extensions.
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.
libname shipped v6 '/dept/612lib'; libname new v8 '/dept/701_lib'; proc copy in=shipped out=new; run;
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.
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.
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.
Converting a File on the Same Host |
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.
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 |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.