<?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: Multiple variables with null values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527890#M5325</link>
    <description>&lt;P&gt;If your description that only one of the trt variables has value then this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  array t{10} trtb3 trtgh trte8 &amp;lt;finish the list&amp;gt;;
  trt_date = max( of t(*));
  format trt_date mmddyy10.;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Jan 2019 23:28:57 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-01-16T23:28:57Z</dc:date>
    <item>
      <title>Multiple variables with null values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527885#M5323</link>
      <description>&lt;P&gt;I am working with a dataset that has a about 10 variables for different treatments. If a patient underwent a particular treatment, then that treatment's variable has a date and the rest of the treatment variables are null. I want to make a new variable so that whichever treatment a patient underwent, the corresponding value is posted to a new variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Obs&amp;nbsp; TrtA&amp;nbsp; &amp;nbsp; &amp;nbsp;TrtB3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TrtGh&amp;nbsp; &amp;nbsp; &amp;nbsp;TrtE8&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;01/01/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01/04/2019&amp;nbsp; &amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01/12/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want the output to look like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Obs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Trt_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/01/2019&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/04/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/12/2019&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am completely stuck after trying multiple if statements, treating each variable individually and together, and nothing is working. Please help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 23:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527885#M5323</guid>
      <dc:creator>dikshar</dc:creator>
      <dc:date>2019-01-16T23:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple variables with null values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527888#M5324</link>
      <description>&lt;P&gt;Have you tried the COALESCE() function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189518"&gt;@dikshar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am working with a dataset that has a about 10 variables for different treatments. If a patient underwent a particular treatment, then that treatment's variable has a date and the rest of the treatment variables are null. I want to make a new variable so that whichever treatment a patient underwent, the corresponding value is posted to a new variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Obs&amp;nbsp; TrtA&amp;nbsp; &amp;nbsp; &amp;nbsp;TrtB3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TrtGh&amp;nbsp; &amp;nbsp; &amp;nbsp;TrtE8&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;01/01/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01/04/2019&amp;nbsp; &amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01/12/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want the output to look like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Obs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Trt_date&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/01/2019&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/04/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/12/2019&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am completely stuck after trying multiple if statements, treating each variable individually and together, and nothing is working. Please help!&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 23:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527888#M5324</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T23:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple variables with null values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527890#M5325</link>
      <description>&lt;P&gt;If your description that only one of the trt variables has value then this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  array t{10} trtb3 trtgh trte8 &amp;lt;finish the list&amp;gt;;
  trt_date = max( of t(*));
  format trt_date mmddyy10.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 23:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-variables-with-null-values/m-p/527890#M5325</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-16T23:28:57Z</dc:date>
    </item>
  </channel>
</rss>

