<?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: Blanks after variable in Output to XML file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167247#M263900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The put statement by default adds a delimiting space at the end of each variable printed so list output does not run everything together.&amp;nbsp; &lt;/P&gt;&lt;P&gt;In this context the + is a pointer control, so +9 would move the pointer (the next printing position) 9 spaces further.&amp;nbsp; &lt;/P&gt;&lt;P&gt;There is no '-' pointer control so if you need to move back one space you need to advance the pointer control by (-1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative would be to place your text and values explicitly using the @ pointer, but you might have to calculate the length of the count variable each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 May 2014 12:26:08 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2014-05-21T12:26:08Z</dc:date>
    <item>
      <title>Blanks after variable in Output to XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167243#M263896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im having a small issue creating an XML output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each variable in my put statement, generates and blank after it (which it shouldnt!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Heres a small sample code:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set step2 end=eof;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;file&amp;nbsp; 'c:\Data.xml';&lt;/P&gt;&lt;P&gt;if _n_=1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '&amp;lt;chart&amp;gt;';&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '&amp;lt;set label="'visityearweek'" value="'count'"/&amp;gt;';&amp;nbsp; &amp;lt;----- PROBLEM!&lt;/P&gt;&lt;P&gt;if (eof=1) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '&amp;lt;/chart&amp;gt;';&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current output:&lt;/P&gt;&lt;P&gt;&amp;lt;set label="2014-04 " value="2839 "/&amp;gt; &amp;lt;--- BLANKS after var..!&lt;/P&gt;&lt;P&gt;&amp;lt;set label="2014-05 " value="3232 "/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;set label="2014-06 " value="2433 "/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got an idea why this occurs? (i have tried to compress/strip the variables first without luck, theres no blanks in data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Kasper &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 08:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167243#M263896</guid>
      <dc:creator>bergsorensen</dc:creator>
      <dc:date>2014-05-21T08:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Blanks after variable in Output to XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167244#M263897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Issue not resolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 08:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167244#M263897</guid>
      <dc:creator>bergsorensen</dc:creator>
      <dc:date>2014-05-21T08:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Blanks after variable in Output to XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167245#M263898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;put '&amp;lt;set label="'visityearweek+(-1)'" value="'count+(-1)'"/&amp;gt;'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;Richard&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 11:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167245#M263898</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-05-21T11:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Blanks after variable in Output to XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167246#M263899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - thats the (though its not logic why needed) solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 11:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167246#M263899</guid>
      <dc:creator>bergsorensen</dc:creator>
      <dc:date>2014-05-21T11:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Blanks after variable in Output to XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167247#M263900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The put statement by default adds a delimiting space at the end of each variable printed so list output does not run everything together.&amp;nbsp; &lt;/P&gt;&lt;P&gt;In this context the + is a pointer control, so +9 would move the pointer (the next printing position) 9 spaces further.&amp;nbsp; &lt;/P&gt;&lt;P&gt;There is no '-' pointer control so if you need to move back one space you need to advance the pointer control by (-1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative would be to place your text and values explicitly using the @ pointer, but you might have to calculate the length of the count variable each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 12:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blanks-after-variable-in-Output-to-XML-file/m-p/167247#M263900</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-05-21T12:26:08Z</dc:date>
    </item>
  </channel>
</rss>

