<?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 Numeric Value vs Date Format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11720#M1451</link>
    <description>Hello All&lt;BR /&gt;
&lt;BR /&gt;
In my data set I have a variable called "Period_End_Date". When I ran a Proc Contents on the dataset it see that the variable is listed as a numeric variable with date9. format.&lt;BR /&gt;
&lt;BR /&gt;
data wps_dply.temp1;&lt;BR /&gt;
	set input.dataset; &lt;BR /&gt;
	where period_end_date=31-1-2009;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
There are no error messages in the log however  am not getting an output. The log is displaying a message saying:&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 0 observations read from the data set INPUT.DATASET.&lt;BR /&gt;
      WHERE period_end_date=((31-1)-2009);&lt;BR /&gt;
NOTE: The data set WPS_DPLY.TEMP1 has 0 observations and 8 variables.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody tell me why I am not having any observations in my dataset?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help in advance.&lt;BR /&gt;
Pappu.</description>
    <pubDate>Thu, 26 Mar 2009 18:39:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-03-26T18:39:27Z</dc:date>
    <item>
      <title>Numeric Value vs Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11720#M1451</link>
      <description>Hello All&lt;BR /&gt;
&lt;BR /&gt;
In my data set I have a variable called "Period_End_Date". When I ran a Proc Contents on the dataset it see that the variable is listed as a numeric variable with date9. format.&lt;BR /&gt;
&lt;BR /&gt;
data wps_dply.temp1;&lt;BR /&gt;
	set input.dataset; &lt;BR /&gt;
	where period_end_date=31-1-2009;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
There are no error messages in the log however  am not getting an output. The log is displaying a message saying:&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 0 observations read from the data set INPUT.DATASET.&lt;BR /&gt;
      WHERE period_end_date=((31-1)-2009);&lt;BR /&gt;
NOTE: The data set WPS_DPLY.TEMP1 has 0 observations and 8 variables.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody tell me why I am not having any observations in my dataset?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help in advance.&lt;BR /&gt;
Pappu.</description>
      <pubDate>Thu, 26 Mar 2009 18:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11720#M1451</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-26T18:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Value vs Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11721#M1452</link>
      <description>Hi:&lt;BR /&gt;
  There is quite a long explanation of date constants in this previous forum posting:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=10671⦯" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=10671⦯&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  ...that may help you.&lt;BR /&gt;
&lt;BR /&gt;
  The bottom line is that you have to use or ask for the date in the form that SAS expects...either as the date in number form for the where clause or the date as a date constant for the where clause:&lt;BR /&gt;
[pre]&lt;BR /&gt;
where period_end_date = '31Jan2009'd;&lt;BR /&gt;
OR&lt;BR /&gt;
where period_end_date = 17928;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                           &lt;BR /&gt;
The first example is a date constant, which is easier to read and to change. The second example is the "number" 17928 because Jan 31, 2009 is 17,928 days from Jan 1, 1960 (which represents a 0 in the SAS date time line).&lt;BR /&gt;
&lt;BR /&gt;
For example, if Jan 1 1960 = 0 then here are some other date values shown as how they are internally stored by SAS:&lt;BR /&gt;
&lt;BR /&gt;
-3334 = 15Nov1950&lt;BR /&gt;
-365 = 01Jan1959&lt;BR /&gt;
0 = 01Jan1960&lt;BR /&gt;
1 = 02Jan1960&lt;BR /&gt;
2 = 03Jan1960&lt;BR /&gt;
74 = 15Mar1960&lt;BR /&gt;
3683 = 31Jan1970&lt;BR /&gt;
17928 = 31Jan2009&lt;BR /&gt;
17982 = 26Mar2009&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 26 Mar 2009 19:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11721#M1452</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-03-26T19:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Value vs Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11722#M1453</link>
      <description>Hi Pappu,&lt;BR /&gt;
&lt;BR /&gt;
here in your dataset variable period_end_date in the form of date9. format, so u have to give &lt;BR /&gt;
where period_end_date='31jan2009'd; run;&lt;BR /&gt;
&lt;BR /&gt;
here is example&lt;BR /&gt;
&lt;BR /&gt;
data date;&lt;BR /&gt;
input a period_end_date ddmmyy10.;&lt;BR /&gt;
cards;&lt;BR /&gt;
120 12-12-2007&lt;BR /&gt;
112 11-12-2008&lt;BR /&gt;
113 31-1-2009&lt;BR /&gt;
;&lt;BR /&gt;
proc print;&lt;BR /&gt;
format period_end_date date9.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
set date;&lt;BR /&gt;
where period_end_date='31jan2009'd&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Venky.</description>
      <pubDate>Fri, 27 Mar 2009 06:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11722#M1453</guid>
      <dc:creator>venkatesh</dc:creator>
      <dc:date>2009-03-27T06:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Value vs Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11723#M1454</link>
      <description>Thanks for the explaination Cynthia and venkatesh!!!</description>
      <pubDate>Fri, 27 Mar 2009 13:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Value-vs-Date-Format/m-p/11723#M1454</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-27T13:43:51Z</dc:date>
    </item>
  </channel>
</rss>

