Using SAS XPORT Files
SAS answered the problem of machines that store data differently by providing an XPORT engine that allows data sets to be moved across platforms. Data stored in XPORT format can be analyzed in SAS on any platform for which SAS is available. For example, if data were stored in SAS XPORT format on a mainframe, you could FTP the data to your PC and use PC-SAS to analyze them.
The obvious appeal of this file format led us to choose it for the RLMS data. The SAS XPORT format allows us to store the data on our host machine in a single format, without regard to the environment in which you, the user, operate.
If you are a SAS user and are unfamiliar with SAS XPORT files, then see below for some examples of SAS statements that process SAS XPORT files. As always, the best sources for more information are the SAS manuals themselves.
If you are not a SAS user, you will find that many other applications, such as SPSS or JMP (for Apple computers), can read SAS XPORT files. Consult the documentation for your particular software for details. You may also find the
SAS Viewer useful.
When declaring an XPORT library reference, the libname statement actually points to a file within which there is a single member: the XPORT data set. It is necessary to know the member name of the data set since it may differ from the name of the file that is referenced in the library reference. All member names below are alpha, but in the data you will copy via FTP, the member name coincides with the file name. Although the name coincides, it must still be repeated in the data step portion of your program.
CMS Example
/**Converts SAS XPORT format to CMS format--XPORT member name is ALPHA**/
/**File name is HOUSHOLD SAS, and it is stored on A. **/
CMS FI RLMS HOUSHOLD SAS A;
LIBNAME RLMS XPORT;
DATA TEMP;
SET RLMS.ALPHA;
RUN;
MVS Example
//*JCL STATEMENTS
// EXEC SAS
//HHOLD DD DSN=RLMS.HOUSHOLD.XPORT,DISP=OLD
LIBNAME HHOLD XPORT;
DATA ONE;
SET HHOLD.ALPHA;
RUN;
Unix Example
/**Notice that the entire filename is specified in the libname statement**/
/**unlike a normal filename, in which only the path is specified **/
libname hhold xport '/your/file/system/data/rlmshoushold.xport';
data one;
set hhold.alpha;
run;
WINDOWS Example
libname hhold xport 'c:\webdata\rlms\r1hhold.xpt';
data one;
set hhold.alpha;
run;
Unknown Member Name
If you don't know the member name, you can get it from proc contents by asking for all members in the xport file:
libname hhold xport 'c:\webdata\rlms\r1hhold.xpt';
proc contents data=hhold._all_;
run;