<?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: Out put characters to Excel using DDE in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257475#M57251</link>
    <description>&lt;P&gt;This line of code tells me you have two variables of interest, Regiod and Dept&lt;/P&gt;
&lt;P&gt;PUT Region DLM Dept DLM;&lt;/P&gt;
&lt;P&gt;You comments say that you want the values of those in a single cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would propose a generic solution of concatenating them in a data step so the values are in a single variable and that is what is exported.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RegDept = catx(' ',Region,Dept);&lt;/P&gt;
&lt;P&gt;to concatenate with a space between the values.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2016 22:30:58 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-03-17T22:30:58Z</dc:date>
    <item>
      <title>Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257177#M57215</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset that most of the fields are characters. When I output this dataset to Excel using DDE, there is a space before each characters. How can I get ride of the space?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my program:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Options noxwait noxsync;&lt;BR /&gt;X "'&amp;amp;TemplatePath.&amp;amp;TemplateName..xlsx'";&lt;BR /&gt;Options xwait xsync;&lt;BR /&gt;&lt;BR /&gt;FILENAME ddecmd DDE 'EXCEL|SYSTEM';&lt;BR /&gt;&lt;BR /&gt;FILENAME DATA&amp;nbsp; DDE "EXCEL|sheet1!R2C1:R7C2" NOTAB;&lt;BR /&gt;&lt;BR /&gt;DATA _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SET file;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; FILE DATA LRECL=30000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DLM='09'X;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT Region DLM Dept DLM;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;DATA _NULL_;&lt;BR /&gt;&amp;nbsp; FILE ddeCMD; &lt;BR /&gt;&amp;nbsp; PUT "[SAVE.AS(%BQUOTE("&amp;amp;SavePath.&amp;amp;SaveName._&amp;amp;Sysdate..xlsx "))]"; &lt;BR /&gt;&amp;nbsp; PUT&amp;nbsp; '[CLOSE()]' ;&lt;BR /&gt;Replace;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2016 23:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257177#M57215</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-16T23:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257195#M57219</link>
      <description>&lt;P&gt;In front of all your variables? Remove the dlm from your code, Excel and SAS will handle putting the values into the correct cells.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#n1aqiv6biqkjbnn1gu1388hp7aab.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#n1aqiv6biqkjbnn1gu1388hp7aab.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 01:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257195#M57219</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-17T01:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257240#M57225</link>
      <description>&lt;P&gt;Please don't type code in all upper case it is very hard to read. &amp;nbsp;Can I ask why you are using DDE? &amp;nbsp;It would not be my recommendation, it is a very old technology which doesn't work in some scenarios, and may not be suppoorted at all soon. &amp;nbsp;If you absolutely have to insert data into a template spreadsheet, then a simpler method is to export the data as CSV, and have your spreadsheet load that data on open, or have a separate macro file in Excel which loads the CSV and saves to the Excel file. &amp;nbsp;Or read in the document and re-create it with the updates. &amp;nbsp;Or if you have SAS9.4 use Libname xlsx to manipulate the file. &amp;nbsp;Or don't use Excel at all which is Always the best idea.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 09:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257240#M57225</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-17T09:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257266#M57227</link>
      <description>&lt;P&gt;Chime in with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;Another option that really lets you design your Excel spreadsheet is to use the Add-in for MS Office. Available in the BI Server and Office Analytics offerings.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 12:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257266#M57227</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-17T12:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257323#M57240</link>
      <description>Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;I cant remove DLM because I have a blank between 'Bay' and 'Area'. If I remove DLM, column A will be Bay and column B will be Area, which is not what I want. &lt;BR /&gt;&lt;BR /&gt;Thanks for the suggestion.</description>
      <pubDate>Thu, 17 Mar 2016 15:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257323#M57240</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-17T15:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257324#M57241</link>
      <description>&lt;P&gt;The NOTAB with a LRECL on your DDE&amp;nbsp;statement should take care of that. At least it does for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME DATA  DDE "EXCEL|sheet1!R2C1:R7C2" NOTAB LRECL=30000;

