%macro dd (s1,s2,s3,s4,s5);
%do i=1 %to 5;
data &&s&i;
set sashelp.class;
run;
%end;
%MEND;
%DD (dm,cm,ae,ce,sv);
%macro sasxpt;
proc sql;
select left(put(COUNT (memname),2.) )into :cnt from dictionary.tables where libname="WORK" AND
MEMTYPE="DATA";
select memname into :x1-:x&cnt from dictionary.tables where libname="WORK" AND
MEMTYPE="DATA";
QUIT;
%do i=1 %to &cnt;
proc cport data=&&x&i file="C:\Users\hcl\Desktop\ra\&&x&i...xpt";
run;
%end;
%mend;
options symbolgen;
%sasxpt
%put &x5 ;
%do i=1 %to 5;
data &&s&i;
set sashelp.class;
run;
%end;
%MEND;
%DD (dm,cm,ae,ce,sv);
%macro sasxpt;
proc sql;
select left(put(COUNT (memname),2.) )into :cnt from dictionary.tables where libname="WORK" AND
MEMTYPE="DATA";
select memname into :x1-:x&cnt from dictionary.tables where libname="WORK" AND
MEMTYPE="DATA";
QUIT;
%do i=1 %to &cnt;
proc cport data=&&x&i file="C:\Users\hcl\Desktop\ra\&&x&i...xpt";
run;
%end;
%mend;
options symbolgen;
%sasxpt
%put &x5 ;
No comments:
Post a Comment