I'm just looking to export a SAS dataset into a pre-made Excel template.
First 6 variables of my dataset (which is a .wpd file) look like:
StartDate EndDate product_code Description Leaflet Media
04-Jul-13 07-Jul-13 256554 BUTCHER BEEF 1PK (1 KGM) 54x10 3
I currently have:
options noxwait noxsync;
x '"c:\Template.xls"'; /* <--excel template to use*/
filename template dde 'excel|Leaflets!r6c1:r183c67'; /*put data in rows 3 to 183 in leaflets sheet*/
data LEAF.results; set LEAF.results;
file template ;
put StartDate EndDate product_code Description Leaflet Media
/*and the remaining 61 variables*/
run;
The DDE procedure works and opens the excel sheet, but the data is not formatted correctly in excel and looks like this:
StartDate EndDate Product code Description Leaflet Media
04 July 2013 07 July 2013 256554 BUTCHER BEEF 1PK
As you can see it seems to have treated spaces as delimiters but I'm not sure of the syntax to change this - might also be worth noting that I have 67 variables in my actual dataset so didn't want to have to informat and format them all individually.
Also, is there a way to output this dataset into my excel template and then save the template as a different filename elsewhere on my c drive?
Thanks!