Finding the FOREIGNers in your SAS environment

3

As Shane reveals on his blog, your SAS session is equipped to read data that are encoded for all types of machine architectures and locales. ASCII, EBCDIC, 32- or 64-bit, English, Japanese, Greek, Hebrew: the list goes on and on. SAS accomplishes this by using a feature called Cross-Environment Data Access (CEDA). You don't have to do anything special to enable this, but you know it's working when you see a note like this in your SAS log:
NOTE: Data file TEST.HMEQ.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.
First, some background about data set encoding and how it works within SAS.

All SAS data set files have an encoding that controls how the data are laid out and accessed within the file structure. The encoding varies based on platform architecture (32 vs. 64 bits, for example, or ASCII vs. EBCDIC) and locale-based data representation (latin1 for Western languages, shift-jis for Japanese as examples).

Your SAS session also has an encoding value which determines the default representation that data sets are expected to use. This is controlled in part by the -ENCODING system option and in part by the CPU architecture (32- or 64-bit) of your SAS version.

SAS data files that match your session encoding are considered NATIVE, while data files that are encoded differently are considered FOREIGN. CEDA kicks in when you access a FOREIGN encoding. Because CEDA has some limitations, you might want to consider modifying data sources that you use often into a native encoding.

If you want to see which data sources in a SAS library are considered "foreign", you can run this program. (The library in this example is named TEST.)

%let Library = TEST ;
proc sql;
  title "Encoding of Data Sets in &Library";
  select memname, datarep, datarepname, encoding     
  from sashelp.vtable where
       libname="&Library"
      and memtype = 'DATA';
quit;
title;

Here is an example of the output running on SAS for Windows (32-bit):

Report of data encodings, 32-bit
Here is the output for the same data when run on a 64-bit version of SAS:
Report of foreign data encodings, 64-bit
Notice how the 32-bit data representations are now recognized as "foreign" on the 64-bit session? You can still use the data for analysis and reporting, but it will run through CEDA.

Share

About Author

Chris Hemedinger

Senior Manager, SAS Online Communities

+Chris Hemedinger is the manager of SAS Online Communities. Since 1993, Chris has worked for SAS as an author, a software developer, an R&D manager and a consultant. Inexplicably, Chris is still coasting on the limited fame he earned as an author of SAS For Dummies.  He also hosts the SAS Tech Talk webcasts each year from SAS Global Forum, connecting viewers with smart people from SAS R&D and the impressive work that they do.

Related Posts

3 Comments

  1. Hello Chris,

    I have been working with SAS for many years but have not seen the error I have been seeing lately - it is driving me nuts. Whenever I run a simple SQL or Data step, I get the following warning:

    NOTE: Data file XXX.XXXX.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.

    which is fine but then the error:

    processing (data step or other) has been abnormally terminated.

    I have done a lot of research regarding this - compatibility issue but have not been able to find a solution. Even the code that you suggest I run does not produce any output (of course I changed the name of the library). Similarly, other codes suggested by other troubleshooters seem to run but don't produce anything.

    I am using SAS 9.2 TS Level 2M3, W32_VSPRO platform. Windows version 6.1.7600 Intel core2 duo T9550

  2. Pingback: The top gotchas when moving to 64-bit SAS for Windows - The SAS Dummy

  3. Pingback: Assign a SAS library to a different path depending on your OS - The SAS Dummy

Leave A Reply

Back to Top