<?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: Character to numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348176#M80594</link>
    <description>&lt;P&gt;Guessing at the meaning of the notes in the log ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would guess that you are using the name a numeric variable in the TABLE and WHERE statements.&amp;nbsp; You need to be using the character variable that you are trying to turn into a set of numeric values.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 15:49:00 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-04-07T15:49:00Z</dc:date>
    <item>
      <title>Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347896#M80474</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two charact variables that I want to change to numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first has continuous numbers in it, but also has 4 charact. inputs. I would like to keep the continous numbers and change the character to missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried creating new variable with format and the next code but did not work. Also compress method tells me : too many arguments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FORMAT &lt;SPAN&gt;NEW_VAR1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;3.;&lt;/P&gt;&lt;P&gt;IF VAR1= 'N/A' THEN NEW_VAR1&amp;nbsp;= . ;&lt;BR /&gt;IF &lt;SPAN&gt;VAR1&lt;/SPAN&gt;= 'Unk' THEN &lt;SPAN&gt;NEW_VAR1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= . ;&lt;BR /&gt;IF &lt;SPAN&gt;VAR1&lt;/SPAN&gt;= 'n/a' THEN &lt;SPAN&gt;NEW_VAR1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= . ;&lt;BR /&gt;IF &lt;SPAN&gt;VAR1&lt;/SPAN&gt;= 'unk' THEN &lt;SPAN&gt;NEW_VAR1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= . ;&lt;BR /&gt;IF &lt;SPAN&gt;VAR1&lt;/SPAN&gt;= '' THEN &lt;SPAN&gt;NEW_VAR1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= . ;&lt;BR /&gt;ELSE &lt;SPAN&gt;NEW_VAR1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= &lt;SPAN&gt;VAR1&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second variable is smoking variable, it has 5 values as below :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FORMAT &amp;nbsp;SMOKING &amp;nbsp;3.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF CIGARETTE= 'NEVER' THEN SMOKING = 0 ;&lt;BR /&gt;IF &lt;SPAN&gt;CIGARETTE&lt;/SPAN&gt;= 'BEFORE' THEN SMOKING = 1 ;&lt;BR /&gt;IF &lt;SPAN&gt;CIGARETTE&lt;/SPAN&gt;= 'NOW' THEN SMOKING = 2 ;&lt;BR /&gt;IF &lt;SPAN&gt;CIGARETTE&lt;/SPAN&gt;= 'EVERYDAY' THEN SMOKING = 2 ;&lt;BR /&gt;IF &lt;SPAN&gt;CIGARETTE&lt;/SPAN&gt;= 'UNKNOWN' THEN SMOKING = . ;&lt;BR /&gt;IF &lt;SPAN&gt;CIGARETTE&lt;/SPAN&gt;= '' THEN SMOKING = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ERROR log :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by:&lt;BR /&gt;(Line):(Column).&lt;BR /&gt;2404:5 2460:6 2461:16 2471:6 2472:19&lt;BR /&gt;NOTE: Invalid numeric data, ........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something that I'm missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&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;</description>
      <pubDate>Thu, 06 Apr 2017 19:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347896#M80474</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-06T19:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347902#M80477</link>
      <description>&lt;P&gt;Would help if you provide some example data and what you want as a result (based on that example data).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will likely need to use the input function rather than just have the new numeric variable equal the original character variable, but if there are any instances you haven't accounted for with your if statements, you'll also have to use compress or a similar function to eliminate the characters in the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 19:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347902#M80477</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-06T19:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347903#M80478</link>
      <description>&lt;P&gt;Which lines is the log referring to?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify your code by using IN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if var1 in ('N/A', 'Unk', ....etc) then new_Var1=.;&lt;/P&gt;
&lt;P&gt;else ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 19:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347903#M80478</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-06T19:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347910#M80484</link>
      <description>&lt;P&gt;Most likely, your data contains additional values for your character variables that your programming statements must take into account.&amp;nbsp; Try running this program to see a list of all of those:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables var1;&lt;/P&gt;
