Identifying the Format of a SAS File

Example: Reporting That CEDA Is Being Used

In SAS 9 and later, SAS writes a message to the log when CEDA is used. Here is an example:
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. 
Note: Additional resources are consumed each time you read a foreign file.

Example: Identifying a File's Format Using PROC CONTENTS

You can use the CONTENTS procedure (or the CONTENTS statement in PROC DATASETS) to find out the format of the specified SAS file.
Here is an example of the code:
proc contents data=grades;
run;
An excerpt of the output follows:
Data Representation  HP_UX_64, RS_6000_AIX_64, SOLARIS_64, HP_IA64
In the preceding example, the output shows that the file is represented in UNIX format.
If the target computer uses a format that is the same as the file format, then you can read, write, and update the file.
Note: No additional resources are consumed.
If the target computer uses a format that is different from the file format (in this example, UNIX), you can read and write, but you cannot update the files.
Note: Additional resources are consumed each time you read a foreign file.

Restrictions on Accessing a Foreign File

You cannot update a foreign file. However, you can do the following:
  • read the file.
    Note: Additional resources are consumed each time you read a foreign file.
  • change the file's foreign format (for example, UNIX) to the format of the native (accessing) computer (for example, Windows). Changing from a foreign to a native format allows you full access (read, write, and update) to the file without any intermediate translation.
    Note: After you change the file's format, no additional resources are consumed when you access the file.
If you try to update a SAS file that has a format that is foreign to the accessing computer, an error message is displayed.
Note: The type of access that CEDA is permitted depends on the engine used and the type of file access requested (read, write, update). For more information about file access limitations, see SAS File Processing with CEDA in SAS Language Reference: Concepts.
A typical error message follows:
ERROR: File TEST.CMVS cannot be updated because its 
encoding does not match the session encoding or the file is in a 
format native to another host, such as SOLARIS, HP_UX, RS_6000_AIX, 
MIPS_ABI.