<?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: Extracting specific information from rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587231#M167702</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id Text :$200.;
infile datalines4 dlm=',';
datalines;
1,Physical Exam. Vital Signs. BP: 134/93
2,Patient's physical exam was notable for BP of 142/100
3,Physical Exam. BP: 100/80
;

data want;
    set have;
    p=prxmatch('/\bBP\b/i',text);
    if p then NewString=substr(Text, p);
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Sep 2019 13:39:28 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-09-09T13:39:28Z</dc:date>
    <item>
      <title>Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587149#M167663</link>
      <description>&lt;P&gt;I have a dataset in which each row is a long block of text, and I need to extract specific information from each row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; Text&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physical Exam. Vital Signs. BP: 134/93&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Patient's physical exam was notable for BP of 142/100&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physical Exam. BP: 100/80&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is what I need:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; Text&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BP: 134/93&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BP of 142/100&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BP: 100/80&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 07:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587149#M167663</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2019-09-09T07:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587155#M167667</link>
      <description>&lt;P&gt;Do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id Text :$200.;
infile datalines4 dlm=',';
datalines;
1,Physical Exam. Vital Signs. BP: 134/93
2,Patient's physical exam was notable for BP of 142/100
3,Physical Exam. BP: 100/80
;

data want;
    set have;
    NewString=substr(Text, index(Text, 'BP'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 07:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587155#M167667</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T07:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587163#M167672</link>
      <description>&lt;P&gt;Alternatively with prxchange function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id Text&amp;amp;$100.;
text=prxchange('s/(.*)(bp.*)/$2/i',-1,text);
datalines4;
1 Physical Exam. Vital Signs. BP: 134/93
2 Patient's physical exam was notable for BP of 142/100
3 Physical Exam. BP: 100/80
;;;;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 08:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587163#M167672</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-09T08:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587231#M167702</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id Text :$200.;
infile datalines4 dlm=',';
datalines;
1,Physical Exam. Vital Signs. BP: 134/93
2,Patient's physical exam was notable for BP of 142/100
3,Physical Exam. BP: 100/80
;

data want;
    set have;
    p=prxmatch('/\bBP\b/i',text);
    if p then NewString=substr(Text, p);
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 13:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587231#M167702</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-09T13:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587259#M167715</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/194212"&gt;@SarahW13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset in which each row is a long block of text, and I need to extract specific information from each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; Text&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physical Exam. Vital Signs. BP: 134/93&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Patient's physical exam was notable for BP of 142/100&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physical Exam. BP: 100/80&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is what I need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; Text&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BP: 134/93&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BP of 142/100&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BP: 100/80&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;is BP always the last item entered? Is it always recorded with the / dividing the measurements?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 15:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587259#M167715</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-09T15:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587375#M167764</link>
      <description>&lt;P&gt;data cardiac;&lt;BR /&gt;input id Text :$200.;&lt;BR /&gt;infile datalines4 dlm=',';&lt;BR /&gt;datalines;&lt;BR /&gt;1,Physical Exam. Vital Signs. BP: 134/93&lt;BR /&gt;2,Patient's physical exam was notable for BP of 142/100&lt;BR /&gt;3,Physical Exam. BP: 100/80&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data strepto;&lt;BR /&gt;set cardiac;&lt;BR /&gt;NewString=substr(Text, index(Text, 'BP'));&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 21:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587375#M167764</guid>
      <dc:creator>alexpat</dc:creator>
      <dc:date>2019-09-09T21:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587376#M167765</link>
      <description>&lt;DIV class="dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignTop"&gt;&lt;DIV class="dijit dijitToolbar"&gt;&lt;SPAN class="toolbarText rowNavigation" style="margin: 5px 10px 5px 5px; float: right; overflow: hidden;"&gt;Rows 1-3&lt;/SPAN&gt;&lt;DIV&gt;Total rows: 3Total columns: 3&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter dijitContentPaneSingleChild"&gt;&lt;DIV class="dgrid dgrid-grid ui-widget"&gt;&lt;DIV class="dgrid-header dgrid-header-row ui-widget-header"&gt;&lt;DIV class="dgrid-resize-handle resizeNode-0"&gt;&amp;nbsp;&lt;/DIV&gt;id&lt;DIV class="dgrid-resize-handle resizeNode-1"&gt;&amp;nbsp;&lt;/DIV&gt;Text&lt;DIV class="dgrid-resize-handle resizeNode-2"&gt;&amp;nbsp;&lt;/DIV&gt;NewString&lt;DIV class="dgrid-resize-handle resizeNode-3"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="dgrid-scroller"&gt;&lt;DIV class="dgrid-content ui-widget-content"&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Physical Exam. Vital Signs. BP: 134/93&lt;/TD&gt;&lt;TD&gt;BP: 134/93&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Patient's physical exam was notable for BP of 142/100&lt;/TD&gt;&lt;TD&gt;BP of 142/100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Physical Exam. BP: 100/80&lt;/TD&gt;&lt;TD&gt;BP: 100/80&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Sep 2019 21:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587376#M167765</guid>
      <dc:creator>alexpat</dc:creator>
      <dc:date>2019-09-09T21:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific information from rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587379#M167767</link>
      <description>&lt;P&gt;data sle;&lt;BR /&gt;set autoimmun;&lt;BR /&gt;p=prxmatch('/\bBP\b/i',text);&lt;BR /&gt;if p then NewString=substr(Text, p);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Ksharp, another way to estract ///&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 22:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-specific-information-from-rows/m-p/587379#M167767</guid>
      <dc:creator>alexpat</dc:creator>
      <dc:date>2019-09-09T22:02:43Z</dc:date>
    </item>
  </channel>
</rss>

