<?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: Getting Null value on using intnx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738085#M230176</link>
    <description>&lt;P&gt;Yes, it worked. Thanks a lot!!&lt;/P&gt;</description>
    <pubDate>Fri, 30 Apr 2021 03:12:04 GMT</pubDate>
    <dc:creator>anandmgjsa</dc:creator>
    <dc:date>2021-04-30T03:12:04Z</dc:date>
    <item>
      <title>Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737984#M230124</link>
      <description>&lt;P&gt;I am trying to find the starting date of the week of a date value.&lt;/P&gt;&lt;P&gt;For example, 2021-04-30 will return 2021-04-26(1st date of the week).&lt;/P&gt;&lt;P&gt;i am using the code:&lt;/P&gt;&lt;P&gt;start_week = intnx('week',date,0,'b');&lt;/P&gt;&lt;P&gt;format start_week date10.;&lt;/P&gt;&lt;P&gt;But this is returning null value.&lt;/P&gt;&lt;P&gt;Can anyone help me.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737984#M230124</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2021-04-29T18:35:20Z</dc:date>
    </item>
    <item>
      <title>Null value in intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737985#M230131</link>
      <description>&lt;P&gt;I am trying to find the starting date of the week of a date value.&lt;/P&gt;&lt;P&gt;For example, 2021-04-30 will return 2021-04-26(1st date of the week).&lt;/P&gt;&lt;P&gt;i am using the code:&lt;/P&gt;&lt;P&gt;start_week = intnx('week',date,0,'b');&lt;/P&gt;&lt;P&gt;format start_week date10.;&lt;/P&gt;&lt;P&gt;But this is returning null value.&lt;/P&gt;&lt;P&gt;Can anyone help me.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737985#M230131</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2021-04-29T18:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Null value in intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737990#M230132</link>
      <description>&lt;P&gt;Your code seems fine. I think it is the input value of date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   start_week = intnx('week', today(), 0, 'b');
   format start_week date10.;
   put start_week=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Apr 2021 19:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737990#M230132</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-04-29T19:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737996#M230133</link>
      <description>&lt;P&gt;Please post the complete log of that step. Use the &amp;lt;/&amp;gt; button to post it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 19:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/737996#M230133</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-29T19:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738007#M230135</link>
      <description>&lt;P&gt;If date is missing the result will be missing.&lt;/P&gt;
&lt;P&gt;If date is character you should see "invalid data" such as this:&lt;/P&gt;
&lt;PRE&gt;104  data junk;
105     date ='2021-01-01';
106     week = intnx('week', date,1,'b');
107  run;

NOTE: Character values have been converted to numeric values at the places given by:
      (Line):(Column).
      106:25
NOTE: Invalid numeric data, date='2021-01-01' , at line 106 column 25.
date=2021-01-01 week=. _ERROR_=1 _N_=1
&lt;/PRE&gt;
&lt;P&gt;If date is actually a datetime value you should get an invalid message like this because the values of datetimes when used as a date without appropriate conversion or options often exceed the range of values the date related functions will handle.&lt;/P&gt;
&lt;PRE&gt;108  data junk;
109     date ='01JAN2021:12:15:00'dt;
110     put date= datetime18.;
111     week = intnx('week', date,1,'b');
112  run;

date=01JAN21:12:15:00
NOTE: Invalid argument to function INTNX('week',1925122500,1,'b') at line 111 column 11.
date=1925122500 week=. _ERROR_=1 _N_=1
NOTE: Mathematical operations could not be performed at the following places. The results of the
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 111:11
&lt;/PRE&gt;
&lt;P&gt;All of these cases will return missing values from the intnx function.&lt;/P&gt;
&lt;P&gt;So, which values are you actually supplying to the function? And are you getting notes in the log?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 20:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738007#M230135</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-29T20:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738011#M230137</link>
      <description>Yes, I am getting the notes mentioned by you. But the input used by me is date itself not datetime. Or I am missing something. Please clarify.</description>
      <pubDate>Thu, 29 Apr 2021 20:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738011#M230137</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2021-04-29T20:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738014#M230138</link>
      <description>What is the type and format of the date variable?&lt;BR /&gt;It should be a numeric variable with a format of yymmdd10. &lt;BR /&gt;</description>
      <pubDate>Thu, 29 Apr 2021 20:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738014#M230138</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-29T20:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738015#M230139</link>
      <description>Yes, it is in the same format yymmdd10. Example:2020-05-28.</description>
      <pubDate>Thu, 29 Apr 2021 20:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738015#M230139</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2021-04-29T20:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738023#M230142</link>
      <description>You can have a character variable appear that way though. Post the log from your code that will help us determine what the issue is.&lt;BR /&gt;&lt;BR /&gt;Or try this and let us know what happens:&lt;BR /&gt;&lt;BR /&gt;week = intnx('week', input(date, yymmdd10.),0,'b');</description>
      <pubDate>Thu, 29 Apr 2021 20:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738023#M230142</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-29T20:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738025#M230144</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380276"&gt;@anandmgjsa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Yes, I am getting the notes mentioned by you. But the input used by me is date itself not datetime. Or I am missing something. Please clarify.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means that you really have to follow &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s recommendation and &lt;STRONG&gt;show us your log.&lt;/STRONG&gt; Copy the text for the entire data step plus messages from the log. On the forum open a text box by clicking on the &amp;lt;/&amp;gt; icon above the message window and paste.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 20:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738025#M230144</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-29T20:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738085#M230176</link>
      <description>&lt;P&gt;Yes, it worked. Thanks a lot!!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 03:12:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738085#M230176</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2021-04-30T03:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Null value on using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738184#M230215</link>
      <description>That means your variable was a character variable, not a SAS date.</description>
      <pubDate>Fri, 30 Apr 2021 15:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-Null-value-on-using-intnx/m-p/738184#M230215</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-30T15:49:33Z</dc:date>
    </item>
  </channel>
</rss>

