<?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: CASE function SAS DI studio in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503628#M134620</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt; I think that OP wants to get rid of chars, not being able to store them...?&lt;BR /&gt;As your post title say, use case with lets say ANYALPHA() function, if FALSE then INPUT() to the numerical target, else set MISSING.</description>
    <pubDate>Fri, 12 Oct 2018 06:16:04 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2018-10-12T06:16:04Z</dc:date>
    <item>
      <title>CASE function SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503510#M134552</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have variable that gets Numeric value most of the time but in certain conditions it can have character value. So I assigned Character to the variable while reading in the data from input file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used put function to this variable&amp;nbsp; before I load data into Teradata table it works perfectly if I don't have any character value....if I have any character value that it gives me error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let say variable called Customer_name&lt;/P&gt;&lt;P&gt;Customer_name&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3456&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;5678&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;9800&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;New&lt;/P&gt;&lt;P&gt;while mapping data in before step of teradata loader I used Put function as follows&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;put(Customer_name, 12.)&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This put function works perfectly if I don't have New in column. If I have New the following error occurs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Numeric format F in PUT function requires a numeric argument....&amp;nbsp; ERROR: Numeric format F in PUT function requires a numeric argument....&amp;nbsp; ERROR: Numeric format F in PUT function requires a numeric argument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If change put function to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put(Customer_name, $12.)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it works perfect for along with New in column Customer_name but doesn't work without New in column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some one help me with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 18:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503510#M134552</guid>
      <dc:creator>ashna</dc:creator>
      <dc:date>2018-10-11T18:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: CASE function SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503581#M134597</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;cat&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Customer_name)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Don't forget to set the length.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 22:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503581#M134597</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-11T22:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: CASE function SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503628#M134620</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt; I think that OP wants to get rid of chars, not being able to store them...?&lt;BR /&gt;As your post title say, use case with lets say ANYALPHA() function, if FALSE then INPUT() to the numerical target, else set MISSING.</description>
      <pubDate>Fri, 12 Oct 2018 06:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/503628#M134620</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-10-12T06:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: CASE function SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/504353#M134954</link>
      <description>&lt;P&gt;I tried to implement your suggestion,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when anyalpha(customer_acct) then "." else customer_acct end&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It works perfectly if I have New as value in customer_acct variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I don't have New as value in customer_acct variable it gives me following error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Function ANYALPHA requires a character expression as argument 1....&amp;nbsp; ERROR: Result of WHEN clause 2 is not the same data type as the preceding results.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to e-solve this?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 15:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/504353#M134954</guid>
      <dc:creator>ashna</dc:creator>
      <dc:date>2018-10-15T15:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: CASE function SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/504480#M135001</link>
      <description>Take a look at the generated code for the whole step. I recall there's a weakness here where you can't change the data type for a column, even if you are using a SQL SELECT. Try to use a different name on the source or the target column.</description>
      <pubDate>Mon, 15 Oct 2018 20:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/504480#M135001</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-10-15T20:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: CASE function SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/504494#M135010</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Used Cat function as suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;. That worked.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 21:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CASE-function-SAS-DI-studio/m-p/504494#M135010</guid>
      <dc:creator>ashna</dc:creator>
      <dc:date>2018-10-15T21:09:58Z</dc:date>
    </item>
  </channel>
</rss>

