<?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: Simplifying IF_THEN STATEMENTS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543705#M7751</link>
    <description>&lt;P&gt;A single transpose step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want(where=(col1)) name=federal;
by studynum;
var medicaid -- tricare;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 16 Mar 2019 04:42:32 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-03-16T04:42:32Z</dc:date>
    <item>
      <title>Simplifying IF_THEN STATEMENTS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543677#M7742</link>
      <description>&lt;P&gt;I am trying to create a variable called Federal_Insurance which, contains the variables, Medicaid, Medicare, Workmanscomp, Tricare. Each of those insurance types is its own variable. Is there any way I can create variable "Federal" without saying if MEdicaid=1 and Medicare=1 and so on.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;studynum &amp;nbsp; &amp;nbsp;Medicaid &amp;nbsp; Medicaid&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 22:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543677#M7742</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2019-03-15T22:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying IF_THEN STATEMENTS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543678#M7743</link>
      <description>&lt;P&gt;What is the logic behind the creation of&amp;nbsp;&lt;STRONG&gt;Federal_Insurance&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;&lt;SPAN&gt;MEdicaid=1 and Medicare=1 and&amp;nbsp;Workmanscomp=1 and Tricare=1 then what? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 23:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543678#M7743</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-15T23:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying IF_THEN STATEMENTS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543685#M7746</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Federal_Insurance&lt;/SPAN&gt; = compress(&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Medicaid||Medicare||Workmanscomp||Tricare);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;if you have 1 and 0's this will give you:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;1000 = medicaid&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;0100 = medicare&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;1100 = Medicaid and meidicare&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;and so on;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2019 00:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543685#M7746</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-16T00:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying IF_THEN STATEMENTS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543694#M7750</link>
      <description>&lt;P&gt;1. Create an array for the list of variables&lt;/P&gt;
&lt;P&gt;2. Use WHICHN() to get the index of the variable with a 1&lt;/P&gt;
&lt;P&gt;3. Use VNAME () to get the name of the column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this approach it doesn't matter how many programTypes you have and you don't need any IF statements. If the variable names are not exactly what you want, you may need to recode them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array programTypes(*) medicaid medicare WCB Tricare;

index = whichn(1, of programTypes(*));
Program_Type = vname(programTypes(index));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78398"&gt;@stancemcgraw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to create a variable called Federal_Insurance which, contains the variables, Medicaid, Medicare, Workmanscomp, Tricare. Each of those insurance types is its own variable. Is there any way I can create variable "Federal" without saying if MEdicaid=1 and Medicare=1 and so on.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;studynum &amp;nbsp; &amp;nbsp;Medicaid &amp;nbsp; Medicaid&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2019 02:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543694#M7750</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-16T02:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying IF_THEN STATEMENTS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543705#M7751</link>
      <description>&lt;P&gt;A single transpose step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want(where=(col1)) name=federal;
by studynum;
var medicaid -- tricare;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Mar 2019 04:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/543705#M7751</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-03-16T04:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying IF_THEN STATEMENTS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/544033#M7792</link>
      <description>&lt;P&gt;Indian Health Service also perhaps?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 16:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplifying-IF-THEN-STATEMENTS/m-p/544033#M7792</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-18T16:35:58Z</dc:date>
    </item>
  </channel>
</rss>

