标题: 求教:SAS中xpt文件是作什么用的 [打印本页] 作者: shiyiming 时间: 2008-10-28 22:06 标题: 求教:SAS中xpt文件是作什么用的 SAS中xpt文件是作什么用的,怎样运用,谁有相关的资料希望share一下
<!-- e --><a href="mailto:jbiostat@gmail.com">jbiostat@gmail.com</a><!-- e -->作者: shiyiming 时间: 2008-10-28 22:18 标题: transport files You can recreate the transport file using the XPORT engine on the libname statement and using proc copy code. The SAS System Viewer is only able to read XPORT Transport files. Sample code is:
libname xptfile XPORT 'c:\sasfile.xpt'; /* SASFILE.XPT will be created*/
proc copy in=work out=xptfile; /* replace WORK with your libname */
select dataset; /* replace DATASET with name of your SAS data set */
run;
This information is applicable to Transport files created with Version 7 SAS data sets and Version 6.12 SAS data sets. The SAS System Viewer will NOT be modified to read SAS CPORT Transport files.
For example, if you have a transport file called MyFile.xpt, and it resides on the SAS server in: c:\documents and settings, then code similar to the following can be used to convert MyFile.xpt into a SAS data file which can be opened in SAS Enterprise Guide.
/* Specify a libname with a path on the SAS server */
/* for which you have write access. */
libname sasout 'c:\documents and settings\SASDataFiles';
/* Specify a libname with the xport engine,
/* and a path on the SAS server where the .xpt file resides. */
libname xptin xport 'c:\documents and settings\MyFile.xpt';
proc copy in=xptin out=sasout;
run;
After the code is executed successfully, you can then use File => Open to open the newly created SAS data file.