<?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: SQL to SAS Date Formatting Character to Numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361191#M85145</link>
    <description>&lt;P&gt;I'm not an SQL Server specialist, but don't you already do the&amp;nbsp;conversion in that step?&lt;/P&gt;
&lt;P&gt;But you can do it on the SAS side as well, just use input([charvar], [date format that matches the on in the car variable]) in the select.&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2017 13:08:15 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2017-05-24T13:08:15Z</dc:date>
    <item>
      <title>SQL to SAS Date Formatting Character to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361175#M85140</link>
      <description>&lt;P&gt;How can I convert a data variable that comes in to SAS from SQL as a character with length 11 and $11 format into a numeric variable with the Date9. format? &amp;nbsp;Is there a way I can do the formatting in the Proc SQL step instead of needing an additional data step? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 12:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361175#M85140</guid>
      <dc:creator>dsriggs</dc:creator>
      <dc:date>2017-05-24T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to SAS Date Formatting Character to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361176#M85141</link>
      <description>&lt;P&gt;You can do it directly in SQL. Post what you have now?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 12:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361176#M85141</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-05-24T12:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to SAS Date Formatting Character to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361184#M85143</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect to odbc(noprompt = "Driver={SQL Server};
                            Server=server;
                            Database=database;");
create table sastable as
select * from   connection to odbc
(
select convert(varchar(11),cast(DATEADD(MONTH,DATEDIFF(month,0,datevar),0) as DATE),106) as datevar,
sum(case when COL='Name' then Volume else 0 end) as 'Name'
from SQLTABLE
where OtherDate=(select MAX(OtherDate) from SQLTABLE)
group by datevar
Order by datevar);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is a generic form of the Proc SQL statement I am working with. &amp;nbsp;The date formatting in the Select statement is so complicated because I have daily volumes that I am trying to group by month, and then set the date as the first of the month, but then the formatting comes into SAS as a character variable.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 12:56:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361184#M85143</guid>
      <dc:creator>dsriggs</dc:creator>
      <dc:date>2017-05-24T12:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to SAS Date Formatting Character to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361191#M85145</link>
      <description>&lt;P&gt;I'm not an SQL Server specialist, but don't you already do the&amp;nbsp;conversion in that step?&lt;/P&gt;
&lt;P&gt;But you can do it on the SAS side as well, just use input([charvar], [date format that matches the on in the car variable]) in the select.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 13:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-SAS-Date-Formatting-Character-to-Numeric/m-p/361191#M85145</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-24T13:08:15Z</dc:date>
    </item>
  </channel>
</rss>

