Identifying the Format of a SAS File


Setting the MSGLEVEL= System Option

In SAS 9 and later, you can set the MSGLEVEL= system option to specify that SAS inform you when CEDA is being used.

Set MSGLEVEL=1 to enable messages.

 options msglevel=i; 

If you try to process a "foreign" file, an informational message is displayed. An example follows :

 INFO: Data set HEALTH.GRADES.DATA is in a format 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 reduce performance. 
Note  

Additional resources are consumed each time you read a foreign file.

Using PROC CONTENTS to Identify a File's Format

You can use the CONTENTS procedure (or the CONTENTS statement in PROC DATASETS) to find out what format is used in a file.

For example,

 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 machine 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 machine 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.

Updating a Foreign File

You cannot update a foreign file. However, you can:

  • 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) machine (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 machine, 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 the topic in SAS Language Reference: Concepts that discusses when CEDA is supported.

A typical error message follows:

 ERROR: Updating not allowed for file TEST.CMVS because it is in a format native to another host, such as SOLARIS, HP_UX, RS_6000_AIX, MIPS_ABI. 



Moving and Accessing SAS 9.1 Files
Moving And Accessing SAS 9.1 Files
ISBN: 1590472306
EAN: 2147483647
Year: 2004
Pages: 109
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net