<?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 SAS Macro passing multiple variables in Developers</title>
    <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713533#M1088</link>
    <description>&lt;P&gt;I am trying to create a macro surrounding the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if put(dx1,$oudfmt.) = '1'&lt;BR /&gt;then&lt;BR /&gt;ED_OUD_flag = 1 ;&lt;BR /&gt;else&lt;BR /&gt;ED_OUD_flag = 0 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 87 diagnoses codes and want to create a macro that passes the 87 variables and set my flag based on a format.&amp;nbsp; I have tried numerous things and am a little weary right now, and help is greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jan 2021 00:06:16 GMT</pubDate>
    <dc:creator>gstover</dc:creator>
    <dc:date>2021-01-23T00:06:16Z</dc:date>
    <item>
      <title>SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713533#M1088</link>
      <description>&lt;P&gt;I am trying to create a macro surrounding the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if put(dx1,$oudfmt.) = '1'&lt;BR /&gt;then&lt;BR /&gt;ED_OUD_flag = 1 ;&lt;BR /&gt;else&lt;BR /&gt;ED_OUD_flag = 0 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 87 diagnoses codes and want to create a macro that passes the 87 variables and set my flag based on a format.&amp;nbsp; I have tried numerous things and am a little weary right now, and help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 00:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713533#M1088</guid>
      <dc:creator>gstover</dc:creator>
      <dc:date>2021-01-23T00:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713539#M1089</link>
      <description>&lt;P&gt;No macro is needed. Use arrays instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array dx (*) dx1 - dx87;
  array ED_OUD_flag (*) ED_OUD_flag1 - ED_OUD_flag87;
  do i = 1 to dim(dx);
   ED_OUD_flag(i) = (put(dx(i),$oudfmt.) = '1');
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 01:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713539#M1089</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-23T01:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713540#M1090</link>
      <description>&lt;P&gt;Thank you! This works great, however I would like only one ED_OUD_flag, is there a way to do this?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 01:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713540#M1090</guid>
      <dc:creator>gstover</dc:creator>
      <dc:date>2021-01-23T01:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713542#M1091</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338824"&gt;@gstover&lt;/a&gt;&amp;nbsp; - So what is your logic then? Do all 87 dx variables have to be equal to 1 to set&amp;nbsp;ED_OUD_flag to 1?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 01:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713542#M1091</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-23T01:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713543#M1092</link>
      <description>Correct. 1 if it hits the format, or 0 if it's not in the format</description>
      <pubDate>Sat, 23 Jan 2021 01:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713543#M1092</guid>
      <dc:creator>gstover</dc:creator>
      <dc:date>2021-01-23T01:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713545#M1093</link>
      <description>&lt;P&gt;Try this (untested):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array dx (*) dx1 - dx87;
  do i = 1 to dim(dx);
   ED_OUD_flags + (put(dx(i),$oudfmt.) = '1');
  end;
  ED_OUD_flag = (ED_OUD_flags = 87);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Jan 2021 01:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/713545#M1093</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-23T01:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro passing multiple variables</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/715447#M1099</link>
      <description>&lt;P&gt;Wanted to share my final successful code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;array dx (*) dx1 - dx80;&lt;BR /&gt;&amp;nbsp;do i = 1 to dim(dx);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if (put(dx(i),$odfmt.) = '1')&lt;BR /&gt;&amp;nbsp;then ED_OD_FLAG = 1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;end ;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked very well - thank you so much for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 19:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Macro-passing-multiple-variables/m-p/715447#M1099</guid>
      <dc:creator>gstover</dc:creator>
      <dc:date>2021-01-29T19:57:56Z</dc:date>
    </item>
  </channel>
</rss>

