<?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 Re: DDE - INSERT VARIABLES INTO EXCEL AS MACRO VARIABLE in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505130#M1102</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42503"&gt;@AlexeyS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello. I want to insert into excel a few variables(suppose three variables). I create a macro variable that represent list of variables.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" size="5"&gt;&lt;STRONG&gt;What's wrong?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
select name into : vars separated by '09'x
from dictionary.columns
where LIBNAME = upcase("work")
and MEMNAME = upcase("report") 
and name like '%happy';
quit;

filename excelw dde "EXCEL|Sheet1!R2C5:R100C7" notab;
data _null_;
file excelw;
set report;
put "&amp;amp;vars"n;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Without a clear example of input or output it is very hard to answer what might be "wrong".&lt;/P&gt;
&lt;P&gt;We cannot tell:&lt;/P&gt;
&lt;P&gt;1) If the &amp;amp;vars macro variable was successfully created&lt;/P&gt;
&lt;P&gt;2) What the possible value of &amp;amp;varsmay be&lt;/P&gt;
&lt;P&gt;Also, the&amp;nbsp;Put "&amp;amp;vars"n will not work if there are more than 1&amp;nbsp;variable name&amp;nbsp;in the value of &amp;amp;vars as the Put statement would be expecting a single variable&amp;nbsp;name that exists in the data set Report. Assuming &amp;amp;vars was build from SASHELP.class you could be creating a statement equivalent to:&lt;/P&gt;
&lt;PRE&gt;put "Name Sex Age Height Weight"n;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and would be looking for a single variable with that name.&lt;/P&gt;
&lt;P&gt;Tab delimited list is going to be&amp;nbsp;right out for a single put. You would need to parse the list to get each separate variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be aware that there is other software out there that interferes with DDE. If these applications are running then DDE will not work at all. The example I am very aware of is Cisco Jabber. The process has to be KILLED using task manager, not just closing any active window, before any DDE commands will be accepted.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Oct 2018 14:54:19 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-10-17T14:54:19Z</dc:date>
    <item>
      <title>DDE - INSERT VARIABLES INTO EXCEL AS MACRO VARIABLE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505041#M1084</link>
      <description>&lt;P&gt;Hello. I want to insert into excel a few variables(suppose three variables). I create a macro variable that represent list of variables.&lt;/P&gt;&lt;P&gt;What's wrong?&lt;/P&gt;&lt;PRE&gt;proc sql noprint;
select name into : vars separated by '09'x
from dictionary.columns
where LIBNAME = upcase("work")
and MEMNAME = upcase("report") 
and name like '%happy';
quit;

filename excelw dde "EXCEL|Sheet1!R2C5:R100C7" notab;
data _null_;
file excelw;
set report;
put "&amp;amp;vars"n;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505041#M1084</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2018-10-17T12:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: DDE - INSERT VARIABLES INTO EXCEL AS MACRO VARIABLE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505044#M1086</link>
      <description>&lt;P&gt;What does the log say?&amp;nbsp; As a suggestion I would move away from using technology that is 30 years out of service (DDE)m and which doesn't work at all in several scenarios.&amp;nbsp; If you want data in Excel, then use ods excel or tagsets.excelxp or one of those.&amp;nbsp; Much more control and modern.&amp;nbsp; If you need something else, explain the need.&amp;nbsp; DDE I wouldn't even bother trying to debug it.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505044#M1086</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-17T12:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: DDE - INSERT VARIABLES INTO EXCEL AS MACRO VARIABLE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505114#M1099</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select name into : vars separated by " "
from dictionary.columns
where LIBNAME = upcase("work")
and MEMNAME = upcase("report") 
and name like '%happy';
quit;

filename excelw dde "EXCEL|Sheet1!R2C5:R100C7" notab;
data _null_;
file excelw;
set report;
put &amp;amp;vars;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505114#M1099</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-10-17T14:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: DDE - INSERT VARIABLES INTO EXCEL AS MACRO VARIABLE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505130#M1102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42503"&gt;@AlexeyS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello. I want to insert into excel a few variables(suppose three variables). I create a macro variable that represent list of variables.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" size="5"&gt;&lt;STRONG&gt;What's wrong?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
select name into : vars separated by '09'x
from dictionary.columns
where LIBNAME = upcase("work")
and MEMNAME = upcase("report") 
and name like '%happy';
quit;

filename excelw dde "EXCEL|Sheet1!R2C5:R100C7" notab;
data _null_;
file excelw;
set report;
put "&amp;amp;vars"n;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Without a clear example of input or output it is very hard to answer what might be "wrong".&lt;/P&gt;
&lt;P&gt;We cannot tell:&lt;/P&gt;
&lt;P&gt;1) If the &amp;amp;vars macro variable was successfully created&lt;/P&gt;
&lt;P&gt;2) What the possible value of &amp;amp;varsmay be&lt;/P&gt;
&lt;P&gt;Also, the&amp;nbsp;Put "&amp;amp;vars"n will not work if there are more than 1&amp;nbsp;variable name&amp;nbsp;in the value of &amp;amp;vars as the Put statement would be expecting a single variable&amp;nbsp;name that exists in the data set Report. Assuming &amp;amp;vars was build from SASHELP.class you could be creating a statement equivalent to:&lt;/P&gt;
&lt;PRE&gt;put "Name Sex Age Height Weight"n;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and would be looking for a single variable with that name.&lt;/P&gt;
&lt;P&gt;Tab delimited list is going to be&amp;nbsp;right out for a single put. You would need to parse the list to get each separate variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be aware that there is other software out there that interferes with DDE. If these applications are running then DDE will not work at all. The example I am very aware of is Cisco Jabber. The process has to be KILLED using task manager, not just closing any active window, before any DDE commands will be accepted.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/DDE-INSERT-VARIABLES-INTO-EXCEL-AS-MACRO-VARIABLE/m-p/505130#M1102</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-17T14:54:19Z</dc:date>
    </item>
  </channel>
</rss>

