🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 01-25-2022 03:16 PM
(2081 views)
How can we convert single xpt file to sas dataset? How can we convert group of xpt files to SAS datesets in a folder?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%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;
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I suggest you try the %XPT2LOC macro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the late reply. Thank you.