<?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: How to handle date in sas while using passthrough from oracle in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806670#M317862</link>
    <description>&lt;P&gt;If you just want to change the macro string, you can do that. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let a=07APR2019:21:28:58.01865;

%put b=%scan(&amp;amp;a,1,.);

%put c=%sysfunc(prxchange(s/(.*\.\d\d).*/\1/,1,&amp;amp;a));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;b=07APR2019:21:28:58&lt;BR /&gt;c=07APR2019:21:28:58.01&lt;/P&gt;
&lt;P&gt;You could even just use %substr()&amp;nbsp; since the length is aways known&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2022 22:24:30 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2022-04-07T22:24:30Z</dc:date>
    <item>
      <title>How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806446#M317734</link>
      <description>&lt;P&gt;Hi&amp;nbsp; how to handle the below date format in sas&amp;nbsp;&lt;/P&gt;
&lt;P&gt;07APR2019:21:28:58.00865&lt;/P&gt;
&lt;P&gt;as fetching this data from an oracle table using a pass-through code. Where the date variable New_date is used as filter&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g&amp;nbsp; New_date between to_date(&amp;amp;start_dt, "DDMONYYYY:HR24:MI:SS") and&amp;nbsp;&amp;nbsp;to_date(&amp;amp;end_dt, "DDMONYYYY:HR24:MI:SS")&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you closely look to date the data post decimal is creating fetching issue.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 08:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806446#M317734</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2022-04-07T08:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806669#M317861</link>
      <description>&lt;P&gt;what would you like the oracle string to be?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 22:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806669#M317861</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-04-07T22:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806670#M317862</link>
      <description>&lt;P&gt;If you just want to change the macro string, you can do that. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let a=07APR2019:21:28:58.01865;

%put b=%scan(&amp;amp;a,1,.);

%put c=%sysfunc(prxchange(s/(.*\.\d\d).*/\1/,1,&amp;amp;a));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;b=07APR2019:21:28:58&lt;BR /&gt;c=07APR2019:21:28:58.01&lt;/P&gt;
&lt;P&gt;You could even just use %substr()&amp;nbsp; since the length is aways known&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 22:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806670#M317862</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-04-07T22:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806689#M317873</link>
      <description>&lt;P&gt;I don't understand what code you are trying to run.&lt;/P&gt;
&lt;P&gt;What does the MACRO variable referenced in you ORACLE statement contain?&amp;nbsp; Is it the name of an variable in the Oracle query? Something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show the ORACLE code that works.&lt;/P&gt;
&lt;P&gt;Explain what part of the ORACLE code you want to generate using SAS macro code.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 03:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806689#M317873</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-08T03:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806703#M317881</link>
      <description>In oracle table ABC the variable New_date contains 07APR2019:21:28:58.00865 this data.&lt;BR /&gt;when i am using passthrough in sas extracting data from ABC extracting the data between two dates so using  WHERE  NEW_DATE between to_date(&amp;amp;start_dt, "DDMONYYYY:HR24:MI:SS") and  to_date(&amp;amp;end_dt, "DDMONYYYY:HR24:MI:SS")  but when the code is executing it is running for infinite time.  and the required data is 07APR2019:21:28:58 or only date 07APR2019</description>
      <pubDate>Fri, 08 Apr 2022 06:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806703#M317881</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2022-04-08T06:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806704#M317882</link>
      <description>the macro contains the  time :hh:mm:ss .. when the code goes for scanning it gets 07APR2019:21:28:58.00865 in data so the code is keeping on executing.</description>
      <pubDate>Fri, 08 Apr 2022 06:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806704#M317882</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2022-04-08T06:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806705#M317883</link>
      <description>the macro variable &lt;BR /&gt;auth_st_dt = intnx('Month',today(), -1,'b');&lt;BR /&gt;auth_end_dt= intnx('Month',today(), -1,'e');&lt;BR /&gt;call symput ('auth_st_dt' , "'" || put(auth_st_dt,  date9.) || ":00:00:00'");&lt;BR /&gt;call symput ('auth_end_dt', "'" || put(auth_end_dt, date9.) || ":23:59:59'");</description>
      <pubDate>Fri, 08 Apr 2022 06:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806705#M317883</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2022-04-08T06:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806721#M317897</link>
      <description>&lt;P&gt;Please post the complete SAS log of your Oracle query so we can fully understand what you are doing. Just posting bits of what you are doing isn't useful.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 08:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806721#M317897</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-04-08T08:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle date in sas while using passthrough from oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806749#M317916</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/106991"&gt;@anirudhs&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;the macro variable &lt;BR /&gt;auth_st_dt = intnx('Month',today(), -1,'b');&lt;BR /&gt;auth_end_dt= intnx('Month',today(), -1,'e');&lt;BR /&gt;call symput ('auth_st_dt' , "'" || put(auth_st_dt, date9.) || ":00:00:00'");&lt;BR /&gt;call symput ('auth_end_dt', "'" || put(auth_end_dt, date9.) || ":23:59:59'");&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you are creating macro variables that have in them strings in the style generated by the DATETIME format that are enclosed in single quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let auth_st_dt = '08APR2022:00:00:00' ;
%let auth_end_dt = '30APR2022:23:59:59';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then in the ORACLE code you inserting that string. So to ORACLE that looks like a string constant.&lt;/P&gt;
&lt;P&gt;Is the field in ORACLE a DATE or a TIMESTAMP?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 12:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-date-in-sas-while-using-passthrough-from-oracle/m-p/806749#M317916</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-08T12:29:57Z</dc:date>
    </item>
  </channel>
</rss>

