proc cport生成的两个文件(baseline.xpt文件和baseline.sas7bdat文件)放在data文件夹中。
sas语句如下(参照sas帮助得到的),
libname newdata 'C:\Users\Desktop\data\newdata';
filename trans3 'C:\Users\Desktop\data\baseline.xpt';
proc cimport data=newdata.baseline infile=trans3;
run;
但 filename语句后又一句:host-option(s)-for-file-characteristicsn,不知道什么意思,因此忽略了。
运行程序后,log中其它没问题,只有下面的warning,应该也没问题。顺便说一下,我用的sas9.4。
WARNING: The transport file is from an earlier SAS release. If this transport file contains non-English data, there might be
problems importing national characters. If problems do occur, the transport file will need to be imported again. If the
transport file was created by a Unicode SAS session, start a new SAS session, set the ENCODING startup option to UTF8,
and redo the import. Otherwise, set the LOCALE option to match the LOCALE of the SAS session which created the
transport file and redo the import.
但在newdata的转换后数据集不能打开。
log中显示:
ERROR: Format YNDK not found or couldn't be loaded for variable abc.
ERROR: Format YNDK not found or couldn't be loaded for variable bcd.
ERROR: Format YNDK not found or couldn't be loaded for variable cde.
ERROR: Format YNDK not found or couldn't be loaded for variable def,
……
请大家指点迷津,谢谢。