<?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 Using INTNX function in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49774#M5403</link>
    <description>I am trying to increment a date by one day so it is the beginning of a month and have it appear in a report title.  Once I have the answer, the date will be a variable selected by the user that is actually an end-of-month date.&lt;BR /&gt;
&lt;BR /&gt;
%let x=intnx('DAY', '31Mar08'd,1);&lt;BR /&gt;
%put x / x date9.;&lt;BR /&gt;
&lt;BR /&gt;
TITLE;&lt;BR /&gt;
TITLE1 "Date = &amp;amp;x";&lt;BR /&gt;
&lt;BR /&gt;
Here's the results in the report:&lt;BR /&gt;
&lt;BR /&gt;
Date = intnx('DAY', '31Mar08'd,1)&lt;BR /&gt;
&lt;BR /&gt;
I would like it to show Date = 04/01/2008.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas??</description>
    <pubDate>Wed, 24 Sep 2008 20:21:25 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-09-24T20:21:25Z</dc:date>
    <item>
      <title>Using INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49774#M5403</link>
      <description>I am trying to increment a date by one day so it is the beginning of a month and have it appear in a report title.  Once I have the answer, the date will be a variable selected by the user that is actually an end-of-month date.&lt;BR /&gt;
&lt;BR /&gt;
%let x=intnx('DAY', '31Mar08'd,1);&lt;BR /&gt;
%put x / x date9.;&lt;BR /&gt;
&lt;BR /&gt;
TITLE;&lt;BR /&gt;
TITLE1 "Date = &amp;amp;x";&lt;BR /&gt;
&lt;BR /&gt;
Here's the results in the report:&lt;BR /&gt;
&lt;BR /&gt;
Date = intnx('DAY', '31Mar08'd,1)&lt;BR /&gt;
&lt;BR /&gt;
I would like it to show Date = 04/01/2008.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas??</description>
      <pubDate>Wed, 24 Sep 2008 20:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49774#M5403</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-24T20:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49775#M5404</link>
      <description>The problem is that you are mixing macro-code and normal sas-code. In this case the intnx-function will never be executed. Some functions can be used in macro-statements via the %sysfunc-macro-function.&lt;BR /&gt;
&lt;BR /&gt;
The following code uses a data-step to create the macro-variable firstDay.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	firstDay = put(intnx("DAY", "31Mar08"d, 1), mmddyy8.);&lt;BR /&gt;
	call symput("firstDay", firstDay);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
TITLE;&lt;BR /&gt;
TITLE1 "Date = &amp;amp;firstDay";&lt;BR /&gt;
&lt;BR /&gt;
proc print data=sashelp.class;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]

Thinking before the first coffee is not always a good idea &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; I removed the wrong idea about intnx and sysfunc.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: andreas_lds</description>
      <pubDate>Thu, 25 Sep 2008 06:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49775#M5404</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2008-09-25T06:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49776#M5405</link>
      <description>If you know that your base date is the last date of the previous month, just add 1:&lt;BR /&gt;
&lt;BR /&gt;
date = input_date + 1;&lt;BR /&gt;
&lt;BR /&gt;
Otherwise, you could try:&lt;BR /&gt;
&lt;BR /&gt;
date = intnx('MONTH',input_date,1,'BEGINNING');&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Thu, 25 Sep 2008 06:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49776#M5405</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-09-25T06:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49777#M5406</link>
      <description>%SYSFUNC supports the intnx functions&lt;BR /&gt;
&lt;BR /&gt;
%let x=%sysfunc(intnx(day,"31Mar2008"d,1,B),ddmmyy8.);&lt;BR /&gt;
%put &amp;amp;x; &lt;BR /&gt;
&lt;BR /&gt;
04/01/08&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Hope this could be handy.&lt;BR /&gt;
Sridhar.</description>
      <pubDate>Thu, 25 Sep 2008 06:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49777#M5406</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-25T06:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49778#M5407</link>
      <description>Thank you.  This worked when I "hard code" the date that I need to increment.  I'm having trouble now when I want to use a parameter value that the user selected.&lt;BR /&gt;
&lt;BR /&gt;
%let beg_date = &amp;amp;Prior_Month_End;&lt;BR /&gt;
TITLE1 "&amp;amp;beg_date";&lt;BR /&gt;
&lt;BR /&gt;
Result:  '31Mar2008:0:0:0'dt&lt;BR /&gt;
&lt;BR /&gt;
When I try to put Prior_Month_End in the sysfunc&lt;BR /&gt;
%let beg_date = %sysfunc(intnx(day,&amp;amp;prior_month_end,1,beginning));&lt;BR /&gt;
Result:  .  (period)&lt;BR /&gt;
&lt;BR /&gt;
w/out the '&amp;amp;' on Prior_Month_End, I get an error message.&lt;BR /&gt;
&lt;BR /&gt;
When I try it a different way, it appears the "value" for Prior_Month_End "starts at 1/1/1960.&lt;BR /&gt;
%let beg_date = %sysfunc(intnx(day,%sysfunc(Datepart(&amp;amp;Prior_Month_End), &lt;BR /&gt;
mmddyys10.),1),mmddyys10.);&lt;BR /&gt;
Result:  01/02/1960&lt;BR /&gt;
&lt;BR /&gt;
Any more help would be appreciated.</description>
      <pubDate>Thu, 25 Sep 2008 14:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49778#M5407</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-25T14:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49779#M5408</link>
      <description>Sorry, I don't get the full picture here.&lt;BR /&gt;
Does &amp;amp;Prior_Month_End has datetime value?&lt;BR /&gt;
Is this only used for your title statement?&lt;BR /&gt;
&lt;BR /&gt;
If it's only for displaying a %substr would do:&lt;BR /&gt;
&lt;BR /&gt;
TITLE1 "%substr(&amp;amp;beg_date,2,9)";&lt;BR /&gt;
&lt;BR /&gt;
If you want to use for some subset, I guess you need to get the datepart out of it, here you can use %substr as well (as long as you are sure of the format of the value):&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%let beg_date = "%substr(&amp;amp;Prior_Month_End,2,7)"d;&lt;BR /&gt;
&lt;BR /&gt;
Or nicer, working with a SAS date function:&lt;BR /&gt;
&lt;BR /&gt;
%let beg_date = %sysfunc(datepart(&amp;amp;a));&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps,&lt;BR /&gt;
Linus</description>
      <pubDate>Thu, 25 Sep 2008 14:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-function/m-p/49779#M5408</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-09-25T14:54:51Z</dc:date>
    </item>
  </channel>
</rss>

