<?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 NOTE : Invalid Argument to function Input in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/922904#M363371</link>
    <description>&lt;P&gt;I have the below dataset which contains both character and numeric data as shown below :&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=""&gt;data example;
length Var1 $10.;
input Var1 $;
datalines;
AB
CD
100
400
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to output result by using input function shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data cleaned_data;
set example;
Result = put(input(Var1, best3.), z3.);
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But after running this getting note :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 90 column 18.&lt;/DIV&gt;&lt;DIV class=""&gt;Var1=AB Result=. _ERROR_=1 _N_=1&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 90 column 18.&lt;/DIV&gt;&lt;DIV class=""&gt;Var1=CD Result=. _ERROR_=1 _N_=2&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to&lt;/DIV&gt;&lt;DIV class=""&gt;missing values.&lt;/DIV&gt;&lt;DIV class=""&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/DIV&gt;&lt;DIV class=""&gt;2 at 90:18&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;So what can be done to get rid of this issue. Can anyone help please....&lt;/DIV&gt;</description>
    <pubDate>Thu, 04 Apr 2024 07:51:33 GMT</pubDate>
    <dc:creator>Son_Of_Krypton</dc:creator>
    <dc:date>2024-04-04T07:51:33Z</dc:date>
    <item>
      <title>NOTE : Invalid Argument to function Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/922904#M363371</link>
      <description>&lt;P&gt;I have the below dataset which contains both character and numeric data as shown below :&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=""&gt;data example;
length Var1 $10.;
input Var1 $;
datalines;
AB
CD
100
400
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to output result by using input function shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data cleaned_data;
set example;
Result = put(input(Var1, best3.), z3.);
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But after running this getting note :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 90 column 18.&lt;/DIV&gt;&lt;DIV class=""&gt;Var1=AB Result=. _ERROR_=1 _N_=1&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 90 column 18.&lt;/DIV&gt;&lt;DIV class=""&gt;Var1=CD Result=. _ERROR_=1 _N_=2&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to&lt;/DIV&gt;&lt;DIV class=""&gt;missing values.&lt;/DIV&gt;&lt;DIV class=""&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/DIV&gt;&lt;DIV class=""&gt;2 at 90:18&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;So what can be done to get rid of this issue. Can anyone help please....&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Apr 2024 07:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/922904#M363371</guid>
      <dc:creator>Son_Of_Krypton</dc:creator>
      <dc:date>2024-04-04T07:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE : Invalid Argument to function Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/922907#M363372</link>
      <description>&lt;P&gt;Does below return what you're after?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
  input var1 :$10.;
  datalines;
AB
CD
1.5
400
5
;
run;

data cleaned_data;
  set example;
  if notdigit(strip(var1)) then result=var1;
  else result=put(input(var1, ?? best32.), z3.);
run;

proc print data=cleaned_data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1712219341789.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95197i1E1F20F4B61D08C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1712219341789.png" alt="Patrick_0-1712219341789.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 08:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/922907#M363372</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-04T08:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE : Invalid Argument to function Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/964098#M375497</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;, thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use of ?? before format is really useful. At least is was useful to me when there was some data issue. Seems that there were some characters which looked same (Week 12) to eyes but which were different in reality. Anyhow, use of ?? worked for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Dr. Abhijeet Safai&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 10:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/964098#M375497</guid>
      <dc:creator>DrAbhijeetSafai</dc:creator>
      <dc:date>2025-04-11T10:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE : Invalid Argument to function Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/964131#M375501</link>
      <description>&lt;P&gt;What specific numeric values do you expect to be output for the strings "AB" and "CD"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 16:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Invalid-Argument-to-function-Input/m-p/964131#M375501</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-04-11T16:15:02Z</dc:date>
    </item>
  </channel>
</rss>

