<?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 when MSGlevel=1 is used and how is it used? How to reset? Where to add? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250884#M47332</link>
    <description>&lt;P&gt;Would anybody provide a sample code? I only see someone mentioned it, but when i add "options msglevel-1", it always shows error.&lt;/P&gt;&lt;P&gt;Can anybody show a sample code? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2016 16:45:21 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2016-02-18T16:45:21Z</dc:date>
    <item>
      <title>when MSGlevel=1 is used and how is it used? How to reset? Where to add?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250884#M47332</link>
      <description>&lt;P&gt;Would anybody provide a sample code? I only see someone mentioned it, but when i add "options msglevel-1", it always shows error.&lt;/P&gt;&lt;P&gt;Can anybody show a sample code? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 16:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250884#M47332</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-02-18T16:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: when MSGlevel=1 is used and how is it used? How to reset? Where to add?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250887#M47333</link>
      <description>&lt;P&gt;You get an error as it should be:&lt;/P&gt;
&lt;P&gt;options msglevel=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options msglevel-1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For use check the SAS docs:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000279149.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000279149.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 16:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250887#M47333</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-18T16:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: when MSGlevel=1 is used and how is it used? How to reset? Where to add?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250888#M47334</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I did write it wrong. But actually I did get an error message below. This is the reason why I am asking for a sample code. Thanks.&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;961 options msglevel=1;&lt;BR /&gt;--------&lt;BR /&gt;14&lt;BR /&gt;ERROR 14-12: Invalid option value 1 for SAS option MSGLEVEL.&lt;BR /&gt;962&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 17:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250888#M47334</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-02-18T17:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: when MSGlevel=1 is used and how is it used? How to reset? Where to add?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250889#M47335</link>
      <description>&lt;P&gt;I think you are confusing 1 and I as in&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;33         proc options option=msglevel define expand;
34            run;

    SAS (r) Proprietary Software Release 9.4  TS1M3

 MSGLEVEL=N
Option Definition Information for SAS Option MSGLEVEL
    Group= LOGCONTROL
    Group Description: LOGCONTROL
    Description: Specifies the level of detail in SAS log messages.
    Type: The option value is of type CHARACTER
          Maximum Number of Characters: 1
          Casing: The option value is retained uppercased
          Quotes: If present during "set", start and end quotes are removed
          Parentheses: The option value cannot be enclosed within parentheses.
          Expansion: Environment variables, within the option value, are not expanded
          Number of valid values: 2
               Valid value: I
               Valid value: N
    When Can Set: Startup or anytime during the SAS Session
    Restricted: Your Site Administrator can restrict modification of this option
    Optsave: PROC Optsave or command Dmoptsave will save this option&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Feb 2016 17:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250889#M47335</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-18T17:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: when MSGlevel=1 is used and how is it used? How to reset? Where to add?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250924#M47338</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40773"&gt;@Bal23﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I set &lt;FONT face="courier new,courier"&gt;msglevel=I&lt;/FONT&gt; in my autoexec.sas, primarily because I want to see the "INFO" messages from MERGE statements about (inadvertently) overwritten variables. These would not occur in the log with the default setting &lt;FONT face="courier new,courier"&gt;msglevel=N&lt;/FONT&gt;. Here is an example that shows why this can be useful (please focus on the&amp;nbsp;third&amp;nbsp;datastep):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options msglevel=I;

data test1;
do a=1 to 3;
  do _n_=1 to 3;
    b=a/10;
    output;
  end;
end;
proc print;
run;

data test2;
input a b;
cards;
1 10
2 20
3 30
;

data new;
merge test1
      test2;
by a;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks to the option setting, the log for the last data step contains the following message:&lt;/P&gt;
&lt;PRE&gt;INFO: The variable b on data set WORK.TEST1 will be overwritten by data set WORK.TEST2.&lt;/PRE&gt;
&lt;P&gt;This makes me aware that possibly something unwanted has happened with variable b. As you can see, the value of b in the first observation of each BY group has been updated ("overwritten") with the value from dataset TEST2, but the remaining observations still have their old value from TEST1. This mixture of old and new values was most likely not intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, typically you would strive to avoid this INFO message, although &lt;FONT face="courier new,courier"&gt;msglevel=I&lt;/FONT&gt;, by careful programming. In the example above&amp;nbsp;it could make sense to add the &lt;FONT face="courier new,courier"&gt;(drop=b)&lt;/FONT&gt; dataset option to &lt;FONT face="courier new,courier"&gt;test1&lt;/FONT&gt;&amp;nbsp;in the last data step (depending on the intended&amp;nbsp;result).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the rare occasions where the overwriting is acceptable &lt;EM&gt;and&lt;/EM&gt; the INFO message cannot be avoided otherwise for some reason, you may want to set&lt;FONT face="courier new,courier"&gt;&amp;nbsp;msglevel=N&amp;nbsp;&lt;/FONT&gt;for the affected part of the program (and reset it to &lt;FONT face="courier new,courier"&gt;I&lt;/FONT&gt; afterwards).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 19:15:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-MSGlevel-1-is-used-and-how-is-it-used-How-to-reset-Where-to/m-p/250924#M47338</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-18T19:15:26Z</dc:date>
    </item>
  </channel>
</rss>

