<?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: Creating a new variable based on if cells corresponding to another variable are empty or not in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850491#M336129</link>
    <description>&lt;P&gt;So just to be clear, I asked for the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; LOG, not the code. You can't say there was a syntax error, and then not show us the exact error in the log. Just to be clear, I want the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; LOG, not just the errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, I am going to skip the explanation here. I think you need to do this through menus, or just take a few steps backwards and learn the basics of how to write data steps and how to use LIBNAMES. That type of beginner learning is best done through some sort of training (and there is plenty available), rather than by someone trying to explain all of this in the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2022 16:02:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-12-20T16:02:27Z</dc:date>
    <item>
      <title>Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850478#M336121</link>
      <description>&lt;P&gt;I am an extremely novice SAS Enterprise user. I have a set of data that includes the dates that patients died as the variable "death date". If a patient has died, the data when this occurred is displayed. If a patient is still alive, the cell is empty. I would like to create a new variable called "alive" with 1 indicating that the patient is still alive and 0 indicating that the patient has passed away. Could someone please help?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850478#M336121</guid>
      <dc:creator>sasso</dc:creator>
      <dc:date>2022-12-20T15:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850479#M336122</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am an extremely novice SAS Enterprise user.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you mean SAS Enterprise Guide, or SAS Enterprise Miner? These are not the same.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And do you want code to do this, or do you want to use the menu system in either software to achieve this result?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(death_date) then alive=1; else alive=0;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:11:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850479#M336122</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-20T15:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850481#M336123</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, thank you for your response. I am using SAS Enterprise Guide. The code is helpful. How would I use the menu system to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:14:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850481#M336123</guid>
      <dc:creator>sasso</dc:creator>
      <dc:date>2022-12-20T15:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850482#M336124</link>
      <description>&lt;P&gt;I don't know how to do this in the menu system, but I'm sure someone will come along who does know!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850482#M336124</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-20T15:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850483#M336125</link>
      <description>&lt;P&gt;I received a syntax error when I tried to use the code. How do I extrapolate the code to all patients? I want to ensure that this variable appears next to the other variables in the file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850483#M336125</guid>
      <dc:creator>sasso</dc:creator>
      <dc:date>2022-12-20T15:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850485#M336127</link>
      <description>&lt;P&gt;A syntax error happened? You need to show us the LOG for this code, otherwise we don't know what error it was. We need to see the entire log for this DATA step or PROC, not selected parts of the log.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:39:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850485#M336127</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-20T15:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850489#M336128</link>
      <description>&lt;P&gt;Sorry, here is the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-12-20 16_43_58-Window.png" style="width: 970px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78758iCE3B9D26A79E9E20/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-12-20 16_43_58-Window.png" alt="2022-12-20 16_43_58-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the output that I get - one cell for death_date with the newly created variable of whether the patient is alive. However, this does not appear for all patients and is not inserted into the original datasheet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-12-20 16_45_40-Window.png" style="width: 825px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78759i4282B53444777D8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-12-20 16_45_40-Window.png" alt="2022-12-20 16_45_40-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 15:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850489#M336128</guid>
      <dc:creator>sasso</dc:creator>
      <dc:date>2022-12-20T15:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new variable based on if cells corresponding to another variable are empty or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850491#M336129</link>
      <description>&lt;P&gt;So just to be clear, I asked for the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; LOG, not the code. You can't say there was a syntax error, and then not show us the exact error in the log. Just to be clear, I want the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; LOG, not just the errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, I am going to skip the explanation here. I think you need to do this through menus, or just take a few steps backwards and learn the basics of how to write data steps and how to use LIBNAMES. That type of beginner learning is best done through some sort of training (and there is plenty available), rather than by someone trying to explain all of this in the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 16:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-new-variable-based-on-if-cells-corresponding-to/m-p/850491#M336129</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-20T16:02:27Z</dc:date>
    </item>
  </channel>
</rss>

