<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Export Just a Variable to Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-Just-a-Variable-to-Excel/m-p/271476#M54006</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been trying to solve this problem on and off for a number of days without much luck. Appreciate any thoughts on it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I create this variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let today = today(); 
data _null_;
call symput ('Stamp',"Report created: "||put(today(),mmddyy10.));
run; 
%put &amp;amp;Stamp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It gives me the following: Report created: mm/dd/yyyy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All I want to do is take this variable and export it to a specific cell in excel. Seems easy, maybe it is, but I haven't been able to figure out how to do it without creating a table in SAS first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't use DDE because the code will ultimately run from a server that does not have excel installed. I can do it locally but ultimately that's not gonna work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code for the curious:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync xmin;
%sysexec "&amp;amp;Directory\&amp;amp;tprogram..xlsb";

data _null_;
rc = sleep(15);
run;


filename Workbook DDE 'Excel|Sheet1!R1C1';
data _null_;
file Workbook;
Stamp = "&amp;amp;Stamp";
put Stamp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've resorted to creating a table and appending it.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Stamp; 
Time_Stamp = "&amp;amp;Stamp"; 
run;

Libname WrkBk EXCEL "&amp;amp;directory\&amp;amp;program..xlsb" Scan_Text = No;

PROC DATASETS 
LIB = WrkBk;
DELETE Stamp;
RUN;
QUIT;

PROC APPEND 
BASE = WrkBk.Stamp
DATA = Stamp;
RUN;

Libname WrkBk CLEAR;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there a way to just export the variable&amp;nbsp;without having to go through the process of creating a table for it while also not using DDE? Maybe ODS? Appreciate any thoughts.&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2016 17:06:15 GMT</pubDate>
    <dc:creator>Ody</dc:creator>
    <dc:date>2016-05-18T17:06:15Z</dc:date>
    <item>
      <title>Export Just a Variable to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Just-a-Variable-to-Excel/m-p/271476#M54006</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been trying to solve this problem on and off for a number of days without much luck. Appreciate any thoughts on it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I create this variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let today = today(); 
data _null_;
call symput ('Stamp',"Report created: "||put(today(),mmddyy10.));
run; 
%put &amp;amp;Stamp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It gives me the following: Report created: mm/dd/yyyy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All I want to do is take this variable and export it to a specific cell in excel. Seems easy, maybe it is, but I haven't been able to figure out how to do it without creating a table in SAS first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't use DDE because the code will ultimately run from a server that does not have excel installed. I can do it locally but ultimately that's not gonna work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code for the curious:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync xmin;
%sysexec "&amp;amp;Directory\&amp;amp;tprogram..xlsb";

data _null_;
rc = sleep(15);
run;


filename Workbook DDE 'Excel|Sheet1!R1C1';
data _null_;
file Workbook;
Stamp = "&amp;amp;Stamp";
put Stamp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've resorted to creating a table and appending it.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Stamp; 
Time_Stamp = "&amp;amp;Stamp"; 
run;

Libname WrkBk EXCEL "&amp;amp;directory\&amp;amp;program..xlsb" Scan_Text = No;

PROC DATASETS 
LIB = WrkBk;
DELETE Stamp;
RUN;
QUIT;

PROC APPEND 
BASE = WrkBk.Stamp
DATA = Stamp;
RUN;

Libname WrkBk CLEAR;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there a way to just export the variable&amp;nbsp;without having to go through the process of creating a table for it while also not using DDE? Maybe ODS? Appreciate any thoughts.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 17:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Just-a-Variable-to-Excel/m-p/271476#M54006</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-05-18T17:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Export Just a Variable to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-Just-a-Variable-to-Excel/m-p/271492#M54010</link>
      <description>&lt;P&gt;Not if you want it in a specific cell.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 17:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-Just-a-Variable-to-Excel/m-p/271492#M54010</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-18T17:53:27Z</dc:date>
    </item>
  </channel>
</rss>

