<?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: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778502#M247809</link>
    <description>&lt;P&gt;Yes it does replicate my error&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 15:19:20 GMT</pubDate>
    <dc:creator>Rixile106</dc:creator>
    <dc:date>2021-11-04T15:19:20Z</dc:date>
    <item>
      <title>ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778497#M247806</link>
      <description>&lt;P&gt;Good day expect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;am running the below script and and am getting the this error message&lt;/P&gt;&lt;LI-SPOILER&gt;ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;
	CREATE TABLE INSTA_A AS
		SELECT INPUT(PUT(COMPRESS(INPUT(PUT(ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) AS ACCOUNT
			,A_COMM_DT AS COMM_DT
			,A_EXP_DT AS EXP_DT
			,'A' AS INSTRUCTION
		FROM VBM.INST_A
		WHERE INPUT(PUT(A_COMM_DT,Z8.),YYMMDD8.) &amp;gt; TODAY() + 365
		;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778497#M247806</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2021-11-04T14:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778499#M247807</link>
      <description>&lt;P&gt;Without knowing the A_COMM_DT values, it's hard to tell what is causing the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still my guess is you have an A_COMM_DT value that doesn't fit the YYMMDD8. format e.g. 20210231 (no 31st of Feb)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following will replicate your error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
	infile cards ;
	input a_comm_dt ;
cards ;
20230315
20230415
20230515
20230229
;

proc sql ;
	select 
		a_comm_dt as comm_dt
	from
		have
	where 
		input(put(a_comm_dt,z8.),yymmdd8.) &amp;gt; today() + 365 
	;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778499#M247807</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-11-04T15:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778501#M247808</link>
      <description>&lt;P&gt;here are the values of&amp;nbsp;A_COMM_DT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20220228&lt;BR /&gt;20210911&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778501#M247808</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2021-11-04T15:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778502#M247809</link>
      <description>&lt;P&gt;Yes it does replicate my error&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778502#M247809</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2021-11-04T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778503#M247810</link>
      <description>Are you sure? You only have 2 observations and those are the 2 values. &lt;BR /&gt;If you take those and drop them in the sample code (removing my bad 20230229 date) I supplied you'll see they work (at least they do for me).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778503#M247810</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-11-04T15:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778504#M247811</link>
      <description>Provide code and data to replicate the error, like I did. &lt;BR /&gt;Then we will be better able to help.</description>
      <pubDate>Thu, 04 Nov 2021 15:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778504#M247811</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-11-04T15:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778506#M247812</link>
      <description>i have more than 200 observations, i was just showing you an example&lt;BR /&gt;&lt;BR /&gt;20220228&lt;BR /&gt;20210911&lt;BR /&gt;20210911&lt;BR /&gt;20080901&lt;BR /&gt;20080128&lt;BR /&gt;20170925&lt;BR /&gt;20140830&lt;BR /&gt;20120728&lt;BR /&gt;20020528&lt;BR /&gt;20160902&lt;BR /&gt;20100413&lt;BR /&gt;20110209&lt;BR /&gt;20001017&lt;BR /&gt;20210101&lt;BR /&gt;20210625&lt;BR /&gt;20210801&lt;BR /&gt;20141028&lt;BR /&gt;20040720&lt;BR /&gt;20170729&lt;BR /&gt;20201201&lt;BR /&gt;20060601&lt;BR /&gt;20110127&lt;BR /&gt;20020829&lt;BR /&gt;20110831&lt;BR /&gt;20050103&lt;BR /&gt;19820809&lt;BR /&gt;20201120&lt;BR /&gt;20071027&lt;BR /&gt;20200229&lt;BR /&gt;20191225&lt;BR /&gt;20190120&lt;BR /&gt;20060627&lt;BR /&gt;20041228&lt;BR /&gt;20170227&lt;BR /&gt;20121030&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778506#M247812</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2021-11-04T15:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778508#M247814</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/399790"&gt;@Rixile106&lt;/a&gt;&amp;nbsp;You need to look at the values you have and check for invalid dates.&lt;BR /&gt;The error message is clear, it's telling you a date value in your data is not valid e.g. 20211301, 20210229, etc.&lt;/P&gt;
&lt;P&gt;Could it be something else? Yes, but that is very unlikely.&lt;/P&gt;
&lt;P&gt;I'd start with the obvious, go look at the data, specifically&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Any rows where the day is 29|30|31&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Any months that are not 01-12 (the 0 needs to be there on the single digits)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778508#M247814</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-11-04T15:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778509#M247815</link>
      <description>&lt;P&gt;You can make the error MESSAGE go away by adding the ? modifier before the informat.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input(put(a_comm_dt,z8.),?yymmdd8.) &amp;gt; today() + 365&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But those records with invalid A_COMM_DT values will be excluded by your WHERE clause because missing values are less than any valid value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should look at the observations with the invalid dates and decide what to do with them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
  set  VBM.INST_A;
  if missing(INPUT(PUT(A_COMM_DT,Z8.),??YYMMDD8.)) and not missing(A_COMM_DT) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-INPUT-function-reported-ERROR-Invalid-date-value-while/m-p/778509#M247815</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-04T15:40:57Z</dc:date>
    </item>
  </channel>
</rss>

