<?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 Repair input table because some rows concatenate by mistake in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461261#M117310</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a question please.&lt;/P&gt;&lt;P&gt;I will try to simplify it by a simple example.&lt;/P&gt;&lt;P&gt;There is an external table that I receive.&lt;/P&gt;&lt;P&gt;In this table for example there are 3&amp;nbsp;fields and should be for example 4&amp;nbsp;rows.&lt;/P&gt;&lt;P&gt;For example:The data should be like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp; a &amp;nbsp; b &amp;nbsp; c&lt;/P&gt;&lt;P&gt;&amp;nbsp; d &amp;nbsp; e &amp;nbsp; f&lt;/P&gt;&lt;P&gt;&amp;nbsp; g &amp;nbsp; h &amp;nbsp; I&lt;/P&gt;&lt;P&gt;&amp;nbsp; J &amp;nbsp; k &amp;nbsp; L&lt;/P&gt;&lt;P&gt;But I get it like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;abc &amp;nbsp;de &amp;nbsp;f&lt;/P&gt;&lt;P&gt;&amp;nbsp;g &amp;nbsp; &amp;nbsp; h &amp;nbsp; &amp;nbsp; I&lt;/P&gt;&lt;P&gt;&amp;nbsp;j &amp;nbsp; &amp;nbsp; &amp;nbsp;K &amp;nbsp; &amp;nbsp; L&lt;/P&gt;&lt;P&gt;I want to ask If there is a way to fix the data in a code.&lt;/P&gt;&lt;P&gt;For example: I want to have in each row 3 fields only and each field will contain 1 words(string).&lt;/P&gt;&lt;P&gt;Best solution will be to have a flexible program that can fix data for any number of fields.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Roms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 07:18:41 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2018-05-10T07:18:41Z</dc:date>
    <item>
      <title>Repair input table because some rows concatenate by mistake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461261#M117310</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a question please.&lt;/P&gt;&lt;P&gt;I will try to simplify it by a simple example.&lt;/P&gt;&lt;P&gt;There is an external table that I receive.&lt;/P&gt;&lt;P&gt;In this table for example there are 3&amp;nbsp;fields and should be for example 4&amp;nbsp;rows.&lt;/P&gt;&lt;P&gt;For example:The data should be like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp; a &amp;nbsp; b &amp;nbsp; c&lt;/P&gt;&lt;P&gt;&amp;nbsp; d &amp;nbsp; e &amp;nbsp; f&lt;/P&gt;&lt;P&gt;&amp;nbsp; g &amp;nbsp; h &amp;nbsp; I&lt;/P&gt;&lt;P&gt;&amp;nbsp; J &amp;nbsp; k &amp;nbsp; L&lt;/P&gt;&lt;P&gt;But I get it like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;abc &amp;nbsp;de &amp;nbsp;f&lt;/P&gt;&lt;P&gt;&amp;nbsp;g &amp;nbsp; &amp;nbsp; h &amp;nbsp; &amp;nbsp; I&lt;/P&gt;&lt;P&gt;&amp;nbsp;j &amp;nbsp; &amp;nbsp; &amp;nbsp;K &amp;nbsp; &amp;nbsp; L&lt;/P&gt;&lt;P&gt;I want to ask If there is a way to fix the data in a code.&lt;/P&gt;&lt;P&gt;For example: I want to have in each row 3 fields only and each field will contain 1 words(string).&lt;/P&gt;&lt;P&gt;Best solution will be to have a flexible program that can fix data for any number of fields.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Roms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 07:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461261#M117310</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-05-10T07:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Repair input table because some rows concatenate by mistake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461263#M117311</link>
      <description>Well, anything is possible, especially when it comes to SAS.&lt;BR /&gt;But if you don't have a specific (limited) no of cases you wish to handle, chances are that you will be in a never ending loop of fixing new data quality issues, and the result will an unmanageable piece of code.&lt;BR /&gt;So, first challenge your source to give you data with a sustainable structure.</description>
      <pubDate>Thu, 10 May 2018 07:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461263#M117311</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-05-10T07:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Repair input table because some rows concatenate by mistake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461266#M117314</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I gave a specific example.&lt;/P&gt;&lt;P&gt;Do you know how to repair it in sas code?&lt;/P&gt;&lt;P&gt;This is my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 07:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461266#M117314</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-05-10T07:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Repair input table because some rows concatenate by mistake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461270#M117315</link>
      <description>&lt;P&gt;Make an array with 3 variables.&lt;/P&gt;
&lt;P&gt;Retain a counter, initialize&amp;nbsp;to 1.&lt;/P&gt;
&lt;P&gt;Do an input without a variable (input line ends up in _infile_)&lt;/P&gt;
&lt;P&gt;Compress the _infile_ to remove blanks.&lt;/P&gt;
&lt;P&gt;Do for all characters in _infile_:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Assign the current character to the current array member&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Increment the counter&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If the counter is &amp;gt; 3, reset to 1 and output&lt;/P&gt;
&lt;P&gt;When the end of file is reached, output if counter is not 1 (incomplete last observation)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to put that pseudocode into data step code is left as an exercise for the student &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&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, 10 May 2018 09:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461270#M117315</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-10T09:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Repair input table because some rows concatenate by mistake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461279#M117322</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;The challenge starts with your specification.&lt;/P&gt;
&lt;P&gt;You&amp;nbsp;define "...&lt;SPAN&gt;and each field will contain 1 words(string).&lt;/SPAN&gt;" but then you show us as very first word "abc" but expect this single word to get split up into 3 different variables. What should it be? 1 non-blank character per variable OR words?&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 10:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repair-input-table-because-some-rows-concatenate-by-mistake/m-p/461279#M117322</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-05-10T10:16:57Z</dc:date>
    </item>
  </channel>
</rss>

