<?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: Invalid argument to function INPUT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497735#M132033</link>
    <description>&lt;P&gt;The log tells you:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Invalid &lt;SPAN class="token function"&gt;month&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Invalid argument to function &lt;SPAN class="token keyword"&gt;INPUT&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Missing&lt;/SPAN&gt; values may be generated&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As we cannot see your data we cannot debug this, look at your data, find the invalid month value{s} and correct for this.&amp;nbsp; I would guess:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;NEW_RENEWAL_DAY_MONTH_YEAR&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is the problem&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 09:39:54 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-09-21T09:39:54Z</dc:date>
    <item>
      <title>Invalid argument to function INPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497733#M132031</link>
      <description>&lt;P&gt;Could you please help me understand what I'm missing here? May I know which argument is invalid?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4578               (case when NEW_RENEWAL_DAY_MONTH_YEAR=REPORTING_DATE_ddmon then input("&amp;amp;reporting_date.",date9.)
SYMBOLGEN:  Macro variable REPORTING_DATE resolves to 30JUN2018
14579                       when input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.) &amp;gt; today() then
14579    ! input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.)
14580                       else input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2019"),date9.) end) as PODVER length = 8
14581                  format = date5.
14582         from &amp;amp;SYSLAST
SYMBOLGEN:  Macro variable SYSLAST resolves to WORK.W728Z2TN                        
14583            where case when NEW_RENEWAL_DAY_MONTH_YEAR=REPORTING_DATE_ddmon then "&amp;amp;reporting_date."d
SYMBOLGEN:  Macro variable REPORTING_DATE resolves to 30JUN2018
14584                    when input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.) &amp;lt; today() then
14584    ! input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.)
14585                    else input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2019"),date9.) end
14586         ;
NOTE: Invalid month value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
NOTE: Invalid month value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
NOTE: Table WORK.W729IB79 created, with 0 rows and 43 columns.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Sep 2018 09:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497733#M132031</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-09-21T09:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function INPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497735#M132033</link>
      <description>&lt;P&gt;The log tells you:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Invalid &lt;SPAN class="token function"&gt;month&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Invalid argument to function &lt;SPAN class="token keyword"&gt;INPUT&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Missing&lt;/SPAN&gt; values may be generated&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As we cannot see your data we cannot debug this, look at your data, find the invalid month value{s} and correct for this.&amp;nbsp; I would guess:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;NEW_RENEWAL_DAY_MONTH_YEAR&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is the problem&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 09:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497735#M132033</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-21T09:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function INPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497742#M132038</link>
      <description>&lt;P&gt;I've data as follows and I've tested the code using data step already.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	renewal_date='09mar';
	output;
	renewal_date='09nov';
	output;
	renewal_date='19sep';
	output;
run;

proc sql;
	create table test1 as select 
		case 
			when renewal_date="19sep" then "19sep2019"d
			when input(cats(renewal_date,"2018"),date9.) &amp;gt; today() then input(cats(renewal_date,"2018"),date9.)
			else input(cats(renewal_date,"2019"),date9.) 
		end 
	as new_renewal_date 
		from test;
quit;

data test2;
	set test1;
	format new_renewal_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inorder to replicate the same logic in DI studio under expression, I wrote case when as mentioned in the log below. One change is I've hard coded (19Sep) the date value in data step whereas I've substitute the respective date variable (REPORTING_DATE_ddmon) in following expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;17069               (case when NEW_RENEWAL_DAY_MONTH_YEAR=REPORTING_DATE_ddmon then input("&amp;amp;reporting_date.",date9.)
SYMBOLGEN:  Macro variable REPORTING_DATE resolves to 30JUN2018
17070                       when input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.) &amp;gt; today() then
17070    ! input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.)
17071                       else input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2019"),date9.) end) as PODVER length = 8
17072                  format = date9.
17073         from &amp;amp;SYSLAST
SYMBOLGEN:  Macro variable SYSLAST resolves to WORK.W728Z2TN                        
17074            where case when NEW_RENEWAL_DAY_MONTH_YEAR=REPORTING_DATE_ddmon then "&amp;amp;reporting_date."d
SYMBOLGEN:  Macro variable REPORTING_DATE resolves to 30JUN2018
17075                    when input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.) &amp;lt; today() then
17075    ! input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2018"),date9.)
17076                    else input(cats(NEW_RENEWAL_DAY_MONTH_YEAR,"2019"),date9.) end
17077         ;
NOTE: Invalid month value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
NOTE: Invalid month value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
NOTE: Table WORK.W729IB79 created, with 0 rows and 43 columns.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 09:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497742#M132038</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-09-21T09:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function INPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497746#M132041</link>
      <description>&lt;P&gt;All I can do is re-iterate what I said previously, the log is telling you:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Invalid &lt;SPAN class="token function"&gt;month&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Invalid argument to function &lt;SPAN class="token keyword"&gt;INPUT&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Missing&lt;/SPAN&gt; values may be generated&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;herefore you need to look at your data and find which invalid data is being fed into the input statement.&amp;nbsp; My guess is still&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;NEW_RENEWAL_DAY_MONTH_YEAR&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However I cannot see your data (and posting some example data which works doesn't help I am afraid, you need to look at the data used in the SQL).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 10:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497746#M132041</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-21T10:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function INPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497747#M132042</link>
      <description>&lt;P&gt;I agree with RW9 that it must be&amp;nbsp;NEW_RENEWAL_DAY_MONTH_YEAR. The confusion starts with misleading variable names: Doesn't this name suggest that the variable contains a year portion? If so, how could it be equal to a variable named ..._ddmon or would it make sense to concatenate it with "2018" etc.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moreover, the WHERE condition looks unusual: a SAS date value used as a Boolean expression (i.e., it doesn't matter what date it is, only whether or not it's missing or 0).&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 10:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497747#M132042</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-21T10:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function INPUT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497854#M132116</link>
      <description>&lt;P&gt;And you have still not shown &lt;STRONG&gt;any actual value&lt;/STRONG&gt; for ANY of the variables involved in the calculations.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 15:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-INPUT/m-p/497854#M132116</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-21T15:00:17Z</dc:date>
    </item>
  </channel>
</rss>

