<?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: input function unnecessarily converting numeric to characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313587#M68169</link>
    <description>&lt;P&gt;I am trying to use informats for data validation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, the external data is expected to have three values 0, 1, and 99 to indicate unknown.&amp;nbsp; I want to return a variable with just 0 and 1, convert the 99 to missing and throw an error when other values are encountered.&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 _externalData;	
	a=1; output; 
	a=0; output;
	a=77; output;
	a=99; output;
run;

proc format;
	invalue test	
		0-1 	= _same_
		99	= . 
		other 	= _error_
	;
run;

data _myData;	
	set _externalData;
	b = input(a, test.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The results are what I desire, I just want to get rid of the (seemingly) unnecessary NOTE in the log.&amp;nbsp; Should I be using another function besides input?&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2016 20:32:07 GMT</pubDate>
    <dc:creator>KAZ</dc:creator>
    <dc:date>2016-11-22T20:32:07Z</dc:date>
    <item>
      <title>input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313577#M68163</link>
      <description>&lt;P&gt;I am attempting to get rid of a NOTE in the log file. (v9.4, Windows)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;	
	a=1; output; 
run;

data _temp2;	
	set _temp;
	b = input(a, best12.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the log, there is this NOTE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Numeric values have been converted to character values at the places given by:&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both variables a and b are numeric, and best12. is numeric informat.&amp;nbsp; Why is the input function converting numeric values to character values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there another function I should use to get rid of the NOTE in the log?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313577#M68163</guid>
      <dc:creator>KAZ</dc:creator>
      <dc:date>2016-11-22T20:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313578#M68164</link>
      <description>&lt;P&gt;Because input() is designed to input from&amp;nbsp;&lt;U&gt;strings&lt;/U&gt;, the numeric value in a must first be converted to character, so it can be read with the best12.&amp;nbsp;&lt;STRONG&gt;in&lt;/STRONG&gt;format.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313578#M68164</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-22T20:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313581#M68167</link>
      <description>&lt;P&gt;INPUT() function is used to convert character to numeric. In your example INPUT(a,best12.) --&amp;gt; Here 'a' must be given character values. Since you gave numeric value it converted to character and again ti numeric.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313581#M68167</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-11-22T20:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313583#M68168</link>
      <description>&lt;P&gt;What are you trying to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313583#M68168</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-22T20:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313587#M68169</link>
      <description>&lt;P&gt;I am trying to use informats for data validation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, the external data is expected to have three values 0, 1, and 99 to indicate unknown.&amp;nbsp; I want to return a variable with just 0 and 1, convert the 99 to missing and throw an error when other values are encountered.&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 _externalData;	
	a=1; output; 
	a=0; output;
	a=77; output;
	a=99; output;
run;

proc format;
	invalue test	
		0-1 	= _same_
		99	= . 
		other 	= _error_
	;
run;

data _myData;	
	set _externalData;
	b = input(a, test.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The results are what I desire, I just want to get rid of the (seemingly) unnecessary NOTE in the log.&amp;nbsp; Should I be using another function besides input?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313587#M68169</guid>
      <dc:creator>KAZ</dc:creator>
      <dc:date>2016-11-22T20:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313589#M68170</link>
      <description>&lt;P&gt;Do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;b = input(put(a,best.),test.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313589#M68170</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-22T20:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: input function unnecessarily converting numeric to characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313593#M68172</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; _externalData; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;a=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;a=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;a=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;77&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;a=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;99&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;value&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; tet &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;99&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;other =&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"_error_"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; _myData; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; _externalData;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;b = put(a, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;test.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-unnecessarily-converting-numeric-to-characters/m-p/313593#M68172</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-11-22T20:54:26Z</dc:date>
    </item>
  </channel>
</rss>

