<?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: Conditions in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619084#M19334</link>
    <description>&lt;P&gt;Please post a more descriptive sample of your code, so we can see the conditions. Right now I have no idea what you want to simplify.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 10:18:42 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-22T10:18:42Z</dc:date>
    <item>
      <title>Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619078#M19332</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does someone know how to replace a series of conditions as below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if toto ne 0 then a = '1'; else a = '0';
if tutu ne 0 than b = '1'; else b = '0';
if titi ne 0 then c = '1'; else c = '0';
if tata ne 0 than d = '1'; else d = '0';
if tete ne 0 than e = '1'; else e = '0';&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much and have a good journey&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 10:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619078#M19332</guid>
      <dc:creator>SassienFuté</dc:creator>
      <dc:date>2020-01-22T10:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619084#M19334</link>
      <description>&lt;P&gt;Please post a more descriptive sample of your code, so we can see the conditions. Right now I have no idea what you want to simplify.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 10:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619084#M19334</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-22T10:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619092#M19335</link>
      <description>Thank for your message KurtBremser. I just modified my post.</description>
      <pubDate>Wed, 22 Jan 2020 10:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619092#M19335</guid>
      <dc:creator>SassienFuté</dc:creator>
      <dc:date>2020-01-22T10:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619096#M19336</link>
      <description>&lt;P&gt;OK, so the statements are the same, only variables change.&lt;/P&gt;
&lt;P&gt;Use arrays:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input toto tutu titi tata tete;
datalines;
1 1 0 1 0
;

data want;
set have;
array in {*} toto tutu titi tata tete;
array out {*} $ a b c d e;
do i = 1 to dim(in);
  out{i} = ifc(in{i} ne 0,'1','0');
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The ifc() function is a simplification of your if/then/else.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 10:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditions/m-p/619096#M19336</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-22T10:36:55Z</dc:date>
    </item>
  </channel>
</rss>

