<?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: code clarification? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125638#M34540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'2E'x is a period and '0D'x is a carriage return. Perhaps it is looking for a period at the end of line?&amp;nbsp; Although that would assume that log was written on Windows and then re-read on Unix or with settings to prevent SAS from stripping the CR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked briefly at the code in the paper and it is probably not going to find all of the error messages.&lt;/P&gt;&lt;P&gt;Normally I search for lines that &lt;STRONG&gt;start&lt;/STRONG&gt; with ERROR.&amp;nbsp; This will eliminate many false positives caused by MPRINT, SOURCE or SOURCE2 settings echoing the source code to the log.&amp;nbsp; Also SAS can sometimes insert text between the ERROR at the beginning of the line and colon (':') before the error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2012 19:12:13 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-09-19T19:12:13Z</dc:date>
    <item>
      <title>code clarification?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125636#M34538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Times New Roman;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;pos = index(intext, '2E0D'X) ;&lt;/P&gt;&lt;P align="left"&gt;what is '2E0D'X? (is error hexadecimal coded?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;txt = substr(intext, 8, pos - &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from this paper.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2008/CC-037.pdf"&gt;http://analytics.ncsu.edu/sesug/2008/CC-037.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 16:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125636#M34538</guid>
      <dc:creator>sassharp</dc:creator>
      <dc:date>2012-09-19T16:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: code clarification?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125637#M34539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that is searching for a "right raised omission bracket", probably in an HTML file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is described at: &lt;A href="http://www.htmlescape.net/2e/unicode_char_2e0d.html" title="http://www.htmlescape.net/2e/unicode_char_2e0d.html"&gt;Unicode char 2e0d&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 16:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125637#M34539</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-19T16:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: code clarification?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125638#M34540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'2E'x is a period and '0D'x is a carriage return. Perhaps it is looking for a period at the end of line?&amp;nbsp; Although that would assume that log was written on Windows and then re-read on Unix or with settings to prevent SAS from stripping the CR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked briefly at the code in the paper and it is probably not going to find all of the error messages.&lt;/P&gt;&lt;P&gt;Normally I search for lines that &lt;STRONG&gt;start&lt;/STRONG&gt; with ERROR.&amp;nbsp; This will eliminate many false positives caused by MPRINT, SOURCE or SOURCE2 settings echoing the source code to the log.&amp;nbsp; Also SAS can sometimes insert text between the ERROR at the beginning of the line and colon (':') before the error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 19:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125638#M34540</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-09-19T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: code clarification?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125639#M34541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Realised this is almost a year-old thread, but think it's worth replying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom, I think you are right, it does indeed search for combination of the full stop and carriage return. Unfortunately, in some cases error goes onto a new line, which would break this macro a little. Also good spot on the environment differences, was sure to baffle me for a while.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to augment/change code a bit, so that it could read multiple log lines, if any of the text triggers have been encountered.&lt;/P&gt;&lt;P&gt;Not really sure how, without reading heaps of sugi docs -- so if you have any pointers on this front, or have any more elegant solutions that would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 19:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125639#M34541</guid>
      <dc:creator>DannyT</dc:creator>
      <dc:date>2013-07-09T19:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: code clarification?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125640#M34542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if that helps anyone, but I, inspired by the paper wrote something which i think is slightly more robust at picking up errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;USAGE: %de_log(full-file-path);&lt;/P&gt;&lt;P&gt;EXAMPLE: %de_log(c:\temp\saved_log.log);&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro de_log(logfile);&lt;/P&gt;&lt;P&gt;option nomprint;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename log "&amp;amp;logfile";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data de_log_output (drop=line_txt);&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain nline 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length line_txt FULL_TEXT $ 1000 TYPE $ 10 SUB_TYPE $ 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile infl lrecl=200 pad;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; nline+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if substr(_infile_, 1, 5) = "ERROR"&lt;/P&gt;&lt;P&gt;&amp;nbsp; or substr(_infile_, 1, 7) = "WARNING"&lt;/P&gt;&lt;P&gt;&amp;nbsp; or substr(_infile_, 1, 4) = "NOTE"&lt;/P&gt;&lt;P&gt;&amp;nbsp; then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; line_txt = _infile_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if substr(_infile_, length(_infile_), 1) ne '2E'x then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; line_txt = _infile_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (substr(_infile_, length(_infile_), 1) ne '2E'x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; input /@;&lt;/P&gt;&lt;P&gt;&amp;nbsp; line_txt=catx(" ", line_txt, _infile_);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; line_txt =_infile_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*exclude non-error notes*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; if substr(line_txt, 1, 4) = "NOTE"&lt;/P&gt;&lt;P&gt;&amp;nbsp; and (index(line_txt, 'The data set')=0&lt;/P&gt;&lt;P&gt;&amp;nbsp; or index(line_txt, 'has 0 observations')=0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; then delete;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*define type and subtype*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; TYPE = compress(scan(line_txt, 1, " "), ":");&lt;/P&gt;&lt;P&gt;&amp;nbsp; if index(line_txt, ",") and not(index(line_txt, "DROP,")) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB_TYPE = substr(scan(line_txt, 1, ","), index(line_txt, ":") +2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if index(line_txt, "0 observations") then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB_TYPE = "Incomplete dataset (obs=0)";&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if index(line_txt, "Multiple lengths were specified for the BY variable")&lt;/P&gt;&lt;P&gt;&amp;nbsp; then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB_TYPE = "BY variables have inconsistent LENGTHS";&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if index(line_txt, "The quoted string currently being processed") then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB_TYPE = "Unbalanced quote marks?";&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if index(line_txt, "Invalid data set name") then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB_TYPE = "No / invalid dataset name";&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if index(line_txt, "has never been referenced") then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB_TYPE = "Keeping, dropping or renaming non-existent variable";&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else SUB_TYPE = "Other";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_TEXT = line_txt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort&lt;/P&gt;&lt;P&gt;&amp;nbsp; data=de_log_output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by TYPE SUB_TYPE;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary&lt;/P&gt;&lt;P&gt;&amp;nbsp; data=de_log_output&lt;/P&gt;&lt;P&gt;&amp;nbsp; noprint nway n;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class TYPE SUB_TYPE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output&lt;/P&gt;&lt;P&gt;&amp;nbsp; out=de_log_summary (drop=_TYPE_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;option mprint;&lt;/P&gt;&lt;P&gt;%mend de_log;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 10:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/code-clarification/m-p/125640#M34542</guid>
      <dc:creator>DannyT</dc:creator>
      <dc:date>2013-07-15T10:21:12Z</dc:date>
    </item>
  </channel>
</rss>

