<?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: DIVISÃO MODULO in Forum em português</title>
    <link>https://communities.sas.com/t5/Forum-em-portugu%C3%AAs/DIVIS%C3%83O-MODULO/m-p/826910#M1150</link>
    <description>&lt;P&gt;I am not aware of a modulo operator, but there is a modulo function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    z=12;
    x=mod(z,5);
    put (_all_) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should add that the above will be consistent with the % python operator only for positive numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want faithful replication of the % operator (as described&amp;nbsp;&lt;A href="https://realpython.com/python-modulo-operator/" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;) you would apparently need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;     x=mod(z - (5 * floor(z/5);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or more generally&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  x=    z - (n * floor(z/n));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 17:14:16 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2022-08-03T17:14:16Z</dc:date>
    <item>
      <title>DIVISÃO MODULO</title>
      <link>https://communities.sas.com/t5/Forum-em-portugu%C3%AAs/DIVIS%C3%83O-MODULO/m-p/826904#M1149</link>
      <description>&lt;P&gt;Ola pessoal...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Estou com uma dúvida simples, porém até agora não localizei como resolver.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No Python e SQL, possuímos o operador (%) para realizar divisões e obter apenas a parte inteira (Módulo), contudo, no SAS, ainda não identifiquei qual operador utilizar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exemplo:&lt;/P&gt;&lt;P&gt;12%5 = 2&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 15:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Forum-em-portugu%C3%AAs/DIVIS%C3%83O-MODULO/m-p/826904#M1149</guid>
      <dc:creator>RxJunior</dc:creator>
      <dc:date>2022-08-03T15:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: DIVISÃO MODULO</title>
      <link>https://communities.sas.com/t5/Forum-em-portugu%C3%AAs/DIVIS%C3%83O-MODULO/m-p/826910#M1150</link>
      <description>&lt;P&gt;I am not aware of a modulo operator, but there is a modulo function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    z=12;
    x=mod(z,5);
    put (_all_) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should add that the above will be consistent with the % python operator only for positive numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want faithful replication of the % operator (as described&amp;nbsp;&lt;A href="https://realpython.com/python-modulo-operator/" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;) you would apparently need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;     x=mod(z - (5 * floor(z/5);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or more generally&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  x=    z - (n * floor(z/n));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 17:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Forum-em-portugu%C3%AAs/DIVIS%C3%83O-MODULO/m-p/826910#M1150</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-08-03T17:14:16Z</dc:date>
    </item>
  </channel>
</rss>

