Hello, I am trying to import 79 different SAS datasets and export them as .dta files. Part of the issue I am having is that the .sas7bdat file names are not valid SAS dataset names--they contain only numeric characters. I tried to write code that would at least import one dataset and save it out as a .dta and then create a loop to go through the rest of the SAS datasets, but I cannot even get past the first step. %let folder = C:\Example folder; proc printto log="&folder.\SAS files\Logs\01 Convert SAS files to dta.log" new;
run;
libname sasinput "&folder.\Natives";
options validvarname=any;
proc export data=sasinput.01095552 outfile= "&folder.\SAS files\Output\01095552.dta" REPLACE;
run;
proc printto;
run; It seems from researching that I need to specify the system option validvarname=any but it does not appear that I am specifying it correctly. I am looking to loop through SAS datasets sequentially numbered beginning with 01095552.sas7bdat and ending with 01095630.sas7bdat. I am having a lot of trouble figuring out what I am doing wrong. Thank you for any help. If you could not tell I am fairly inexperienced with SAS, although I have a lot of STATA experience.
... View more