Examples of Using CEDA

Example 1: Automatically Processing a 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-UX 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 file's UNIX data representation and translates it to the 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 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 Different Data Representation

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-UX UNIX environment. Specifying OUTREP=HP_UX_64 as a data set option forces the data representation to match the data representation of the UNIX operating environment that later processes the file. This method of creating the file can enhance system performance because the file does not require data conversion later when it is processed by an HP-UX UNIX computer.
libname mylib v9 'HFS-file-spec';

data mylib.a (outrep=HP_UX_64);
   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 (for example, with FTP), you must move it as a binary file.
libname target 'target-pathname' outrep=solaris_x86_64; 
libname source 'source-pathname'; 
proc copy in=source out=target noclone memtype=data; 
run;
For more information, see the OUTREP= option for the LIBNAME statement in SAS Statements: Reference or see the OUTREP= data set option in SAS Data Set Options: Reference.