<?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 Computed Column in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698537#M25532</link>
    <description>Thanks so much. Appreciate all your help. Really new at this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 12 Nov 2020 21:28:39 GMT</pubDate>
    <dc:creator>NewToAllThis</dc:creator>
    <dc:date>2020-11-12T21:28:39Z</dc:date>
    <item>
      <title>Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698471#M25504</link>
      <description>Hi, I am trying to create a computed column that will return the value of a selected column unless it contains a specific value ‘n’ . In the case of ‘n’, I want it to return the value in another column in the same data set. I have tried to use the IFC function but I am getting an error message saying it needs to be a numeric value which ‘n’ is not. Appreciate any help, fairly new to this.&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Thu, 12 Nov 2020 18:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698471#M25504</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T18:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698475#M25507</link>
      <description>&lt;P&gt;Please post the complete log from that step. Use the &amp;lt;/&amp;gt; button to open a window into which you copy/paste the log text.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 18:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698475#M25507</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T18:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698481#M25510</link>
      <description>&lt;PRE&gt;1                                                          The SAS System                          16:01 Thursday, November 12, 2020

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          PROC SQL NOEXEC;
4             SELECT t1.G1ZWCG,
5                    t1.G1UEDT LABEL="FIP Created Date" AS G1UEDT,
6                    t1.G1PDVC LABEL="FIP Plan Amount" AS G1PDVC,
7                    t1.G1AAVN LABEL="FIP Created By" AS G1AAVN,
8                    t1.G1PZTA LABEL="WEBCOLLS Created By" AS G1PZTA,
9                    t1.n9e5cd LABEL="Router Number" AS n9e5cd,
10                   /* Total Created By */
11                     (IFC(t1.G1AAVN, 'WEBCOLLS', t1.G1PZTA, t1.G1AAVN)) AS 'Total Created By'n
12               FROM DM_DATA.DM_G1_FLEXISTPLAN_HEADER t1
13               WHERE t1.G1UEDT &amp;gt;= 1201111 AND t1.G1ZWCG NOT IS MISSING;
ERROR: Function IFC requires a numeric expression as argument 1.
14         QUIT;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      Memory                            446k
      OS Memory                         18728k
      Timestamp            11/12/2020  6:47:48 PM
      Page Faults                       0
      Page Reclaims                     32
      Page Swaps                        0
      Voluntary Context Switches        11
      Involuntary Context Switches      6
      Block Input Operations            0
      Block Output Operations           0
      
15         QUIT; RUN;
16         &lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2020 18:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698481#M25510</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T18:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698484#M25512</link>
      <description>&lt;P&gt;Try function IFN instead of IFC.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698484#M25512</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-11-12T19:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698496#M25515</link>
      <description>I tried both IFN and IFC but getting errors on both unfortunately &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698496#M25515</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T19:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698500#M25516</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p07za51a2k0sxkn1m0tulx2cy464.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;IFC&lt;/A&gt; needs three arguments, and can accept a fourth. The first expression is a&amp;nbsp;&lt;EM&gt;logical&lt;/EM&gt; expression. Logical values in SAS are numeric. Most of the time this first expression is a condition you would otherwise use in an IF statement.&lt;/P&gt;
&lt;P&gt;You cannot use a character variable there, but you can use a character variable in a condition:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IFC(t1.G1AAVN ne "", 'WEBCOLLS', t1.G1PZTA, t1.G1AAVN)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that the fourth argument here is irrelevant, as the condition will never result in a missing value.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698500#M25516</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T19:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698501#M25517</link>
      <description>&lt;P&gt;What is the type (numeric or character) of variables t1.G1PZTA, t1.G1AAVN ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698501#M25517</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-11-12T19:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698505#M25519</link>
      <description>Both character</description>
      <pubDate>Thu, 12 Nov 2020 20:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698505#M25519</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T20:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698506#M25520</link>
      <description>&lt;P&gt;PS do NOT use those stupid name literals. Use labels for fancy strings, and valid SAS names for your variable names.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 20:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698506#M25520</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T20:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698515#M25524</link>
      <description>This populated the new column with ‘WEBCOLLS’ for every row and not the value of G1PZTA &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Thu, 12 Nov 2020 20:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698515#M25524</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T20:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698518#M25525</link>
      <description>&lt;P&gt;Under which condition should the target variable be populated with which value?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 20:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698518#M25525</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T20:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698520#M25527</link>
      <description>If G1AAVN=“WEBCOLLS’ I want the new column to use the value in G1PZTA instead. For anything other than ‘WEBCOLLS’ I want the new column to keep the value of G1AAVN.</description>
      <pubDate>Thu, 12 Nov 2020 20:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698520#M25527</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T20:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698535#M25531</link>
      <description>&lt;P&gt;Then this is your function call:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IFC(t1.G1AAVN = 'WEBCOLLS', t1.G1PZTA, t1.G1AAVN)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first argument is the condition, the second the "then" value, the third the "else" value.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 21:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698535#M25531</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T21:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A Computed Column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698537#M25532</link>
      <description>Thanks so much. Appreciate all your help. Really new at this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 12 Nov 2020 21:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-A-Computed-Column/m-p/698537#M25532</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2020-11-12T21:28:39Z</dc:date>
    </item>
  </channel>
</rss>

