How can we convert single xpt file to sas dataset? How can we convert group of xpt files to SAS datesets in a folder?
%let path_in= D:\XiaKeShan\XPT ; /*XPT文件的路径*/ %let path_out= D:\XiaKeShan\SAS ; /*XPT文件转成SAS数据集的路径*/ libname out v9 "&path_out"; data _null_; rc=filename('x',"&path_in."); did=dopen('x'); do i=1 to dnum(did); memname=dread(did,i); call execute(cat("libname tranfile xport '&path_in\",memname,"';proc copy in=tranfile out=out ; run;")); end; run;
I suggest you try the %XPT2LOC macro.
Thank you.
%let path_in= D:\XiaKeShan\XPT ; /*XPT文件的路径*/ %let path_out= D:\XiaKeShan\SAS ; /*XPT文件转成SAS数据集的路径*/ libname out v9 "&path_out"; data _null_; rc=filename('x',"&path_in."); did=dopen('x'); do i=1 to dnum(did); memname=dread(did,i); call execute(cat("libname tranfile xport '&path_in\",memname,"';proc copy in=tranfile out=out ; run;")); end; run;
Sorry for the late reply. Thank you.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.