<?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: XML file generation with line break in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430437#M281595</link>
    <description>&lt;P&gt;Individual put statements will always cause a newline in the text file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file '$HOME/sascommunity/babloo.xml';
put '&amp;lt;explanation&amp;gt;Franc:';
put 'indexat';
put 'Vlaam:';
put 'indexae &amp;lt;/explanation&amp;gt;';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Resulting file:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;redacted&amp;gt;/sascommunity $ cat babloo.xml
&amp;lt;explanation&amp;gt;Franc:
indexat
Vlaam:
indexae &amp;lt;/explanation&amp;gt;
&lt;/PRE&gt;</description>
    <pubDate>Wed, 24 Jan 2018 14:19:20 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-01-24T14:19:20Z</dc:date>
    <item>
      <title>XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430432#M281594</link>
      <description>&lt;P&gt;I've a dataset which has only this variable called '&lt;STRONG&gt;X&lt;/STRONG&gt;' and it has value as &lt;STRONG&gt;Fraais:&amp;amp;lt;BR/&amp;amp;gt;indexion&amp;amp;lt;BR/&amp;amp;gt;Vlams:&amp;amp;lt;BR/&amp;amp;gt;indetie&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've to convert this dataset to XML file which should have contents as follows. I'm not certain how to instruct SAS to treat each line break (&amp;amp;lt;BR/&amp;amp;gt&lt;IMG class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" border="0" alt="Smiley Wink" title="Smiley Wink" /&gt; to enter the text in next line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;explanation&amp;gt;Fraais:&lt;BR /&gt;indexion&lt;BR /&gt;Vlams:&lt;BR /&gt;indetie &amp;lt;/explanation&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 05:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430432#M281594</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-25T05:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430437#M281595</link>
      <description>&lt;P&gt;Individual put statements will always cause a newline in the text file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file '$HOME/sascommunity/babloo.xml';
put '&amp;lt;explanation&amp;gt;Franc:';
put 'indexat';
put 'Vlaam:';
put 'indexae &amp;lt;/explanation&amp;gt;';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Resulting file:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;redacted&amp;gt;/sascommunity $ cat babloo.xml
&amp;lt;explanation&amp;gt;Franc:
indexat
Vlaam:
indexae &amp;lt;/explanation&amp;gt;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430437#M281595</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-24T14:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430440#M281596</link>
      <description>&lt;P&gt;Not sure why you would want to, visually it does not matter as the whole text between the two tags is read in, you will just end up with linefeeds if you force them in.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;explanation&amp;gt;
  Franc: indexat Vlaam: indexae
&amp;lt;/explanation&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Is effecively what the XML should look like.&amp;nbsp; If you want Franc and Vlam separated then these should come under separate tags:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;explanation&amp;gt;
  &amp;lt;Franc&amp;gt; indexat &amp;lt;/Franc&amp;gt;&lt;BR /&gt;  &amp;lt;Vlaam&amp;gt; indexae &amp;lt;/Vlaam&amp;gt;
&amp;lt;/explanation&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Anyways if you continue, in your data you can add the hex character '0A'x to give returns like:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  substr(line,14,1)='0A'x;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430440#M281596</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-24T14:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430461#M281597</link>
      <description>&lt;P&gt;I should have asked the question in this way.&amp;nbsp;I've a dataset which has only this variable called '&lt;STRONG&gt;X&lt;/STRONG&gt;' and it has value as &lt;STRONG&gt;Fraais:&amp;amp;lt;BR/&amp;amp;gt;indexion&amp;amp;lt;BR/&amp;amp;gt;Vlams:&amp;amp;lt;BR/&amp;amp;gt;indetie&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've to convert this dataset to XML file which should have contents as follows. I'm not certain how to instruct SAS to treat each line break (&amp;amp;lt;BR/&amp;amp;gt;) to enter the text in next line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;explanation&amp;gt;Fraais:&lt;BR /&gt;indexion&lt;BR /&gt;Vlams:&lt;BR /&gt;indetie &amp;lt;/explanation&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430461#M281597</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-24T14:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430465#M281598</link>
      <description>&lt;P&gt;See if this:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/35504890/how-to-add-a-newline-line-break-in-xml-file" target="_blank"&gt;https://stackoverflow.com/questions/35504890/how-to-add-a-newline-line-break-in-xml-file&lt;/A&gt; can give you useful hints.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430465#M281598</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-24T14:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430478#M281599</link>
      <description>&lt;PRE&gt;data want;
  str='Fraais:&amp;amp;lt;BR/&amp;amp;gt;indexion&amp;amp;lt;BR/&amp;amp;gt;Vlams:&amp;amp;lt;BR/&amp;amp;gt;indetie';
  str=tranwrd(str,'&amp;amp;lt;BR;/&amp;amp;gt;','0A'x);
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jan 2018 15:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430478#M281599</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-24T15:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430780#M281600</link>
      <description>&lt;P&gt;It has not resolved the issue either. I'm getting the same value in row&amp;nbsp;instead of multiple rows.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 05:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430780#M281600</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-25T05:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430808#M281601</link>
      <description>&lt;P&gt;Given link deals with only XML part and not from SAS with XML. Also I'm not certain to fit guidelines mentioned in the link below to my SAS program.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 08:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430808#M281601</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-25T08:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430809#M281602</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Given link deals with only XML part and not from SAS with XML. Also I'm not certain to fit guidelines mentioned in the link below to my SAS program.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just add the suggested strings to your put statements or to the variables you use in the put. Quite simple, very basic data step technique. Should not pose a problem to someone who's already a veteran here (after 500+ posts)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 08:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430809#M281602</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-25T08:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430848#M281603</link>
      <description>&lt;P&gt;Just saying it didn't work doesn't help.&amp;nbsp; Show your code, is it possible your doing this on Windows and opening in Notepad, then you likely need to replace with Linefeed + CR characters as that is Windows standard.&amp;nbsp; I can't guess!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 10:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430848#M281603</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-25T10:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430853#M281604</link>
      <description>&lt;P&gt;I just added the following two lines in my SAS program which creates the XML file and ran it via SAS EG. After the successful run, I could see that XML file has generated with the below highlighted part in one line instead of 4 lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; str='&lt;STRONG&gt;Fraais:&amp;amp;lt;BR/&amp;amp;gt;indexion&amp;amp;lt;BR/&amp;amp;gt;Vlams:&amp;amp;lt;BR/&amp;amp;gt;indetie&lt;/STRONG&gt;';
  str=tranwrd(str,'&amp;amp;lt;BR;/&amp;amp;gt;','0A'x);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 11:07:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430853#M281604</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-25T11:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: XML file generation with line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430858#M281605</link>
      <description>&lt;P&gt;If you just put str to the text file, it's contents will be in one line. If you want the lines to break, use several put statements, &lt;STRONG&gt;as I already told you&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 11:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-file-generation-with-line-break/m-p/430858#M281605</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-25T11:22:06Z</dc:date>
    </item>
  </channel>
</rss>