&lt;P&gt;where var1 &amp;gt; ' ' and input(var1, ??8.) = .;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, you need to run this type of program for each variable separately.&amp;nbsp; But it will point out what you need to work on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could just perform the conversion without worrying about which values can't be converted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_var1 = input(var1, ??8.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ?? suppresses messages about invalid data when trying to convert from character to numeric.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 20:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347910#M80484</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-06T20:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347915#M80487</link>
      <description>You can use compress with 'kd' argument:&lt;BR /&gt;&lt;BR /&gt;Sample;&lt;BR /&gt;string='StudySAS Blog! 17752. ' ;&lt;BR /&gt;string11=compress(string,'','kd') ;&lt;BR /&gt;&lt;BR /&gt;Result:&lt;BR /&gt;string11=17752</description>
      <pubDate>Thu, 06 Apr 2017 20:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/347915#M80487</guid>
      <dc:creator>Yavuz</dc:creator>
      <dc:date>2017-04-06T20:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348125#M80573</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it but it did not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll upload a data file wit the two variables&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348125#M80573</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348126#M80574</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it but it did not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;386 proc freq data=EXMED_NOTMULTI_3;&lt;BR /&gt;387 tables TAS3moisvisite1;&lt;BR /&gt;388 where TAS3moisvisite1 &amp;gt; ' ' and input(TADdebutvisite1, ??8.) = . ;&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;200&lt;BR /&gt;ERROR: Erreur de syntaxe détectée lors de l'analyse de la clause WHERE.&lt;BR /&gt;ERROR 22-322: Expecting un nom de format.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;389 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry for the french part,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll upload a data file wit the two variables&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348126#M80574</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348128#M80575</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply,&lt;BR /&gt;I tried it but it did not work.&lt;BR /&gt;&lt;BR /&gt;I'll upload a data file wit the two variables</description>
      <pubDate>Fri, 07 Apr 2017 14:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348128#M80575</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348130#M80576</link>
      <description>&lt;P&gt;Looks like you changed the variable name. &amp;nbsp;Use the same variable name throughout the WHERE statement.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:46:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348130#M80576</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-07T14:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348131#M80577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried&amp;nbsp;compress before, it worked for another variables but not the ones with 5 character values, it said (error too many arguments)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm uploading a tata file with the two variables that need to be reformatted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:48:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348131#M80577</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348132#M80578</link>
      <description>Sorry for that,&lt;BR /&gt;&lt;BR /&gt;I was trying several variables. It gives me the same error message&lt;BR /&gt;&lt;BR /&gt;391 proc freq data=EXMED_NOTMULTI_3;&lt;BR /&gt;392 tables TADdebutvisite1;&lt;BR /&gt;393 where TADdebutvisite1 &amp;gt; ' ' and input(TADdebutvisite1, ??8.) = . ;&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;200&lt;BR /&gt;ERROR: Erreur de syntaxe détectée lors de l'analyse de la clause WHERE.&lt;BR /&gt;ERROR 22-322: Expecting un nom de format.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;394 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348132#M80578</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348133#M80579</link>
      <description>&lt;P&gt;&lt;A href="https://liveumoncton-my.sharepoint.com/personal/pse2915_umoncton_ca/_layouts/15/guestaccess.aspx?docid=1d62a060b99a04863ab8db96a0038fe2e&amp;amp;authkey=AaTF79pYDzTtp1K5hvKjRWY" target="_blank"&gt;https://liveumoncton-my.sharepoint.com/personal/pse2915_umoncton_ca/_layouts/15/guestaccess.aspx?docid=1d62a060b99a04863ab8db96a0038fe2e&amp;amp;authkey=AaTF79pYDzTtp1K5hvKjRWY&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348133#M80579</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348134#M80580</link>
      <description>The attachement is not working, I uploaded a onedrive link. It's from my university account (secured)</description>
      <pubDate>Fri, 07 Apr 2017 14:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348134#M80580</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348137#M80581</link>
      <description>&lt;P&gt;The attachement is not working, I uploaded a onedrive link. It's from my university account (secured)&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348137#M80581</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T14:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348138#M80582</link>
      <description>&lt;A href="https://liveumoncton-my.sharepoint.com/personal/pse2915_umoncton_ca/_layouts/15/guestaccess.aspx?docid=1d62a060b99a04863ab8db96a0038fe2e&amp;amp;authkey=AaTF79pYDzTtp1K5hvKjRWY" target="_blank"&gt;https://liveumoncton-my.sharepoint.com/personal/pse2915_umoncton_ca/_layouts/15/guestaccess.aspx?docid=1d62a060b99a04863ab8db96a0038fe2e&amp;amp;authkey=AaTF79pYDzTtp1K5hvKjRWY&lt;/A&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348138#M80582</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T15:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348141#M80584</link>
      <description>I was wondering, does this blog allow sharing SAS data files or no? I was unable to do so, it said contents of file does not correspond with the name!?</description>
      <pubDate>Fri, 07 Apr 2017 15:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348141#M80584</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T15:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348148#M80585</link>
      <description>&lt;P&gt;The following worked for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;libname thedata '/folders/myfolders';

