<?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: converting character value into numeric value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780851#M248846</link>
    <description>Thanks , it worked .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 17 Nov 2021 19:55:48 GMT</pubDate>
    <dc:creator>u52766097</dc:creator>
    <dc:date>2021-11-17T19:55:48Z</dc:date>
    <item>
      <title>converting character value into numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780820#M248826</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;I am trying to convert the ASSEV variables values into numeric values . I created format for that and then used that format , but the numeric variable (AESEVN) values are missing. What wrong I am doing ,could u plz check .&lt;/P&gt;&lt;P&gt;Format&amp;nbsp; and note is below ;&lt;/P&gt;&lt;P&gt;/****************************************/&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;invalue sev&lt;BR /&gt;"mild" = 1&lt;BR /&gt;"moderate" = 2&lt;BR /&gt;"severe" = 3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set ae;&lt;BR /&gt;aesevn = input(aesev,??sev.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;note is showing into the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-15 aeterm=AE1 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=1&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-25 aeterm=AE1 aesev=Severe aeser= aediscon= aesevn=. _ERROR_=1 _N_=2&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-15 aeterm=AE2 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=3&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-25 aeterm=AE2 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=4&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-15 aeterm=AE3 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=5&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-25 aeterm=AE3 aesev=Mild aeser= aediscon=1 aesevn=. _ERROR_=1 _N_=6&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;Thanks&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Nov 2021 18:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780820#M248826</guid>
      <dc:creator>u52766097</dc:creator>
      <dc:date>2021-11-17T18:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: converting character value into numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780821#M248827</link>
      <description>&lt;P&gt;Spelling counts. "mild" is not "Mild" , which appears in your data.&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;proc format;
invalue sev (upcase)
"MILD" = 1
"MODERATE" = 2
"SEVERE" = 3;
run;&lt;/PRE&gt;
&lt;P&gt;The upcase option will turn the text into upper case before comparing the values in the informat list. So spellings in the source of "mild" "Mild" "mILD" "milD" and other possible typos all use "MILD" for assigning the numeric value.&lt;/P&gt;
&lt;P&gt;If your data is clean, then use the proper spelling to begin with. I tend to use the UPCASE option on all my character to numeric informats just because I don't trust my sources (with good reason) to spell things consistently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/364694"&gt;@u52766097&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;I am trying to convert the ASSEV variables values into numeric values . I created format for that and then used that format , but the numeric variable (AESEVN) values are missing. What wrong I am doing ,could u plz check .&lt;/P&gt;
&lt;P&gt;Format&amp;nbsp; and note is below ;&lt;/P&gt;
&lt;P&gt;/****************************************/&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;invalue sev&lt;BR /&gt;"mild" = 1&lt;BR /&gt;"moderate" = 2&lt;BR /&gt;"severe" = 3;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;set ae;&lt;BR /&gt;aesevn = input(aesev,??sev.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;note is showing into the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;
&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-15 aeterm=AE1 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=1&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;
&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-25 aeterm=AE1 aesev=Severe aeser= aediscon= aesevn=. _ERROR_=1 _N_=2&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;
&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-15 aeterm=AE2 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=3&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;
&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-25 aeterm=AE2 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=4&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;
&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-15 aeterm=AE3 aesev=Mild aeser= aediscon= aesevn=. _ERROR_=1 _N_=5&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: Invalid argument to function INPUT at line 71 column 10.&lt;/DIV&gt;
&lt;DIV class=""&gt;usubjid=1001 aestdtc=2021-01-25 aeterm=AE3 aesev=Mild aeser= aediscon=1 aesevn=. _ERROR_=1 _N_=6&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;Thanks&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 18:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780821#M248827</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-17T18:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: converting character value into numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780851#M248846</link>
      <description>Thanks , it worked .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Nov 2021 19:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-value-into-numeric-value/m-p/780851#M248846</guid>
      <dc:creator>u52766097</dc:creator>
      <dc:date>2021-11-17T19:55:48Z</dc:date>
    </item>
  </channel>
</rss>

