<?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: How to read specific information from Tweet data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289881#M59907</link>
    <description>&lt;P&gt;Look at the SCAN() function including the third parameter, which allows you specify the delimiter.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 21:06:39 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-08-05T21:06:39Z</dc:date>
    <item>
      <title>How to read specific information from Tweet data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289879#M59905</link>
      <description>&lt;P&gt;note : raw data line are actually different twitter comments. Need to fetch only those data which has special character (with character) as shown in output and those comment does not contains special character then make it null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Raw data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@nice#Greatwork@fake&lt;/P&gt;
&lt;P&gt;very nice portal ncs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good portal&amp;nbsp;@hatsoff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output needed :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@nice&lt;/P&gt;
&lt;P&gt;#Greatwork&lt;/P&gt;
&lt;P&gt;@fake&amp;nbsp;&lt;/P&gt;
&lt;P&gt;null&lt;/P&gt;
&lt;P&gt;@hatsoff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 21:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289879#M59905</guid>
      <dc:creator>Attyslogin</dc:creator>
      <dc:date>2016-08-05T21:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to read specific information from Tweet data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289881#M59907</link>
      <description>&lt;P&gt;Look at the SCAN() function including the third parameter, which allows you specify the delimiter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 21:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289881#M59907</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-05T21:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to read specific information from Tweet data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289882#M59908</link>
      <description>can you show me the exact code ?</description>
      <pubDate>Fri, 05 Aug 2016 21:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289882#M59908</guid>
      <dc:creator>Attyslogin</dc:creator>
      <dc:date>2016-08-05T21:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to read specific information from Tweet data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289895#M59914</link>
      <description>&lt;P&gt;Here's a fully worked example. Specify your delimiters as needed, make sure to include spaces in there if required.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2016/07/11/break-sentence-into-words-sas.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2016/07/11/break-sentence-into-words-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think these will give you a NULL value, but if you really need it add in a check if the number of words is 0 then output a null record.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 21:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/289895#M59914</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-05T21:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to read specific information from Tweet data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/290125#M59995</link>
      <description>&lt;P&gt;A not to complex regular expression and call prxnext can solve the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.have;
   length lot $ 100;
   input;

   lot = trim(_infile_);

   datalines;
@nice#Greatwork@fake
very nice portal ncs 
Good portal @hatsoff
;
run;


data work.want;
   set work.have;
   length 
      word $ 100
      rx start p l 8
   ;
   retain rx;

   if _n_ = 1 then do;
      rx= prxparse('/([@#]\w+)/i');
   end;

   start = 1;
   
   call prxnext(rx, start, -1, lot, p, l);
   do while (p &amp;gt; 0);
      word = substr(lot, p, l);
      output;
      call prxnext(rx, start, -1, lot, p, l);
   end;

   if missing(word) then do;
      word = 'null';
      output;
   end;

   keep word;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Aug 2016 10:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-specific-information-from-Tweet-data/m-p/290125#M59995</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2016-08-08T10:31:22Z</dc:date>
    </item>
  </channel>
</rss>

