Hi.....I am getting an error message when I am trying to merge all the datasets together which I think is related to a decimal point being attached at the end of each dataset that is being imported.
%let path=V:\Test;
filename folder "&path\";
libname project 'I:\Output';
libname c 'I:\Output\Temp';
options validmemname=extend;
data FilesInFolder;
length Line 8 File $300;
List = dopen('folder');
do Line = 1 to dnum(List);
File = trim(dread(List,Line));
output;
end;
drop list line;
run;
data _null_;
set FilesInFolder end=final;
call symput(cats('File', _N_), trim(File));
call symput(cats('Name', _N_), trim(nliteral(substr(File,1,min(32, length(File)-4)))));
if final then call symputx(trim('Total'), _N_);
run;
%macro loop;
%do i = 1 %to &Total;
proc import datafile="&path\&&File&i" out=c.&&name&i dbms=excel replace;
sheet="F2020";
range="$B10:AN200";
getnames=yes;
run;
%end;
%mend loop;
%loop
proc sql noprint;
select
trim(libname) || '.' || memname into :dataset_vars separated by ' '
from dictionary.tables
where upcase(libname)="C"
and upcase(memname) like '%' ;
quit;
data want;
set &dataset_vars;
run;
Error Message:
36
37 data want;
38 set &dataset_vars;
NOTE: Line generated by the macro variable "DATASET_VARS".
38 C.CF. C.NCT. C.WANT
_____
22
201
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, CUROBS, END, INDSNAME, KEY, KEYRESET, KEYS,
NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 201-322: The option is not recognized and will be ignored.
... View more