<?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: intnx function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610462#M177773</link>
    <description>&lt;P&gt;Thanks for the clarification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to do is to get the previous day data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Record 1234567 was charged off Jan 02, I want to get the Jan 01 data of that record.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It means that I want to get all the previous day data prior to charge off of all the records in this query.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2019 13:38:08 GMT</pubDate>
    <dc:creator>Eugenio211</dc:creator>
    <dc:date>2019-12-09T13:38:08Z</dc:date>
    <item>
      <title>intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610110#M177652</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope all is well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just wanted to ask assistance with this data step:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table MP_Loans as&lt;BR /&gt;select lp.loan_key&lt;BR /&gt;,datepart(lp.date_entered) as CHARGEOFF_DATE format mmddyy.&lt;BR /&gt;,l.location&lt;BR /&gt;,l.product_type&lt;BR /&gt;from wcpca.LoanPayment as lp&lt;BR /&gt;join wcpca.Loan as l&lt;BR /&gt;on lp.loan_key = l.loan_key&lt;BR /&gt;and l.trans_detail_key ^= 1&lt;BR /&gt;where lp.reversed = 0&lt;BR /&gt;and l.product_type = 'M'&lt;BR /&gt;and lp.trans_code = 68&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;and datepart(lp.date_entered) &amp;lt;= intnx('Day',datepart(lp.date_entered),-1)&lt;/FONT&gt;&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is the highlighted in blue correct? thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get records that are 1 day less than the Chargeoff Date&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610110#M177652</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-06T20:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610119#M177660</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302621"&gt;@Eugenio211&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope all is well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just wanted to ask assistance with this data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table MP_Loans as&lt;BR /&gt;select lp.loan_key&lt;BR /&gt;,datepart(lp.date_entered) as CHARGEOFF_DATE format mmddyy.&lt;BR /&gt;,l.location&lt;BR /&gt;,l.product_type&lt;BR /&gt;from wcpca.LoanPayment as lp&lt;BR /&gt;join wcpca.Loan as l&lt;BR /&gt;on lp.loan_key = l.loan_key&lt;BR /&gt;and l.trans_detail_key ^= 1&lt;BR /&gt;where lp.reversed = 0&lt;BR /&gt;and l.product_type = 'M'&lt;BR /&gt;and lp.trans_code = 68&lt;BR /&gt;&lt;FONT color="#3366ff"&gt;and datepart(lp.date_entered) &amp;lt;= intnx('Day',datepart(lp.date_entered),-1)&lt;/FONT&gt;&lt;BR /&gt;;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is the highlighted in blue correct? thanks a lot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to get records that are 1 day less than the Chargeoff Date&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Syntactically correct in that I won't throw an error but what you are doing in effect is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and value &amp;lt;= (value -1);&lt;/P&gt;
&lt;P&gt;So this condition would never be true:&amp;nbsp;&amp;nbsp; 4 &amp;lt;= 3 for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that you actually intended one of the date_entered in the highlighted code to be L.date_entered (from the Loan data set)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 21:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610119#M177660</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-06T21:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610120#M177661</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302621"&gt;@Eugenio211&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope all is well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just wanted to ask assistance with this data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table MP_Loans as&lt;BR /&gt;select lp.loan_key&lt;BR /&gt;,datepart(lp.date_entered) as CHARGEOFF_DATE format mmddyy.&lt;BR /&gt;,l.location&lt;BR /&gt;,l.product_type&lt;BR /&gt;from wcpca.LoanPayment as lp&lt;BR /&gt;join wcpca.Loan as l&lt;BR /&gt;on lp.loan_key = l.loan_key&lt;BR /&gt;and l.trans_detail_key ^= 1&lt;BR /&gt;where lp.reversed = 0&lt;BR /&gt;and l.product_type = 'M'&lt;BR /&gt;and lp.trans_code = 68&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;and datepart(lp.date_entered) &amp;lt;= intnx('Day',datepart(lp.date_entered),-1)&lt;/FONT&gt;&lt;BR /&gt;;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is the highlighted in blue correct? thanks a lot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to get records that are 1 day less than the Chargeoff Date&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What happens when you run this code? Does it give you the desired result?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610120#M177661</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-06T20:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610121#M177662</link>
      <description>&lt;P&gt;If you have date values there is no need for INTNX to count days. The value stored is already days.&lt;/P&gt;
&lt;P&gt;But you could use the DTDAY interval directly with the numbers of seconds in your datetime values instead of first converting them into number of days using the DATEPART() function.&amp;nbsp; But do your DATETIME values that you are feeding into the DATEPART() function actually have time parts? And if so does it matter if the difference is less than 24 hours? Or more than 24 hours? What about value pairs like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Small Large Hours_different
03JAN2019:01:00 04JAN2019:21:00 44
03JAN2019:21:00 04JAN2019:01:00 4&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 21:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610121#M177662</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-06T21:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610462#M177773</link>
      <description>&lt;P&gt;Thanks for the clarification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to do is to get the previous day data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Record 1234567 was charged off Jan 02, I want to get the Jan 01 data of that record.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It means that I want to get all the previous day data prior to charge off of all the records in this query.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 13:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610462#M177773</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-09T13:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610464#M177775</link>
      <description>&lt;P&gt;I tried to this and it's giving me 0 observations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and lp.date_entered &amp;lt; intnx('dtday',lp.date_entered,-1)&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 13:39:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610464#M177775</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-09T13:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610465#M177776</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the query runs but it gives me 0 observations.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 13:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function/m-p/610465#M177776</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-09T13:39:48Z</dc:date>
    </item>
  </channel>
</rss>

