I had to switch servers I was using at work, and the new one "doesn't have SAS/CONNECT spawner running on it" per our SAS administrator. so now i cannot use an old code that had "pipe" in it to import a whole bunch of excel files in one swoop. they don't have to be appended, but i would like each one saved as it's own dataset. is there anyway to do this WITHOUT using "pipe"? everything i've looked for online doesn't have the output i want as an option. i'm using SAS EG 6.1 (64 bit)
old code below
filename indata pipe 'dir C:\Users\engacr\Documents\"My SAS Files"\9.4\200k_Cars\2015_Q1 /b ';
data file_list;
length fname $90 in_name out_name $50;
infile indata truncover;
input fname $ 90.;
in_name=translate(scan(fname,1,'.'),'_','-');
out_name=cats('TEMP_',in_name);
if upcase(scan(fname,-1,'.'))='XLSX';
run;
data _null_;
set file_list end=last;
call symputx(cats('dsn',_n_),in_name);
call symputx(cats('outdsn',_n_),out_name);
if last then call symputx('n',_n_);
run;
%macro test;
%do i=1 %to &n;
PROC IMPORT OUT= work.&&outdsn&i.
DATAFILE= "C:\Users\engacr\Documents\My SAS Files\9.4\200k_Cars\2015_Q1\&&dsn&i...xlsx"
DBMS=EXCEL REPLACE;
GETNAMES=YES;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
DBDSOPTS= "DBTYPE=(pct_load='NUM(8)')";
RUN;
%end;
%mend;
%test
data work.combined;
length veh_type_um $20.;
set TEMP_:;
run;
excel files in folder:
DTTX_342349.xlsx
DTTX_389923.xlsx
TTAX_346722.xlsx
TTPX_981123.xlsx
and so forth
would like them to output as:
DTTX_342349.sas7bdat
DTTX_389923.sas7bdat
TTAX_346722.sas7bdat
TTPX_981123.sas7bdat
and can append them if necessary
... View more