<?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: A long note into muiltiple columns or rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940332#M369095</link>
    <description>After minor modification, I made it work for my project &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!</description>
    <pubDate>Wed, 21 Aug 2024 15:49:00 GMT</pubDate>
    <dc:creator>X605191</dc:creator>
    <dc:date>2024-08-21T15:49:00Z</dc:date>
    <item>
      <title>A long note into muiltiple columns or rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940174#M369061</link>
      <description>&lt;P&gt;I have a patient data set with "notes" as a string variable. It is pretty long, and the delimiter used in the notes is "&lt;SPAN&gt;¶".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is an example.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;distress&amp;nbsp;¶XXX... ¶YYY... ¶STOP taking these medications ¶&amp;nbsp; ¶ XXX .05mg Tab ¶Commonly known as... ¶ YYY 100mg Cap ¶&amp;nbsp; ¶START taking these medications ¶&amp;nbsp; ¶ OOO 5mg tab ¶ .... ¶CONTINUE taking these medications&amp;nbsp; ¶UUU 100mg Cap&amp;nbsp; &amp;nbsp;¶&amp;nbsp; &amp;nbsp;¶&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;What I need to do is extracting &lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;the lines from "STOP taking these medications" till right before "START taking these medications"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;the lines from "START taking these medications" till right before "CONTINUE taking these medications"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;the lines from "CONTINUE taking these medications" till the end of the notes&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;So I need three columns or rows per patient, but I cannot figure out how to write codes for that. Any advice would be greatly appreciated. Please let me know if anything is unclear. Thank you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 23:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940174#M369061</guid>
      <dc:creator>X605191</dc:creator>
      <dc:date>2024-08-20T23:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: A long note into muiltiple columns or rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940180#M369066</link>
      <description>&lt;P&gt;A basic way to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  STR0='distress ¶XXX... ¶YYY... ¶STOP taking these medications ¶  ¶ XXX .05mg Tab ¶Commonly known as... ¶ YYY 100mg Cap ¶  ¶START taking these medications ¶  ¶ OOO 5mg tab ¶ .... ¶CONTINUE taking these medications  ¶UUU 100mg Cap   ¶   ¶';
  
  POS1=index(STR0, 'STOP taking these medications')+length('STOP taking these medications');
  POS2=index(STR0, 'START taking these medications')-1;
  STR1=substr(STR0, POS1, POS2-POS1);
  
  POS1=index(STR0, 'START taking these medications')+length('START taking these medications');
  POS2=index(STR0, 'CONTINUE taking these medications')-1;
  STR2=substr(STR0, POS1, POS2-POS1);
  
  POS1=index(STR0,'CONTINUE taking these medications')+length('CONTINUE taking these medications');
  STR3=substr(STR0, POS1 );
run;
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 00:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940180#M369066</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-08-21T00:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: A long note into muiltiple columns or rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940332#M369095</link>
      <description>After minor modification, I made it work for my project &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!</description>
      <pubDate>Wed, 21 Aug 2024 15:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-long-note-into-muiltiple-columns-or-rows/m-p/940332#M369095</guid>
      <dc:creator>X605191</dc:creator>
      <dc:date>2024-08-21T15:49:00Z</dc:date>
    </item>
  </channel>
</rss>

