<?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: Extract rows from website in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321671#M71078</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;, the retain statement works!&lt;/P&gt;</description>
    <pubDate>Fri, 30 Dec 2016 00:44:06 GMT</pubDate>
    <dc:creator>may0423</dc:creator>
    <dc:date>2016-12-30T00:44:06Z</dc:date>
    <item>
      <title>Extract rows from website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321317#M70921</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get some replied contents from a website. Below&amp;nbsp;is my code. However, it give&amp;nbsp;me only the first row, no matter how many rows&amp;nbsp;between &lt;SPAN class="html-tag"&gt;&amp;lt;blockquote &lt;SPAN class="html-attribute-name"&gt;class&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;postcontent restore &lt;/SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&amp;nbsp;and &lt;SPAN class="html-tag"&gt;&amp;lt;/blockquote&amp;gt; in the contents&lt;/SPAN&gt; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data testpostcontents;&amp;nbsp;&lt;BR /&gt;filename indata url '&lt;A href="http://forums.vwvortex.com/showthread.php?7286873-To-our-readers" target="_blank"&gt;http://forums.vwvortex.com/showthread.php?7286873-To-our-readers&lt;/A&gt;' lrecl=10000;&lt;BR /&gt;infile indata length=len;&lt;BR /&gt;input record $varying10000. len;&lt;BR /&gt;input @ '&amp;lt;blockquote class="postcontent restore "&amp;gt; ' / _line_ :&amp;amp;$10000. ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;One example of the replied contents:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;blockquote class="postcontent restore "&amp;gt;&lt;BR /&gt;Definitely a big part of many enthusiast's lives. &amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;I try to explain the bond I have made with people all across the world, to my wife and she just doesn't get it. &amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;To the new owners of VW Vortex - Good luck! Don't mind the CEL. It will always be there. Also... Ban Jett!&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;To Jamie and George - Best of luck in your future endeavors. Family coming first is the best decision any man can make. Congrats guys!&lt;BR /&gt;&amp;lt;/blockquote&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 19:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321317#M70921</guid>
      <dc:creator>may0423</dc:creator>
      <dc:date>2016-12-27T19:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract rows from website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321374#M70945</link>
      <description>&lt;P&gt;What works will depend on the site. Below code appears to work with the URL you've posted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename indata url 'http://forums.vwvortex.com/showthread.php?7286873-To-our-readers' lrecl=32767;

data test;
  infile indata length=len;
  input record $varying32767. len;

  retain _readflg 0;
  if find(record,'&amp;lt;blockquote class="postcontent','i') then _readflg=1;
  else if find(record,'&amp;lt;/blockquote&amp;gt;','i') then _readflg=0;
  else if _readflg=1 then
    do;
      record=prxchange('s/&amp;lt;.*&amp;gt;//oi',-1,record);
      record=compress(record,,'kw');
      record=htmldecode(record);
      if not missing(record) then output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Dec 2016 03:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321374#M70945</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-28T03:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract rows from website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321671#M71078</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;, the retain statement works!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 00:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-rows-from-website/m-p/321671#M71078</guid>
      <dc:creator>may0423</dc:creator>
      <dc:date>2016-12-30T00:44:06Z</dc:date>
    </item>
  </channel>
</rss>

