<?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: Cast function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727472#M226271</link>
    <description>You can use PUT/INPUT within PROC SQL or a DATA STEP.</description>
    <pubDate>Thu, 18 Mar 2021 16:53:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-03-18T16:53:36Z</dc:date>
    <item>
      <title>Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727466#M226265</link>
      <description>Hi experts,&lt;BR /&gt;&lt;BR /&gt;I'm new to sql, I came across a sql code but I feel very difficult what it does?&lt;BR /&gt;&lt;BR /&gt;Proc sql;&lt;BR /&gt;Cast(sum(week_ending)) as current_4weeks;&lt;BR /&gt;Quit;&lt;BR /&gt;&lt;BR /&gt;And I'm not sure about the code. My question is what does the Cast function do?&lt;BR /&gt;Any alternative function can I use for it? Bcoz in my SAS studio, I'm not able to run Cast function.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TIA</description>
      <pubDate>Thu, 18 Mar 2021 16:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727466#M226265</guid>
      <dc:creator>Pooja98</dc:creator>
      <dc:date>2021-03-18T16:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727468#M226267</link>
      <description>&lt;P&gt;Cast would typically be used to convert data types, which would require specifying the output type in general.&lt;/P&gt;
&lt;P&gt;However with the SAS Proc SQL it will throw an error.&lt;/P&gt;
&lt;PRE&gt;8    proc sql;
9      select cast(sum(weight)) as totalweight
10     from sashelp.class;
ERROR: Function CAST could not be located.
11   quit;
&lt;/PRE&gt;
&lt;P&gt;Proc FEDSQL which is intended for use with non-SAS traditional data sets supports the CAST function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 16:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727468#M226267</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-18T16:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727471#M226270</link>
      <description>In other words, can I use put/input function to change the data type in proc sql.</description>
      <pubDate>Thu, 18 Mar 2021 16:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727471#M226270</guid>
      <dc:creator>Pooja98</dc:creator>
      <dc:date>2021-03-18T16:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727472#M226271</link>
      <description>You can use PUT/INPUT within PROC SQL or a DATA STEP.</description>
      <pubDate>Thu, 18 Mar 2021 16:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727472#M226271</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-18T16:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727474#M226272</link>
      <description>Thanks a lot</description>
      <pubDate>Thu, 18 Mar 2021 16:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727474#M226272</guid>
      <dc:creator>Pooja98</dc:creator>
      <dc:date>2021-03-18T16:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727476#M226273</link>
      <description>FYI - I'd probably mark &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; answer as correct, mine is helpful, but his actually answers your initial question.</description>
      <pubDate>Thu, 18 Mar 2021 17:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727476#M226273</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-18T17:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727479#M226274</link>
      <description>Then what is the difference between cast and put/input function??</description>
      <pubDate>Thu, 18 Mar 2021 17:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727479#M226274</guid>
      <dc:creator>Pooja98</dc:creator>
      <dc:date>2021-03-18T17:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cast function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727487#M226280</link>
      <description>SQL is not a single language, Oracles implementation of SQL is different than Microsoft, which is different than DB2. &lt;BR /&gt;They can have different functions. &lt;BR /&gt;CAST is a valid conversion function in other SQL implementations, but not in SAS PROC SQL.&lt;BR /&gt;CAST is a valid function in SAS PROC FEDSQL. &lt;BR /&gt;&lt;BR /&gt;The equivalent functions for CAST in SAS is PUT()/INPUT(). &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 18 Mar 2021 17:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cast-function/m-p/727487#M226280</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-18T17:30:54Z</dc:date>
    </item>
  </channel>
</rss>

