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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.