<?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 Add new variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27992#M3957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is possible, but can be more difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the result is to be numeric, you can do it as a 'formula" in the Advanced Expression part of the computed column.&amp;nbsp; To do that, you need to understand how columns are created in PROC SQL (because you are now writing a SQL expression).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also, potentially, do it as a two step process to create an intermediate variable.&amp;nbsp; This depends largely on what you want to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2011 17:45:47 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2011-07-08T17:45:47Z</dc:date>
    <item>
      <title>Add new variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27989#M3954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;I am new to Enterprise Guide. I am using version 4.2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;I created a project and opened a dataset. Because this dataset is pointing to a another location, I am not able to directly add a new variable to it. I'm assuming this is correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;So, I am using Query Builder where I add all the columns and would like to add some variables with conditions. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;For example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if column1=&lt;SPAN style="color: #800080;"&gt;'a'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;then&lt;/SPAN&gt; order=&lt;SPAN style="color: #800080;"&gt;'First'&lt;/SPAN&gt;;&lt;/P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt; column1=&lt;SPAN style="color: #800080;"&gt;'b'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;then&lt;/SPAN&gt; order=&lt;SPAN style="color: #800080;"&gt;'Second'&lt;/SPAN&gt;;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;So, I am creating a new varaible &lt;STRONG&gt;order&lt;/STRONG&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;How can I add a new variable (if-then-else statement) to an open dataset in my project?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 13:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27989#M3954</guid>
      <dc:creator>Tasha</dc:creator>
      <dc:date>2011-07-08T13:54:15Z</dc:date>
    </item>
    <item>
      <title>Add new variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27990#M3955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tasha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this with the Query Builder task.&amp;nbsp; It does not modify the original data; rather it builds a new data set or view with the added column.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click computed column and then select recode.&amp;nbsp; The help should take you from there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS for Dummies (second edition) covers this and more for EGuide 4.2 and 4.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 14:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27990#M3955</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-07-08T14:52:43Z</dc:date>
    </item>
    <item>
      <title>Add new variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27991#M3956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks this helped greatly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I use two variables from the dataset to create a new one? Is this possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 15:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27991#M3956</guid>
      <dc:creator>Tasha</dc:creator>
      <dc:date>2011-07-08T15:54:06Z</dc:date>
    </item>
    <item>
      <title>Add new variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27992#M3957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is possible, but can be more difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the result is to be numeric, you can do it as a 'formula" in the Advanced Expression part of the computed column.&amp;nbsp; To do that, you need to understand how columns are created in PROC SQL (because you are now writing a SQL expression).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also, potentially, do it as a two step process to create an intermediate variable.&amp;nbsp; This depends largely on what you want to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 17:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-new-variable/m-p/27992#M3957</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-07-08T17:45:47Z</dc:date>
    </item>
  </channel>
</rss>

