I have the following problem, the code I am using to link sas with excel through DDE requires the variable, in other words the columns of the table in SAS. The problem is that I am writing a universial program where the column names of the table changes regularly and thus I want oti know is there a way I can "put" all the tables in a column instead of using the "put &variable;" statement.
Here is the code I use:
/* Export category labels to Excel only the top 7*/
%macro excel (variable=,data=,sheet=);
FILENAME ddedata DDE
"excel|[Automated_homeloans.xls]numcases_cat!r2c3:r4c10" notab;
FILENAME ddecmds DDE "excel|system";
data _null_;
set &data;
file ddedata;
put &variable;
run;
%mend excel;
%excel (data=numcases_cat1,
sheet = sheet 1,
variable = name '09'x surname '09'x;
);
Here is the code I use:
/* Export category labels to Excel only the top 7*/
%macro excel (variable=,data=,sheet=);
FILENAME ddedata DDE
"excel|[Automated_homeloans.xls]numcases_cat!r2c3:r4c10" notab;
FILENAME ddecmds DDE "excel|system";
data _null_;
set &data;
file ddedata;
put &variable;
run;
%mend excel;
%excel (data=numcases_cat1,
sheet = sheet 1,
variable = name '09'x surname '09'x;
);