<?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: Proc SQL and SAS Date Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353943#M82690</link>
    <description>&lt;P&gt;You need to get the date part in SAS as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; said.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either you repeat the variable list:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;                                      
  connect to oracle as its (USER=&amp;amp;orauser PASSWORD=&amp;amp;orapass path ='fcprod');
  create table IREPS as
    select  REPORTER
          , IFNAME
          , datepart(STATUS_1_DT) as ISTATUS1DATE
    from connection to its (select 
       ri.REPORTER
      ,rep.FIRST_NAME ifname
      ,ri.status_1_dt
      from ttms.reporter_imap ri, ttms.reporter rep
    	where ri.reporter=rep.reporter);
  disconnect from its;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you dont:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;                                      
  connect to oracle as its (USER=&amp;amp;orauser PASSWORD=&amp;amp;orapass path ='fcprod');
  create table IREPS(drop=STATUS_1_DT) as
    select  *
          , datepart(STATUS_1_DT) as ISTATUS1DATE
    from connection to its (select 
       ri.REPORTER
      ,rep.FIRST_NAME ifname
      ,ri.STATUS_1_DT
      from ttms.reporter_imap ri, ttms.reporter rep
    	where ri.reporter=rep.reporter);
  disconnect from its;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Apr 2017 23:34:57 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-04-26T23:34:57Z</dc:date>
    <item>
      <title>Proc SQL and SAS Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353915#M82679</link>
      <description>&lt;P&gt;Hi. I have the following Proc SQL that is selecting ri.status_1_dt&amp;nbsp;&lt;CODE class=" language-sas"&gt;as istatus1date&lt;/CODE&gt;, which is a Datetime column on the Oracle table. I need for istatus1date to be saved in the SAS dataset as a SAS Date type variable with only the date portion retained, so it should have no timestamp as part of the SAS date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As it stands now the variable ends up in the SAS dataset as a Char. &amp;nbsp;Can anyone help me with this?&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;proc sql;                                      
  connect to oracle as its (USER=&amp;amp;orauser PASSWORD=&amp;amp;orapass path ='fcprod');
  create table ireps as
    select *
  from connection to its (select 
  ri.REPORTER,
  rep.FIRST_NAME ifname,
  &lt;STRONG&gt;trunc(ri.status_1_dt) as istatus1date&lt;/STRONG&gt;
  from ttms.reporter_imap ri, ttms.reporter rep
	where ri.reporter=rep.reporter);
disconnect from its;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2017 21:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353915#M82679</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2017-04-26T21:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and SAS Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353935#M82689</link>
      <description>&lt;P&gt;Doesn't trunc return a character variable? I recommend bringing it as a datetime and then processing it on SAS side.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS function for the conversion would be DATEPART()&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 22:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353935#M82689</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-26T22:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and SAS Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353943#M82690</link>
      <description>&lt;P&gt;You need to get the date part in SAS as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; said.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either you repeat the variable list:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;                                      
  connect to oracle as its (USER=&amp;amp;orauser PASSWORD=&amp;amp;orapass path ='fcprod');
  create table IREPS as
    select  REPORTER
          , IFNAME
          , datepart(STATUS_1_DT) as ISTATUS1DATE
    from connection to its (select 
       ri.REPORTER
      ,rep.FIRST_NAME ifname
      ,ri.status_1_dt
      from ttms.reporter_imap ri, ttms.reporter rep
    	where ri.reporter=rep.reporter);
  disconnect from its;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you dont:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;                                      
  connect to oracle as its (USER=&amp;amp;orauser PASSWORD=&amp;amp;orapass path ='fcprod');
  create table IREPS(drop=STATUS_1_DT) as
    select  *
          , datepart(STATUS_1_DT) as ISTATUS1DATE
    from connection to its (select 
       ri.REPORTER
      ,rep.FIRST_NAME ifname
      ,ri.STATUS_1_DT
      from ttms.reporter_imap ri, ttms.reporter rep
    	where ri.reporter=rep.reporter);
  disconnect from its;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2017 23:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-and-SAS-Date-Variables/m-p/353943#M82690</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-04-26T23:34:57Z</dc:date>
    </item>
  </channel>
</rss>

