<?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: Finding each row which starts with a  particular string and extract the string between two strin in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493652#M32</link>
    <description>&lt;P&gt;Thanks a lot Richard.&amp;nbsp; This did the trick&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 21:10:42 GMT</pubDate>
    <dc:creator>sreevatsan1991</dc:creator>
    <dc:date>2018-09-07T21:10:42Z</dc:date>
    <item>
      <title>Finding each row which starts with a  particular string and extract the string between two strings</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493618#M27</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I am new to SAS programming. Just wondering if there is a Python for each loop equivalent in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a log file in text file format&amp;nbsp; in below pattern&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Table table_name1 created with 100 rows and 101 columns.&lt;/P&gt;&lt;P&gt;real time 0.14 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 343.43k&lt;BR /&gt;OS Memory 8412.00k&lt;BR /&gt;Timestamp 08/30/2018 07:40:29 AM&lt;BR /&gt;&lt;BR /&gt;NOTE: Table table_name2 created, with 473 rows and 80 columns.&lt;BR /&gt;real time 9.70 seconds&lt;BR /&gt;user cpu time 2.05 seconds&lt;BR /&gt;system cpu time 1.43 seconds&lt;BR /&gt;memory 270071.73k&lt;BR /&gt;OS Memory 279412.00k&lt;BR /&gt;Timestamp 08/31/2018 07:40:32 AM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So using Datastep&amp;nbsp;&lt;/P&gt;&lt;P&gt;how do i loop through each row and check for only the rows which starts with string "&lt;SPAN&gt;NOTE: Table" and keep only the table name and remove all other strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 20:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493618#M27</guid>
      <dc:creator>sreevatsan1991</dc:creator>
      <dc:date>2018-09-07T20:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Finding each row which starts with a  particular string and extract the string between two strin</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493626#M28</link>
      <description>&lt;P&gt;Give this a try, also be aware of the upper and lower case in your log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data logscan;
infile  "C:\your log file goes here\.log" truncover;
input a_line $200.;
if index(a_line, 'ERROR:') &amp;gt; 0 or
index(a_line, 'WARNING') &amp;gt; 0 or
index(a_line, 'NOTE')
then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Sep 2018 20:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493626#M28</guid>
      <dc:creator>mdavidson</dc:creator>
      <dc:date>2018-09-07T20:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Finding each row which starts with a  particular string and extract the string between two strin</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493629#M29</link>
      <description>&lt;P&gt;Hey there. Thanks a lot for your response. Sorry for my lack of clarity.&lt;BR /&gt;&lt;BR /&gt;I don't want&amp;nbsp; to extract only the line&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;NOTE: Table table_name1 created with 100 rows and 101 columns."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to replace the above line keeping only the table name.&lt;BR /&gt;&lt;BR /&gt;So my output should look like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;table_name1&lt;/P&gt;&lt;P&gt;real time 0.14 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 343.43k&lt;BR /&gt;OS Memory 8412.00k&lt;BR /&gt;Timestamp 08/30/2018 07:40:29 AM&lt;BR /&gt;&lt;BR /&gt;table_name2&lt;BR /&gt;real time 9.70 seconds&lt;BR /&gt;user cpu time 2.05 seconds&lt;BR /&gt;system cpu time 1.43 seconds&lt;BR /&gt;memory 270071.73k&lt;BR /&gt;OS Memory 279412.00k&lt;BR /&gt;Timestamp 08/31/2018 07:40:32 AM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your response!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 20:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493629#M29</guid>
      <dc:creator>sreevatsan1991</dc:creator>
      <dc:date>2018-09-07T20:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Finding each row which starts with a  particular string and extract the string between two strin</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493631#M30</link>
      <description>&lt;P&gt;If youre parsing a log I recommend PROC SCAPROC.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 20:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493631#M30</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-07T20:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Finding each row which starts with a  particular string and extract the string between two strin</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493644#M31</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/231626"&gt;@sreevatsan1991&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile 'path_to_your_logfile';
file 'path_to_text_file_to_be_created';
input;
if _infile_=:'NOTE: Table' then _infile_=scan(substr(_infile_,13),1);
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's possible to edit the log file in place, but I'd prefer the approach suggested above, i.e. creating a new text file containing the modified log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 21:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493644#M31</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-07T21:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding each row which starts with a  particular string and extract the string between two strin</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493652#M32</link>
      <description>&lt;P&gt;Thanks a lot Richard.&amp;nbsp; This did the trick&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 21:10:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Finding-each-row-which-starts-with-a-particular-string-and/m-p/493652#M32</guid>
      <dc:creator>sreevatsan1991</dc:creator>
      <dc:date>2018-09-07T21:10:42Z</dc:date>
    </item>
  </channel>
</rss>

