<?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: SAS Proc sql pass through (postgressql) - macro date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236888#M43416</link>
    <description>&lt;P&gt;Would it be possible to share the log ?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2015 03:56:22 GMT</pubDate>
    <dc:creator>kannand</dc:creator>
    <dc:date>2015-11-30T03:56:22Z</dc:date>
    <item>
      <title>SAS Proc sql pass through (postgressql) - macro date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236878#M43415</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run the below and I get nothing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro test2(ot=, SD=, ED=);&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to postgres as x1(SERVER='XXXX.lan' DATABASE='XXXX' PORT='5432' USER='XXXX' PASSWORD='XXXX');&lt;BR /&gt;create table &amp;amp;ot. as&lt;BR /&gt;select * from connection to x1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(SELECT&lt;BR /&gt;distinct date_trunc('MONTH', syndicate_share_timestamp) as date,&lt;/P&gt;&lt;P&gt;(sum(account_transaction.transaction_base_amount)) as sum&lt;/P&gt;&lt;P&gt;FROM syndicate_ticket&lt;BR /&gt;inner join draw on (syndicate_ticket.draw_id=draw.draw_id)&lt;BR /&gt;inner join lottery on (draw.lottery_id=lottery.lottery_id)&lt;BR /&gt;inner join syndicate_share on (syndicate_ticket.syndicate_session_id = syndicate_share.syndicate_session_id)&lt;BR /&gt;inner join account_transaction ON (syndicate_share.account_transaction_id=account_transaction.account_transaction_id)&lt;/P&gt;&lt;P&gt;WHERE&lt;BR /&gt;syndicate_share.syndicate_share_timestamp &amp;gt; %BQUOTE('&amp;amp;SD')&lt;BR /&gt;and syndicate_share.syndicate_share_timestamp &amp;lt; %BQUOTE('&amp;amp;ED')&lt;/P&gt;&lt;P&gt;and syndicate_share_status_id = 40&lt;BR /&gt;group by date&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%mend test2;&lt;BR /&gt;%test2 (ot=work.a1, SD='2015-10-01', ED='2015-10-15');&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%test2 (ot=work.a2, SD='2015-10-16', ED='2015-10-31);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried by&amp;nbsp;%STR(%'&amp;amp;SD%') and&amp;nbsp;%STR(%'&amp;amp;ED%') and also simply by&amp;nbsp;&lt;SPAN&gt;&amp;amp;SD and&amp;nbsp;&amp;amp;ED.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Result: nothing happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 02:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236878#M43415</guid>
      <dc:creator>rimonr</dc:creator>
      <dc:date>2015-11-30T02:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc sql pass through (postgressql) - macro date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236888#M43416</link>
      <description>&lt;P&gt;Would it be possible to share the log ?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 03:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236888#M43416</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-30T03:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc sql pass through (postgressql) - macro date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236889#M43417</link>
      <description>&lt;P&gt;Also, have you tried running the query against individual tables? and isolate which condition is causing an empty result ? I'd split this into smaller pieces and run them expanding one after another to pinpoint the root cause....&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 04:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236889#M43417</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-30T04:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc sql pass through (postgressql) - macro date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236892#M43418</link>
      <description>&lt;P&gt;Hi Kannan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just tried&amp;nbsp;the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro new2(ot=, SD=, ED=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the pass through sql:&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHERE&lt;BR /&gt;syndicate_share.syndicate_share_timestamp &amp;gt;= &amp;amp;SD&lt;BR /&gt;and syndicate_share.syndicate_share_timestamp &amp;lt;= &amp;amp;ED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend new2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%new2 (ot=work.a, SD='01Oct2015', ED='31Oct2015') ;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IT's WORKING NOW!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks you very much for reaching out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Rimon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 04:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-sql-pass-through-postgressql-macro-date/m-p/236892#M43418</guid>
      <dc:creator>rimonr</dc:creator>
      <dc:date>2015-11-30T04:40:27Z</dc:date>
    </item>
  </channel>
</rss>

