Previous Page | Next Page

Processing Data Using Cross-Environment Data Access (CEDA)

Examples of Using CEDA


Example 1: Automatically Processing a Foreign File

This example shows how simple it is to move a SAS data set from one operating environment to another and to process the file in the new environment without any conversion steps.

First, the SAS data set is moved, using FTP, from an HP UNIX environment to a Windows PC.

C:\>ftp my.unix.node.com
FTP>binary
FTP>get unxdata.sas7bdat
FTP>quit

Then, using CEDA, SAS automatically recognizes the foreign data representation (which is HP UNIX) and translates it to the native data representation for the Windows environment. The log output displays a message that the file is being processed using CEDA.

libname unx '.';

proc print data=unx.unxdata;
run;

Log Output from Processing a Foreign File

Note: Data file HEALTH.GRADES.DATA is in a format that is native to another     
host, or the file encoding does not match the session encoding. Cross           
Environment Data Access will be used, which might require additional CPU        
resources and might reduce performance.

Example 2: Creating a New File in a Foreign Environment

In this example, an administrator who works in a z/OS operating environment wants to create a SAS file in a UNIX file system directory that can be processed in an HP UNIX environment. Specifying OUTREP=HP_UX_32 as a data set option forces the data representation to match the data representation of the UNIX operating environment that will process the file. This method of creating the file can enhance system performance because the file does not require data conversion when being read by an HP UNIX computer.

libname foreign v9 'HFS-file-spec';

data foreign.a (outrep=HP_UX_32);
   infile file-specifications; 
   input student $ test1 test2 test3 final;    
   total = test1+test2+test3+final;    
   grade = total/4.0; 
run;


Example 3: Changing the Data Representation of an Existing File

To change an existing file's data representation, you can use PROC COPY with the NOCLONE option and specify OUTREP= in the LIBNAME statement. The following example copies a source library of Windows data sets to a target library of Solaris data sets. Note that if you move a data set to another platform, you must move it as a binary file.

libname target '~pathname-to- target-library' outrep=solaris; 
libname source '~pathname-to- source-library'; 
proc copy in=source out=target noclone memtype=data; 
run;

For more information, see the OUTREP= option for the LIBNAME statement or the OUTREP= data set option in SAS Language Reference: Dictionary.

Previous Page | Next Page | Top of Page