Hi,
I want to export my sas dataset to specific cells in excel.
I am trying to use macro but everytime I run it, my sas stops responding.
Can anyone tell me the macro statement for exporting?
Thanks a ton!
No one can help you if you don't post your code.
yes. my code looks like this
%macro export ();
filename syscmd dde 'Excel|system';
data _null_;
file syscmd;
put '[file-open("H:\SAS\survey\Reports\sas.xls")]';
run;
filename Q1C DDE "Excel|Sheet1!R1C1";
data _null_;
set Q1;
if role = 'C';
file Q1C notab;
put count '09x' percent '09x';
run;
%end;
%mend export;
%export;**Run macro;
According to your code, you are forcing everything into Row 1, Column1. If you have to use DDE, I'd suggest reading some of the key papers that have been written regarding that method. Do a Google search for Vyverman sas dde excel
i would use this
libname xlsout odbc noprompt="dbq=path\name of excel file you want to create ;
driver={microsoft excel driver (*.xls)}; readonly=0";
data xlsout.tabname;
set (data for export);
run;
libname xlsout clear;
run;
quit;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.