<?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: Indicator that Satisfies two Conditions in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956539#M42988</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if cmiss(of var_1-var_20)=19 and whichc('A10',of var_1-var_20)&amp;gt;0 then dummy=1;
    else dummy=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be that you are making your programming work difficult by creating a wide data set; in many cases creating a long data set with the same data is a lot easier to handle and program. Why? Because most SAS Procs are designed to work with long data sets. I urge you to explain the background of this problem, and what you are planning to do next once you have this dummy variable, so that we can advise further. We need to understand the big picture, not the tiny details of how to create the dummy variable.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jan 2025 17:50:51 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2025-01-18T17:50:51Z</dc:date>
    <item>
      <title>Indicator that Satisfies two Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956536#M42985</link>
      <description>&lt;P&gt;I have 20 variables and need to create an indicator that equals to 1 if one of the variables equals to A10 and the other 19 are empty. I have no idea how I would do it. Here is a data example with 5 variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="text_table_"&gt;
&lt;TABLE class="text_table" style="border-spacing: 0px;"&gt;
&lt;TBODY&gt;
&lt;TR class="text_table_tr" valign="top"&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;VAR_1&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;VAR_2&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;VAR_3&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;VAR_4&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;VAR_5&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;DUMMY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="text_table_tr" valign="top"&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;A10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;B10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" align="right" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="text_table_tr" valign="top"&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;A10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" align="right" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="text_table_tr" valign="top"&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;B10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;C10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" align="right" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="text_table_tr" valign="top"&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;A10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;B10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;C10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" align="right" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="text_table_tr" valign="top"&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;A10&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64px" height="27px" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;D10&lt;/TD&gt;
&lt;TD width="64px" height="27px" align="right" class="text_table_td" style="border-width: 0px; padding: 0px;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 18 Jan 2025 17:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956536#M42985</guid>
      <dc:creator>trevand</dc:creator>
      <dc:date>2025-01-18T17:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Indicator that Satisfies two Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956539#M42988</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if cmiss(of var_1-var_20)=19 and whichc('A10',of var_1-var_20)&amp;gt;0 then dummy=1;
    else dummy=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be that you are making your programming work difficult by creating a wide data set; in many cases creating a long data set with the same data is a lot easier to handle and program. Why? Because most SAS Procs are designed to work with long data sets. I urge you to explain the background of this problem, and what you are planning to do next once you have this dummy variable, so that we can advise further. We need to understand the big picture, not the tiny details of how to create the dummy variable.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2025 17:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956539#M42988</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-18T17:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Indicator that Satisfies two Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956541#M42989</link>
      <description>&lt;P&gt;Alternatively:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
dummy=(catx(',',of var:)='A10');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Jan 2025 18:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Indicator-that-Satisfies-two-Conditions/m-p/956541#M42989</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-01-18T18:11:21Z</dc:date>
    </item>
  </channel>
</rss>