DATA _null_;
   SET file;
   FILE DATA;
      PUT Region Dept ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 15:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257324#M57241</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-17T15:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257325#M57242</link>
      <description>Hi Raw, &lt;BR /&gt;&lt;BR /&gt;The example here is very simple, my real report is more complicated which request data from different sources, and need to be input to certain cells in Excel. I found DDE is very useful in my situation. Instead of copy and paste to certain cells, I can use DDE to automate the process. &lt;BR /&gt;&lt;BR /&gt;It would be a big lost for people like me if DDE won't be supported. I hope NOT.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 17 Mar 2016 15:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257325#M57242</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-17T15:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257330#M57244</link>
      <description>Thanks Reeza for getting back to me. I did remove DLM before, but it doesnt work for me. I noticed I have no problem if output is numerical data, but doesn't work for characters.&lt;BR /&gt;&lt;BR /&gt;I won't be able to access my SAS in next couple days, but I will try again once I have the access. I will let you know.&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Thu, 17 Mar 2016 15:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257330#M57244</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-17T15:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257331#M57245</link>
      <description>&lt;P&gt;By RAW I assume you mean me. &amp;nbsp;DDE is very old technology, it was invented back in the early days of Office, and is controlled by Microsoft, so support is down to them. &amp;nbsp;It has very limited functionality, and doesn't work at all in some scenarios, hence I would again suggest not using it. &amp;nbsp;There are many ways to get data to a from Excel - noting of course that Excel is no the best file format for any purpose in the first place - so there are many options. &amp;nbsp;Why, for instance, do you need to access certain cells, what if someone inserts a line, or changes a name or any other of the million differences that using Excel can have on your code. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 15:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257331#M57245</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-17T15:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257395#M57246</link>
      <description>Sorry for typing your name wrong, RW9, I was typing on my phone. Thanks for your advice, I will definitely keep it in mind in the future.</description>
      <pubDate>Thu, 17 Mar 2016 17:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257395#M57246</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-17T17:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257475#M57251</link>
      <description>&lt;P&gt;This line of code tells me you have two variables of interest, Regiod and Dept&lt;/P&gt;
&lt;P&gt;PUT Region DLM Dept DLM;&lt;/P&gt;
&lt;P&gt;You comments say that you want the values of those in a single cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would propose a generic solution of concatenating them in a data step so the values are in a single variable and that is what is exported.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RegDept = catx(' ',Region,Dept);&lt;/P&gt;
&lt;P&gt;to concatenate with a space between the values.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 22:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257475#M57251</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-17T22:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257618#M57266</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1655"&gt;@Belle﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you shouldn't create a variable DLM, but type the '09'x directly into the PUT statement. I can't test it at the moment with Excel because I don't have Excel installed on my SAS workstation, but this is how I wrote my DDE programs in the past and it makes a difference if I write to a text file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put region '09'x dept;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(No '09'x is necessary after the last variable, I think.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To quote the documentation of &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl/en/lestmtsref/68024/HTML/default/p0jcwhe1ofmb49n1xf1q2kc44b0v.htm" target="_blank"&gt;PUT Statement, List&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;"When a variable is written with list output, SAS automatically inserts a blank space. (...) However, when a character string is written, SAS does not automatically insert a blank space."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: For the purpose of abbreviation you could define a &lt;EM&gt;macro&lt;/EM&gt; variable: &lt;FONT face="courier new,courier"&gt;%let t='09'x;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 14:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/257618#M57266</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-18T14:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/258108#M57326</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried your method, it ends at all the fields are in one column. I also tried FreelanceReinhard method, it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again for the advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 23:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/258108#M57326</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-21T23:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Out put characters to Excel using DDE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/258109#M57327</link>
      <description>&lt;P&gt;Hi FreelanceReinhard,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your solution, it works. This has to do with variable and string as your mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Really appreciated your help.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 23:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-put-characters-to-Excel-using-DDE/m-p/258109#M57327</guid>
      <dc:creator>Belle</dc:creator>
      <dc:date>2016-03-21T23:44:54Z</dc:date>
    </item>
  </channel>
</rss>

