<?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 Something with IF/THEN. Yet, I'm a SAS dummy. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251074#M17736</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new here, as well as I'm quite new on SAS Enterprise Guide. I have a question about what I think should be an IF/THEN-statement, but since I'm still a noob, I don't know how to perform this statement correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column (let's call it COLUMNONE) with thousands of codes and a second column with codes (COLUMNTWO). What I would like to see is that if COLUMNONE contains a certain value, then that value should be replaced with the value stated in COLUMNTWO. If COLUMNONE does not contain that specific value (but something else), then nothing&amp;nbsp;should happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;COLUMNONE contains codes like 5.19.XXXXXXX or&amp;nbsp;6.07.XXXXXXX,&amp;nbsp;where X are random numbers.&amp;nbsp;Now,&amp;nbsp;if COLUMNONE has a code that starts with '5.19.' (what comes on the Xs is not&amp;nbsp;relevant),&amp;nbsp;then I want the&amp;nbsp;code that is stated in COLUMNTWO.&amp;nbsp;If COLUMNONE has a code other then starting with '5.19.' it's fine and no changes are needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please provide the steps&amp;nbsp;I need to take in order to perform this?? If you need any more information please ask!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2016 11:13:03 GMT</pubDate>
    <dc:creator>jenzie44</dc:creator>
    <dc:date>2016-02-19T11:13:03Z</dc:date>
    <item>
      <title>Something with IF/THEN. Yet, I'm a SAS dummy.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251074#M17736</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new here, as well as I'm quite new on SAS Enterprise Guide. I have a question about what I think should be an IF/THEN-statement, but since I'm still a noob, I don't know how to perform this statement correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column (let's call it COLUMNONE) with thousands of codes and a second column with codes (COLUMNTWO). What I would like to see is that if COLUMNONE contains a certain value, then that value should be replaced with the value stated in COLUMNTWO. If COLUMNONE does not contain that specific value (but something else), then nothing&amp;nbsp;should happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;COLUMNONE contains codes like 5.19.XXXXXXX or&amp;nbsp;6.07.XXXXXXX,&amp;nbsp;where X are random numbers.&amp;nbsp;Now,&amp;nbsp;if COLUMNONE has a code that starts with '5.19.' (what comes on the Xs is not&amp;nbsp;relevant),&amp;nbsp;then I want the&amp;nbsp;code that is stated in COLUMNTWO.&amp;nbsp;If COLUMNONE has a code other then starting with '5.19.' it's fine and no changes are needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please provide the steps&amp;nbsp;I need to take in order to perform this?? If you need any more information please ask!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 11:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251074#M17736</guid>
      <dc:creator>jenzie44</dc:creator>
      <dc:date>2016-02-19T11:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Something with IF/THEN. Yet, I'm a SAS dummy.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251075#M17737</link>
      <description>&lt;P&gt;If get you logic correctly:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you are using the query builder in EG, you need to think SQL case-when-then-else instead. For this, there is a kind of point-and-click interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using progamming with the data step (untested):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if substr(columnone,1,4) = '5,19' then columnone = cats(substr(columntwo,1,4),substr(columnsone,5));
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 11:19:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251075#M17737</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-19T11:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Something with IF/THEN. Yet, I'm a SAS dummy.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251078#M17738</link>
      <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it also possible to build this through the computed column editor (advanced expression)?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 11:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251078#M17738</guid>
      <dc:creator>jenzie44</dc:creator>
      <dc:date>2016-02-19T11:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Something with IF/THEN. Yet, I'm a SAS dummy.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251107#M17739</link>
      <description>&lt;P&gt;Try to add&amp;nbsp;an advanced expression in the Expression editor &amp;nbsp;like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case 
 when substr(t1.columnone,1,4)= '5,19' then t1.columntwo
 else t1.columnone
end&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The query builder will add the "AS&amp;nbsp;&lt;EM&gt;newcolumnname&lt;/EM&gt;" at the end to create your new calculated column&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 13:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251107#M17739</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-02-19T13:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Something with IF/THEN. Yet, I'm a SAS dummy.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251116#M17742</link>
      <description>&lt;P&gt;Great. Thanks. It works!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 13:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Something-with-IF-THEN-Yet-I-m-a-SAS-dummy/m-p/251116#M17742</guid>
      <dc:creator>jenzie44</dc:creator>
      <dc:date>2016-02-19T13:54:54Z</dc:date>
    </item>
  </channel>
</rss>

