<?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: Pull data based on current month of date in a second dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577915#M163819</link>
    <description>&lt;P&gt;I understand.. I used this..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%Let today = %sysfunc(date(),date9.);&lt;BR /&gt;%let sysmonth= %sysfunc(month("&amp;amp;sysdate"d));&lt;BR /&gt;%let sysyear= %sysfunc(year("&amp;amp;sysdate"d));&lt;BR /&gt;/*DF Inventory for the month*/&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;connect to oracle (user=&amp;amp;name pass=&amp;amp;pass path=ExaODIN);&lt;BR /&gt;create table DF as select *&lt;BR /&gt;from connection to Oracle&lt;BR /&gt;(select *&lt;BR /&gt;from ODS.collection&lt;BR /&gt;where extract(month from col_actv_date) = &amp;amp;sysmonth.&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;disconnect from Oracle;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it's still running so i will try your solution&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jul 2019 22:37:46 GMT</pubDate>
    <dc:creator>TheNovice</dc:creator>
    <dc:date>2019-07-30T22:37:46Z</dc:date>
    <item>
      <title>Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577906#M163812</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 queries I need to execute one after another:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First: I need to pull data for the current month in a pass through... the date is in datetime format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have tried so far without any results.... I know that I can specify the dates but I am trying to make it so that I don't need to so it can be automated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%Let today = %sysfunc(date(),date9.);&lt;BR /&gt;%let sysmonth= %sysfunc(month("&amp;amp;sysdate"d));&lt;BR /&gt;%let sysyear= %sysfunc(year("&amp;amp;sysdate"d));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;connect to oracle (user=&amp;amp;name pass=&amp;amp;pass path=Exa);&lt;BR /&gt;create table DF as select *&lt;BR /&gt;from connection to Oracle&lt;BR /&gt;(select *&lt;BR /&gt;from tables&lt;BR /&gt;where month(ACTV_DATE) = &amp;amp;sysmonth. )&lt;BR /&gt;;&lt;BR /&gt;disconnect from Oracle;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;second step.. all these records then have to pull data from a second table where the date&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;ACTV_DATE&lt;/SPAN&gt; is after the date in the second table. Again all dates are in datetime format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;connect to oracle (user=&amp;amp;name pass=&amp;amp;pass path=ExaODIN);&lt;BR /&gt;create table DF1 as select *&lt;BR /&gt;from connection to Oracle&lt;BR /&gt;(select *&lt;BR /&gt;from activity&lt;BR /&gt;where ID in (select IDfrom df) and datepart(actv_date) &amp;gt;= datepart(secondtable_date)&lt;BR /&gt;;&lt;BR /&gt;disconnect from Oracle;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I usually use pass throughs to pull data... i haven't tried segmentation at this level. Really appreciate your help&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 22:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577906#M163812</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-30T22:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577909#M163815</link>
      <description>You're using SQL Pass through. Your queries need to be Oracle SQL, or PL/SQL not SAS SQL. DATEPART() and MONTH() are not valid functions in Oracle SQL. &lt;BR /&gt;&lt;BR /&gt;extract(month from actv_date) is the correct version of MONTH()&lt;BR /&gt;&lt;BR /&gt;Not sure what datepart() would be, but you could use TRUNC() to change the time part to 0, so that your comparisons would work.</description>
      <pubDate>Tue, 30 Jul 2019 22:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577909#M163815</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-30T22:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577912#M163816</link>
      <description>&lt;P&gt;Maybe I misunderstood... so how would i make that change the queries?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;connect to oracle (user=&amp;amp;name pass=&amp;amp;pass path=ExaODIN);&lt;BR /&gt;create table DF as select *&lt;BR /&gt;from connection to Oracle&lt;BR /&gt;(select *&lt;BR /&gt;from ODS.collection&lt;BR /&gt;where&amp;nbsp; (&amp;nbsp; date variable is equal to the current belongs in the current month)&lt;BR /&gt;;&lt;BR /&gt;disconnect from Oracle;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 22:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577912#M163816</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-30T22:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577913#M163817</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where extract(month from dateVar) = extract(month from current_date) and extract(year from dateVar) = extract(year from current_date)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But are you only concerned with month or do you need to account for the year as well?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option is to use TO_CHAR() to convert them to characters and ensure they're the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions180.htm" target="_blank"&gt;https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions180.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Honestly, these are now Oracle questions, but I happen to work on an Oracle DB so know how to do both.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 22:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577913#M163817</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-30T22:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577915#M163819</link>
      <description>&lt;P&gt;I understand.. I used this..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%Let today = %sysfunc(date(),date9.);&lt;BR /&gt;%let sysmonth= %sysfunc(month("&amp;amp;sysdate"d));&lt;BR /&gt;%let sysyear= %sysfunc(year("&amp;amp;sysdate"d));&lt;BR /&gt;/*DF Inventory for the month*/&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;connect to oracle (user=&amp;amp;name pass=&amp;amp;pass path=ExaODIN);&lt;BR /&gt;create table DF as select *&lt;BR /&gt;from connection to Oracle&lt;BR /&gt;(select *&lt;BR /&gt;from ODS.collection&lt;BR /&gt;where extract(month from col_actv_date) = &amp;amp;sysmonth.&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;disconnect from Oracle;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it's still running so i will try your solution&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 22:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577915#M163819</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-30T22:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577918#M163822</link>
      <description>&lt;P&gt;Please post details of the two tables you are querying and some sample data, made up if necessary. I'm guessing there is some matching by IDs between these tables but you haven't explained what this is. We end up having to guess what you want because you haven't fully described what your input data looks like.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 22:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577918#M163822</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-07-30T22:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577921#M163823</link>
      <description>&lt;P&gt;so Table 1 has a bunch of variables. I need ID for the current month only). The table is big so i am deciding to use the passthrough code as I had pasted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table will go like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; actv_Date(datetime format)&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; 21Apr2019&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; 22Apr2019&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 01Jul2019&lt;/P&gt;&lt;P&gt;4&amp;nbsp; 04Jul2019&lt;/P&gt;&lt;P&gt;so if i was running the code this month it should only pull ID 3 and 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second table is set up the same way as above. it has a variable i need that is based on the ID that i pulled above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; amt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; date&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $22 &amp;nbsp; &amp;nbsp; &amp;nbsp; 01jul2019&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $23 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 24Jul2019&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $24 &amp;nbsp; &amp;nbsp;&amp;nbsp; 26Jul2019&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $25 &amp;nbsp; &amp;nbsp;&amp;nbsp; 04apr2019&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after i pull records for the current month , i would like to pull records from the second table where ID is in first table and the&amp;nbsp; date (from second table) &amp;gt;= date (from first table)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to do this is in multiple steps but is there a way to do it in the pass through statement. I would ideally like to schedule this in Sas mc so i don't have update anything&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 23:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577921#M163823</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-30T23:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577925#M163827</link>
      <description>That's just checking the months are the same? Do you want data from July of 2018 and 2017 as well?</description>
      <pubDate>Tue, 30 Jul 2019 23:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577925#M163827</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-30T23:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577932#M163832</link>
      <description>&lt;P&gt;I would test a simple solution before trying to use macro variables.&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 (user=&amp;amp;name pass=&amp;amp;pass path=Exa);
create table DF as select *
from connection to Oracle
(select A.*
from table2 as A
inner join
(select ID
       ,max(actv_date) as actv_date_max
 from table1
 where actv_date &amp;gt;= '01-Jul-2019'
 group by ID
) as B
on A.ID = B.ID&lt;BR /&gt; and A.date &amp;gt;= B.actv_date_max
;
disconnect from Oracle;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2019 01:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577932#M163832</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-07-31T01:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577936#M163836</link>
      <description>&lt;P&gt;Why don't you hit the Oracle doc and do all this directly in Oracle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have Oracle but some Googling:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions037.htm#SQLRF00628" target="_blank"&gt;https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions037.htm#SQLRF00628&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/22060885/how-to-get-current-month-records-from-oracle-since-first-date" target="_blank"&gt;https://stackoverflow.com/questions/22060885/how-to-get-current-month-records-from-oracle-since-first-date&lt;/A&gt;&amp;nbsp;(trunc function?&amp;nbsp; I didn't find a MONTH function, although you appear to be using this in your passthrough)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't bother with your 2nd query, but I suspect that could all be done natively with a bit of Oracle fu.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 01:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577936#M163836</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-31T01:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577937#M163837</link>
      <description>&lt;P&gt;I only have access to SAS EG...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be confusing everyone&amp;nbsp; and the previous code suggestions don't work so I am pasting the actual tables with a step by step of what i am trying to achieve. I know how to do it but my way would require manual date changes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am trying to automate this...&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 02:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577937#M163837</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-31T02:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577938#M163838</link>
      <description>&lt;P&gt;&amp;nbsp;I only want it for the current month in the current year&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 02:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577938#M163838</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-31T02:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577945#M163843</link>
      <description>&lt;P&gt;Did you try my non-macro example? If so, what was wrong?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 04:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577945#M163843</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-07-31T04:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577948#M163846</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp; A closing parenthesis is missing in your query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/248692"&gt;@TheNovice&lt;/a&gt;&amp;nbsp; &amp;nbsp;In case this is not clear:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;proc sql;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;&amp;nbsp; connect using ORA;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;&amp;nbsp; select * &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;&amp;nbsp; from connection to ORA (&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;&amp;nbsp; &amp;nbsp; &lt;FONT color="#FF0000"&gt;select * &lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; from TABLE1, TABLE1 &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; where ID=ID1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; order by ID1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;FONT color="#3366FF"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;&amp;nbsp;order by ID1;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anything between the parentheses in the query above runs in Oracle and must use Oracle syntax. No SAS functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anything else runs in SAS and must use SAS syntax. No Oracle functions or syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 05:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/577948#M163846</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-07-31T05:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578112#M163915</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
connect to oracle (user=&amp;amp;name pass=&amp;amp;pass path=ExaODIN);
create table DF as select *
from connection to Oracle
(select *
from ODS.collection
where extract(month from dateVar) = extract(month from current_date) and extract(year from dateVar) = extract(year from current_date)
)
;
disconnect from Oracle;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did this not work? If not, what was the error?&lt;BR /&gt;Do you have access to Oracle SQL Developer to test the code ahead of time?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 15:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578112#M163915</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-31T15:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578118#M163917</link>
      <description>&lt;P&gt;It worked!! For some reason it was taking so long last night that i abandoned it. Sorry for the delay in replying and thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 15:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578118#M163917</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-31T15:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578120#M163919</link>
      <description>&lt;P&gt;This worked as well! I think when i was trying all this last night there was a sas maintenance going on and they didn't inform everyone. Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 15:35:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578120#M163919</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-31T15:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pull data based on current month of date in a second dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578128#M163921</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp; . First time doing it this way but I will keep this in mind&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 15:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pull-data-based-on-current-month-of-date-in-a-second-dataset/m-p/578128#M163921</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-07-31T15:50:12Z</dc:date>
    </item>
  </channel>
</rss>

