<?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: Restore the order of mismatched observations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774478#M31220</link>
    <description>&lt;P&gt;It is really uneasy.&lt;/P&gt;
&lt;P&gt;You need post real data to get pattern of starting a new line .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
infile "c:\temp\temp.csv" lrecl=3000 length=len;
input have $varying3000. len;
if _n_=1 then delete;
if prxmatch('/^[a-z]{4,}/i',have) then group+1;
run;


data want;
 do until(last.group);
   set have;
   by group;
   length want $ 3000;
   want=cats(want,have);
 end;

length PERSON_ID DEPT_ID DATE_JOINED $ 100;
PERSON_ID=scan(want,1,'&amp;lt;|&amp;gt;');
DEPT_ID=scan(want,2,'&amp;lt;|&amp;gt;');
DATE_JOINED=scan(want,3,'&amp;lt;|&amp;gt;');
 drop have;
 run;

 &lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Oct 2021 12:42:47 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-10-15T12:42:47Z</dc:date>
    <item>
      <title>Restore the order of mismatched observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774456#M31218</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS, I need help from you.&lt;/P&gt;&lt;P&gt;Is there a way to restore the order of mismatched observations?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consider the following csv file,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PERSON_ID&amp;lt;|&amp;gt;DEPT_ID&amp;lt;|&amp;gt;DATE_JOINED&lt;BR /&gt;AAAAA&amp;lt;|&amp;gt;S1&amp;lt;|&amp;gt;2021&lt;BR /&gt;/01/03&lt;BR /&gt;BBBB&lt;BR /&gt;BB&amp;lt;|&amp;gt;S2&amp;lt;|&amp;gt;2021/02/03&lt;BR /&gt;CCCCC&amp;lt;|&amp;gt;S1&amp;lt;|&amp;gt;2021/03/05&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish the output like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="desired_output.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64755i717AE7A381D9F0E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="desired_output.PNG" alt="desired_output.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 10:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774456#M31218</guid>
      <dc:creator>sarahzhou</dc:creator>
      <dc:date>2021-10-15T10:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Restore the order of mismatched observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774457#M31219</link>
      <description>&lt;P&gt;How 'messed up' is the file? Are any delimiters missing ?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 10:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774457#M31219</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-10-15T10:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Restore the order of mismatched observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774478#M31220</link>
      <description>&lt;P&gt;It is really uneasy.&lt;/P&gt;
&lt;P&gt;You need post real data to get pattern of starting a new line .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
infile "c:\temp\temp.csv" lrecl=3000 length=len;
input have $varying3000. len;
if _n_=1 then delete;
if prxmatch('/^[a-z]{4,}/i',have) then group+1;
run;


data want;
 do until(last.group);
   set have;
   by group;
   length want $ 3000;
   want=cats(want,have);
 end;

length PERSON_ID DEPT_ID DATE_JOINED $ 100;
PERSON_ID=scan(want,1,'&amp;lt;|&amp;gt;');
DEPT_ID=scan(want,2,'&amp;lt;|&amp;gt;');
DATE_JOINED=scan(want,3,'&amp;lt;|&amp;gt;');
 drop have;
 run;

 &lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774478#M31220</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-10-15T12:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Restore the order of mismatched observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774790#M31260</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 02:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Restore-the-order-of-mismatched-observations/m-p/774790#M31260</guid>
      <dc:creator>sarahzhou</dc:creator>
      <dc:date>2021-10-18T02:57:34Z</dc:date>
    </item>
  </channel>
</rss>