DATA EXMED_NOTMULTI_3;
  set thedata.exmed_test1 (rename=(distancetestmarche6minfinprogram=_d));
  distancetestmarche6minfinprogram=input(compress(_d,'kd'),12.);
run;

proc freq data=EXMED_NOTMULTI_3 ;
  tables distancetestmarche6minfinprogram;
  where not missing(distancetestmarche6minfinprogram);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348148#M80585</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-07T15:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348171#M80592</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it but it did not work (problem with INPUT) . I find it weird. here is the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;407 DATA EXMED_test2;&lt;BR /&gt;408 set exmed_test1 (rename=(distancetestmarche6minfinprogram=_d));&lt;BR /&gt;409 distancetestmarche6minfinprogram=input(compress(_d,'kd'),12.);&lt;BR /&gt;410 run;&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=2 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=2&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=n/a Fumeacutellementadmission=Jamais ID=16 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=16&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=85 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=85&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=92 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=92&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=116 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=116&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=133 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=133&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=141 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=141&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=155 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=155&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=159 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=159&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Presentemen ID=161 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=161&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=163 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=163&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Presentemen ID=165 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=165&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Unk Fumeacutellementadmission=Dans passe ID=172 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=172&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=180 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=180&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=189 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=189&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=190 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=190&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Dans passe ID=193 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=193&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Presentemen ID=194 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=194&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;_d=n/a Fumeacutellementadmission=Jamais ID=196 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=196&lt;BR /&gt;NOTE: Invalid argument to function INPUT at ligne 409 colonne 36.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;BR /&gt;_d=Inc Fumeacutellementadmission=Jamais ID=205 distancetestmarche6minfinprogram=. _ERROR_=1&lt;BR /&gt;_N_=205&lt;BR /&gt;NOTE: Mathematical operations could not be performed at the following places. The results of&lt;BR /&gt;the operations have been set to missing values.&lt;BR /&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;54 dans 409:36&lt;BR /&gt;NOTE: There were 410 observations read from the data set WORK.EXMED_TEST1.&lt;BR /&gt;NOTE: The data set WORK.EXMED_TEST2 has 410 observations and 4 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348171#M80592</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T15:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348173#M80593</link>
      <description>&lt;P&gt;Also , what about the other variable, this one has&amp;nbsp;character values that I want to convert to categories, it should be straight forward:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I tried,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF Fumeacutellementadmission = 'Jamais' THEN SMOKING = 0 ;&lt;BR /&gt;IF Fumeacutellementadmission = 'Dans passe' THEN SMOKING = 1 ;&lt;BR /&gt;IF Fumeacutellementadmission = 'Presentemen' THEN SMOKING = 2 ;&lt;BR /&gt;IF Fumeacutellementadmission = 'Chaque jour' THEN SMOKING = 2 ;&lt;BR /&gt;IF Fumeacutellementadmission = 'Inconnu' THEN SMOKING = . ;&lt;BR /&gt;IF Fumeacutellementadmission = . THEN SMOKING = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348173#M80593</guid>
      <dc:creator>seltonsy</dc:creator>
      <dc:date>2017-04-07T15:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348176#M80594</link>
      <description>&lt;P&gt;Guessing at the meaning of the notes in the log ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would guess that you are using the name a numeric variable in the TABLE and WHERE statements.&amp;nbsp; You need to be using the character variable that you are trying to turn into a set of numeric values.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-to-numeric/m-p/348176#M80594</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-07T15:49:00Z</dc:date>
    </item>
  </channel>
</rss>

