I have multiple .xpt files (v8) created using the loc2xpt macro which I need to convert to sas files using the xpt2loc macro. I am new to sas but I have managed to use the macro to convert a single file: %xpt2loc ( libref = work, memlist = _all_ , filespec = 'c:/myfile.xpt') However I cannot loop through a directory and select all the .xpt file names to use in the filespec. I have trying to adapt the code below which I have found on these boards but so far have been unsuccessful. %let path=C:\XPT Datasets;
filename xptfiles pipe "dir /b ""&path\%str(*).xpt"" " ;
filename code temp;
data files;
infile xptfiles truncover;
input filename $100. ;
file code;
put 'filename xptfile "&path\' filename +(-1) '" access=readonly;';
put 'proc copy inlib=xptfile outlib=sasfile; run;' ;
run; Any help would be appreciated.
... View more