<?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: logical operators in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510762#M137461</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154084"&gt;@capam&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks like an opportunity to use the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1s3cxiitukk55n18if88g2djqzs.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;BAND function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input (arg1 arg2) (:binary.);
format arg: binary6.;
cards;
1 111110
1 111111
100 111111
100110 111111
11100 111011
;

data want;
set have;
result=input(put(band(arg1, arg2),binary6.),6.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt; arg1      arg2     result

000001    111110         0
000001    111111         1
000100    111111       100
100110    111111    100110
011100    111011     11000&lt;/PRE&gt;
&lt;P&gt;Note that I've converted the result to decimal numbers in order to get rid of the leading zeros. For further processing as binary values, however, you should use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;band(arg1, arg2)&lt;/FONT&gt;&amp;nbsp;without &lt;FONT face="courier new,courier"&gt;input(put(...))&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 15:03:41 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-11-06T15:03:41Z</dc:date>
    <item>
      <title>logical operators</title>
      <link>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510758#M137456</link>
      <description>&lt;P&gt;I'm trying to solve a logical problem:&lt;/P&gt;&lt;P&gt;two binary inputs with up to 6 digits starting from right to left.&lt;BR /&gt;Example inputs are below. Note that the sas table has them right justified.&lt;/P&gt;&lt;P&gt;100&lt;BR /&gt;1001&lt;BR /&gt;101111&lt;BR /&gt;111111&lt;BR /&gt;111000&lt;BR /&gt;100000&lt;BR /&gt;100000&lt;BR /&gt;110&lt;BR /&gt;110&lt;BR /&gt;110111&lt;BR /&gt;11100&lt;BR /&gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output I'm looking for is based on an AND operator as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;operator(1,111110) =&amp;nbsp;0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;operator(1,111111) =&amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;operator(100,111111) = 100&lt;BR /&gt;operator(100110,111111) = 100110&lt;BR /&gt;operator(11100,111011) = 11000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your time and help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 14:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510758#M137456</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2018-11-06T14:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: logical operators</title>
      <link>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510761#M137460</link>
      <description>&lt;P&gt;Your input displays one variable.&lt;/P&gt;
&lt;P&gt;Each of your operators use two arguments. where from are those arguments taken?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the logic of your operators ?&lt;/P&gt;
&lt;P&gt;Your input includes a number 100000 which is not of any operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not clear what you want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 14:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510761#M137460</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-06T14:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: logical operators</title>
      <link>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510762#M137461</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154084"&gt;@capam&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks like an opportunity to use the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1s3cxiitukk55n18if88g2djqzs.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;BAND function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input (arg1 arg2) (:binary.);
format arg: binary6.;
cards;
1 111110
1 111111
100 111111
100110 111111
11100 111011
;

data want;
set have;
result=input(put(band(arg1, arg2),binary6.),6.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt; arg1      arg2     result

000001    111110         0
000001    111111         1
000100    111111       100
100110    111111    100110
011100    111011     11000&lt;/PRE&gt;
&lt;P&gt;Note that I've converted the result to decimal numbers in order to get rid of the leading zeros. For further processing as binary values, however, you should use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;band(arg1, arg2)&lt;/FONT&gt;&amp;nbsp;without &lt;FONT face="courier new,courier"&gt;input(put(...))&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 15:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510762#M137461</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-06T15:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: logical operators</title>
      <link>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510769#M137463</link>
      <description>Hi,&lt;BR /&gt;The source is a table which contains 2 variables of interest which have the same general construct of binary digits that may be up to 6 digits in length.&lt;BR /&gt;They are to be multiplied according to an AND operator as shown in the text.</description>
      <pubDate>Tue, 06 Nov 2018 15:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/logical-operators/m-p/510769#M137463</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2018-11-06T15:01:58Z</dc:date>
    </item>
  </channel>
</rss>

