Dear All, Need your expertise/guidance on the above subject issue, I have total of 19 datasets which i need to combine then into one datasets, example as below:- datasets_201701 datasets_201702 datasets_201703 and so on I have the following macro code which able to combine my other datasets but no the above one due to one of the variable(example acctno) was define as numeric and character. How could I achieve this in macro environment as for data step i know just add below code will do:- data test(drop=acctno rename=(acctno_=acctno));
set source_dataset;
if vtype(acctno)='N' then
acctno_ = put(acctno, 15.);
else
acctno_ = acctno;
run; Below is my macro code. Your advice/suggestion is much appreciated. libname EXT 'C:\Users\Desktop';
/* Run a PROC CONTENTS to create a SAS data set with the names of the SAS data sets in the SAS data
library */
proc contents data=EXT._all_ out=EXT_cont(keep=memname) noprint;
run;
/* Eliminate any duplicate names of the SAS data set names stored in the SAS data set */
proc sort data=EXT_cont nodupkey;
by memname;
run;
data _null_;
set EXT_cont end=last;
by memname;
i+1;
call symputx('name'||trim(left(put(i,8.))),memname);
if last then call symputx('count',i);
run;
;
%macro append;
data results;
set
%do i=1 %to &count;
EXT.&&name&i
%end;
;
run;
%mend append;
%append; **for your information, some amendment on my code for security reason, apologize for any inconvenience caused.
... View more