Moving and AccessingSAS 9.1 Files
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004.Moving and Accessing SAS 9.1 Files. Cary, NC: SAS Institute Inc.
Moving and Accessing SAS 9.1 FilesCopyright 2004, SAS Institute Inc., Cary, NC, USAISBN 1590472306All rights reserved. Produced in the United States of America. No part of this publicationmay be reproduced, stored in a retrieval system, or transmitted, in any form or by anymeans, electronic, mechanical, photocopying, or otherwise, without the prior writtenpermission of the publisher, SAS Institute Inc.U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of thissoftware and related documentation by the U.S. government is subject to the Agreementwith SAS Institute and the restrictions set forth in FAR 52.22719 Commercial ComputerSoftware-Restricted Rights (June 1987).SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513.1st printing, January 2004SAS Publishing provides a complete selection of books and electronic products to helpcustomers use SAS software to its fullest potential. For more information about oure-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web siteat support.sas.com/pubs or call 1-800-727-3228.SAS and all other SAS Institute Inc. product or service names are registered trademarksor trademarks of SAS Institute Inc. in the USA and other countries. indicates USAregistration.Other brand and product names are registered trademarks or trademarks of theirrespective companies.
Whats New viiOverview viiDetails vii
P A R T 1 Introduction 1Chapter 1 Moving and Accessing SAS Files between Operating Environments 3Deciding to Move a SAS File between Operating Environments 3Deciding to Access a SAS File across Operating Environments 3Strategies for Moving and Accessing SAS Files 4Summary of Strategy Features 5Moving and Accessing SAS Files in International Environments 7The Data Set Used for Examples 7Naming Conventions Used for Examples 8
P A R T 2 Strategies for Moving and Accessing SAS Files 9Chapter 2 Cross-Environment Data Access (CEDA) 11Overview of CEDA 11CEDA Advantages 12CEDA Limitations 12Changing SAS File Formats 13Transferring a SAS File between Machines 15Identifying the Format of a SAS File 15Reading and Writing a Foreign File 16
Chapter 3 PROC CPORT and PROC CIMPORT 17Overview of PROC CPORT and PROC CIMPORT 17PROC CPORT and PROC CIMPORT Advantage 18PROC CPORT and PROC CIMPORT Limitations 18Creating a Transport File at the Source Machine 18Transferring Transport Files to a Target Machine 20Restoring Transport Files at the Target Machine 20
Chapter 4 XPORT Engine with DATA Step or PROC COPY 25Overview of the XPORT Engine 25XPORT Engine Advantages 25XPORT Engine Limitations 26Regressing SAS Data Sets to SAS 6 Format 26Creating a Transport File at the Source Machine 27Transferring Transport Files across a Network 29Restoring Transport Files at the Target Machine 29
Chapter 5 XML Engine with DATA Step or PROC COPY 31Overview of the XML Engine 31XML Engine Advantages 31XML Engine Limitations 32Creating an XML Document at the Source Machine 32Transferring an XML Document across a Network 33Restoring an XML Document as a Data Set at a Target Machine 34
P A R T 3 Transferring Transport Files and Foreign Files 35Chapter 6 Transferring Files 37Overview of File Transfers 37Attributes for Transport Files 37Using the FILENAME Statement or the FTP Utility for Foreign Files and TransportFiles 38
P A R T 4 Operating Environment Specifics 43Chapter 7 OpenVMS Operating Environment 45Listing OpenVMS System File Attributes 45Specifying File Attributes for OpenVMS 46Identifying the SAS Version Used to Create a Member Under OpenVMS 46Mounting a Tape Device on OpenVMS 47OpenVMS Error Messages 47
Chapter 8 z/OS Operating Environment 51Listing z/OS File Attributes 51Identifying the SAS Version Used to Create a Member under z/OS 51Organizing z/OS Files with the SAS 8 and Later UNIX System Services Directory 52Using z/OS Batch Statements for File Transport 52Transferring a Transport File over the Network 52Reading Transport Files in z/OS Operating Environments 53
Chapter 9 UNIX Operating Environment 55Specifying File Attributes for UNIX 55Identifying the SAS Version Used to Create a Member under UNIX 55Creating a Transport File on Tape 56Copying the Transport File from Disk to Tape at the UNIX Source Machine 57Copying the Transport File from Tape to Disk at the Target Machine 57
Chapter 10 Windows Operating Environment 59Specifying File Attributes for Windows 59Identifying the SAS Version Used to Create a Member under Windows 59Error Message 60
Chapter 11 SAS Filename Extensions and File Headers 61
Using Filename Extensions to Identify Which SAS Engine and Operating EnvironmentWere Used to Create a SAS File 61Using PROC CONTENTS to Identify Which SAS Base Engine Was Used to Create aSAS File 62Using File Headers to Identify Which Strategy Was Used to Create a TransportFile 62
P A R T 5 Troubleshooting 65Chapter 12 Preventing and Fixing Problems 67Problems Transferring and Restoring Transport files 68Error and Warning Messages 71Verifying Transfer Format and Transport File Attributes 77Reblocking a Transport File 78
P A R T 6 Samples and Logs 81Chapter 13 Examples of Moving SAS Files 83The Examples of Moving SAS Files 84OpenVMS Alpha to UNIX File Transport 84z/OS to Windows File Transport 91z/OS JCL Batch to UNIX File Transport 96Strategies for Verifying Transport Files 104
P A R T 7 Appendix 107Appendix 1 Recommended Reading 109Recommended Reading 109
OverviewThe following strategies in Base SAS are available for moving and accessing SAS
files between operating environments that run different releases of SAS: Cross-Environment Data Access (CEDA) CPORT and CIMPORT procedures XPORT engine with the DATA step or the COPY procedure XML engine with the DATA step or the COPY procedure.
Note: This section describes the features that are new to the topic of moving SASfiles since SAS 8.2. Using SAS CONNECT and SAS/SHARE to move or access SAS filesare discussed in the SAS/CONNECT Users Guide and the SAS/SHARE UsersGuide.
Cross-Environment Data Access (CEDA)CEDA is a simple strategy for file access across a network. CEDA enables you to
read a network-mounted SAS file from any directory-based operating environment thatruns SAS 8 or later, regardless of the file format of the SAS file being accessed.
CEDA dynamically converts between the native formats of the source and targetoperating environments that run under different architectures (for example, UNIX andWindows). CEDA eliminates having to convert a file to transport format.
CPORT and CIMPORT ProceduresIn most cases, in order to move a SAS file between operating environments, you can
use the CPORT and CIMPORT procedures and FTP (File Transfer Protocol) to create atransport file at the source machine, transfer that file across the network, and restorethe transport file to native format at the target machine.
viii Whats New
CAUTION:Moving or accessing SAS files is not the same as migrating SAS files. Migration of SASfiles (data and applications) is not discussed in this documentation. For details aboutmigrating SAS files, see the Migration Community at support.sas.com/rnd/migration.
XPORT Engine with the DATA Step or the COPY ProcedureThe XPORT engine creates files in transport format that can be transferred across
operating environments, and directed to multiple target operating environments thatrun different releases of SAS. Transport files that are created by the XPORT engine canbe transferred across operating environments and read using the XPORT engine withthe DATA step or PROC COPY.
XML Engine with the DATA Step or the COPY ProcedureThe XML engine imports and exports XML documents. The XML format provides
increased cross-architectural compatibility by storing numeric values as character dataand by identifying the character encoding in a file header. XML files can be transferredacross operating environments and read using the XML engine with the DATA step orwith PROC COPY.
The XML engine was introduced in SAS 8.2 and is completely documented in theSAS 9.1 XML LIBNAME Engine Users Guide. Using the XML engine as a strategy formoving SAS files across operating environments is introduced in this documentation forSAS 9.1.
P A R T1
Chapter 1. . . . . . . . . .Moving and Accessing SAS Files between OperatingEnvironments 3
C H A P T E R
1Moving and Accessing SAS Filesbetween Operating Environments
Deciding to Move a SAS File between Operating Environments 3Deciding to Access a SAS File across Operating Environments 3Strategies for Moving and Accessing SAS Files 4Summary of Strategy Features 5Moving and Accessing SAS Files in International Environments 7The Data Set Used for Examples 7Naming Conventions Used for Examples 8
Deciding to Move a SAS File between Operating Environments
Moving SAS files between operating environments is a common work task. Reasonsfor moving a SAS file between operating environments include:
To move SAS files to a new operating environment on a different machine; forexample, HP-UX files to a RedHat Linux operating environment.
To move a file and its processing to a high-performance operating environmentthat will be returned to the requesting operating environment.
To make a static copy of a SAS file available to a physically separate operatingenvironment for continued data processing. Files are duplicated for use in thereceiving operating environment because the SAS files are not available to thereceiving operating environment by means of NFS-mounted file systems.
In all of these scenarios, the move operations recognize differences between machinearchitectures and SAS releases, allowing the original files to be used in the receivingoperating environment.
Deciding to Access a SAS File across Operating Environments
In some instances, accessing instead of owning and maintaining your own copy of afile might be preferable. Alternatively, you might need to read data from a locallymounted tape that was created elsewhere, or you might need to read, write, or updatedata that is remotely mounted on your network.
Note: Do not confuse the term access with the product SAS/ACCESS. In the contextof moving or accessing SAS files across operating environments, access means to reachand process SAS files. SAS/ACCESS enables users to use third-party DBMS files. For alist of products that SAS/ACCESS supports, see the list on page 6.
4 Strategies for Moving and Accessing SAS Files Chapter 1
You can use the following methods to access remote SAS files:
CEDA (Cross-Environment Data Access) enables you to process SAS 8 and laterSAS files.
use SAS/SHARE on your client to access a remote SAS file that resides on anoperating environment that a SAS/SHARE server runs under. SAS/SHAREfacilitates a transparent concurrent access to remote data among multiple users.Restrictions apply to cross-release access of SAS data.
In addition, SAS/SHARE enables you to access certain third-party DBMS filesby means of engines that are supported by SAS/ACCESS.
without the aid of SAS/SHARE or CEDA, you can rely upon network services foraccess to remote files (both SAS files and third-party DBMS files). Usually, theclient and the server must share a compatible architecture, and they must run thesame release of SAS software. The operating environment, the network software,and the security software might control users permissions to access specificremote files. For more information, see the SAS companion documentation that isappropriate to your operating environment, and see the third-party documentationfor the network software and security software that you use.
Strategies for Moving and Accessing SAS Files
Cross-Environment Data Access (CEDA)This feature of SAS enables a SAS file that was created in any directory-basedoperating environment (for example, Solaris, Windows, HP-UX, OpenVMS) to beprocessed by a SAS session that is running in another directory-basedenvironment.
CPORT and CIMPORT proceduresIn the source environment, you can use PROC CPORT to write data sets orcatalogs to transport format. In the target environment, PROC CIMPORT can beused to translate the transport file into the target environments native format.
XPORT engine with DATA step or PROC COPYIn the source environment, you can use the LIBNAME statement with the XPORTengine and either the DATA step or PROC COPY to create a transport file from aSAS data set. In the target environment, the same method can be used totranslate the transport file into the target environments native format.
Note: The XPORT engine does not support SAS 8 and later features, such aslong file and variable names.
XML engine with DATA step or PROC COPYIn the source environment, you can use the LIBNAME statement with the XMLengine and either the DATA step or PROC COPY to create an XML document froma SAS data set. In the target environment, the same method can be used totranslate the XML document into the target environments native format.
Data Transfer Services (DTS) in SAS/CONNECTThis feature enables you to transfer data sets and catalogs from the sourceenvironment to the target environment. DTS dynamically translates the databetween operating environment representations and SAS versions, as necessary.The transfer is accomplished using the SIGNON statement to connect two SASsessions and then the PROC UPLOAD or PROC DOWNLOAD to move the data.
Moving and Accessing SAS Files Summary of Strategy Features 5
REMOTE engine and Remote Library Services in SAS/SHARE and SAS/CONNECTThese features give you transparent access to remote data using the REMOTEengine and the LIBNAME statement.
Summary of Strategy Features
Table 1.1 Summary of Strategy Features for Moving or Accessing SAS Files
Strategies That Can Be UsedFeatures
Data File,PROC SQLviews*,SAS/ACCESSviews (OracleandSYBASE),MDDB*
Library, DataSet, Catalog,Catalog entry,PROC SQLview, MDDB,Externalthird-partydatabases***
Library, DataSet, Catalog**,Catalogentry**, PROCSQL view,MDDB, DATAStep view,
* Data set (files) can have read, write, and update access. PROC SQL views and MDDBs areread-only.
** SAS 9 does not support cross-operating environment access to catalog entries or catalogs inoperating environments that are incompatible. For information about architecture groups, seeSAS/CONNECT Users Guide or SAS/SHARE Users Guide.
***SAS/CONNECT supports external text files and binary files. SAS/CONNECT and SAS/SHAREsupport third-party external databases by means of the Remote SQL Pass-Through Facility, butyou must have a SAS/ACCESS license to access these databases...