<?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: Error while changing character to numberi (due to missing data points) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247435#M46400</link>
    <description>&lt;P&gt;It indicates that in lines 234 to 236 of your input data set, visit contains a single hyphen.&lt;/P&gt;
&lt;P&gt;So expand your condition to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if visit &amp;gt; ' ' and strip(visit) ne '-' then visitno = input(visit,8.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 Feb 2016 12:36:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-02-02T12:36:48Z</dc:date>
    <item>
      <title>Error while changing character to numberi (due to missing data points)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247431#M46397</link>
      <description>&lt;P&gt;Hello, I am trying to convert a character variable (which is number) to a numeric variable.&lt;/P&gt;&lt;P&gt;But an error message shows up. It won't do what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;142&amp;nbsp; data sampling3;&lt;BR /&gt;143&amp;nbsp; rename visitno=visit;&lt;BR /&gt;144&amp;nbsp; set sampling2;&lt;BR /&gt;145&amp;nbsp; if visit ^=' ' then visitno=input(visit,8.);&lt;BR /&gt;146&amp;nbsp; drop visit;&lt;BR /&gt;147&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: Invalid argument to function INPUT at line 145 column 29.&lt;BR /&gt;RHSP_ID=C005650 Group=1 visit=- HIVstatus=N sex=. first_hiv_confirm=. age_at_sample=. samp_date=.&lt;BR /&gt;vldate_coll1=. vl_copies1=&amp;nbsp; vldate_coll2=. vl_copies2=&amp;nbsp; vldate_coll3=. vl_copies3=&amp;nbsp; vldate_coll4=.&lt;BR /&gt;vl_copies4=&amp;nbsp; vldate_coll5=. vl_copies5=&amp;nbsp; vldate_coll6=. vl_copies6=&amp;nbsp; vldate_coll7=. vl_copies7=&lt;BR /&gt;vldate_coll8=. vl_copies8=&amp;nbsp; vldate_coll9=. vl_copies9=&amp;nbsp; vldate_coll10=. vl_copies10=&lt;BR /&gt;vldate_coll11=. vl_copies11=&amp;nbsp; vldate_coll12=. vl_copies12=&amp;nbsp; vldate_coll13=. vl_copies13=&lt;BR /&gt;vldate_coll14=. vl_copies14=&amp;nbsp; vldate_coll15=. vl_copies15=&amp;nbsp; visitno=. _ERROR_=1 _N_=234&lt;BR /&gt;NOTE: Invalid argument to function INPUT at line 145 column 29.&lt;BR /&gt;RHSP_ID=C005650 Group=2 visit=- HIVstatus=N sex=. first_hiv_confirm=. age_at_sample=. samp_date=.&lt;BR /&gt;vldate_coll1=. vl_copies1=&amp;nbsp; vldate_coll2=. vl_copies2=&amp;nbsp; vldate_coll3=. vl_copies3=&amp;nbsp; vldate_coll4=.&lt;BR /&gt;vl_copies4=&amp;nbsp; vldate_coll5=. vl_copies5=&amp;nbsp; vldate_coll6=. vl_copies6=&amp;nbsp; vldate_coll7=. vl_copies7=&lt;BR /&gt;vldate_coll8=. vl_copies8=&amp;nbsp; vldate_coll9=. vl_copies9=&amp;nbsp; vldate_coll10=. vl_copies10=&lt;BR /&gt;vldate_coll11=. vl_copies11=&amp;nbsp; vldate_coll12=. vl_copies12=&amp;nbsp; vldate_coll13=. vl_copies13=&lt;BR /&gt;vldate_coll14=. vl_copies14=&amp;nbsp; vldate_coll15=. vl_copies15=&amp;nbsp; visitno=. _ERROR_=1 _N_=235&lt;BR /&gt;NOTE: Invalid argument to function INPUT at line 145 column 29.&lt;BR /&gt;RHSP_ID=C005650 Group=3 visit=- HIVstatus=N sex=. first_hiv_confirm=. age_at_sample=. samp_date=.&lt;BR /&gt;vldate_coll1=. vl_copies1=&amp;nbsp; vldate_coll2=. vl_copies2=&amp;nbsp; vldate_coll3=. vl_copies3=&amp;nbsp; vldate_coll4=.&lt;BR /&gt;vl_copies4=&amp;nbsp; vldate_coll5=. vl_copies5=&amp;nbsp; vldate_coll6=. vl_copies6=&amp;nbsp; vldate_coll7=. vl_copies7=&lt;BR /&gt;vldate_coll8=. vl_copies8=&amp;nbsp; vldate_coll9=. vl_copies9=&amp;nbsp; vldate_coll10=. vl_copies10=&lt;BR /&gt;vldate_coll11=. vl_copies11=&amp;nbsp; vldate_coll12=. vl_copies12=&amp;nbsp; vldate_coll13=. vl_copies13=&lt;BR /&gt;vldate_coll14=. vl_copies14=&amp;nbsp; vldate_coll15=. vl_copies15=&amp;nbsp; visitno=. _ERROR_=1 _N_=236&lt;BR /&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; operations have been set to missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 at 145:29&lt;BR /&gt;NOTE: There were 1126 observations read from the data set WORK.SAMPLING2.&lt;BR /&gt;NOTE: The data set WORK.SAMPLING3 has 1126 observations and 38 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 12:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247431#M46397</guid>
      <dc:creator>m1ny</dc:creator>
      <dc:date>2016-02-02T12:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error while changing character to numberi (due to missing data points)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247433#M46398</link>
      <description>&lt;P&gt;You could suppress&amp;nbsp;those messages using the ?? operator.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p19en16vskd2vhn1vwmxpxnglxxs.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p19en16vskd2vhn1vwmxpxnglxxs.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 12:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247433#M46398</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-02T12:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error while changing character to numberi (due to missing data points)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247435#M46400</link>
      <description>&lt;P&gt;It indicates that in lines 234 to 236 of your input data set, visit contains a single hyphen.&lt;/P&gt;
&lt;P&gt;So expand your condition to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if visit &amp;gt; ' ' and strip(visit) ne '-' then visitno = input(visit,8.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 12:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247435#M46400</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-02T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error while changing character to numberi (due to missing data points)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247438#M46402</link>
      <description>&lt;P&gt;Thank you for your comments;&lt;/P&gt;&lt;P&gt;it was very helpful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 12:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247438#M46402</guid>
      <dc:creator>m1ny</dc:creator>
      <dc:date>2016-02-02T12:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error while changing character to numberi (due to missing data points)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247449#M46410</link>
      <description>&lt;P&gt;Sorry LinusH, I wouldn't agree with supressing warnings, they come out in the log for a reason, and it would fail QC in my opinion if this type of thing is hidden. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simplest method to get actual values is to perform the input on a compressed string - keep only numerics. &amp;nbsp;Do note though the possible erroneous one last in the list, you need to think about all combinations in your data and how to handle this best, what to map to what. &amp;nbsp;As this is visit data, I presume you use CDISC? &amp;nbsp;If so a DB visit to SDTM visit map dataset is probably the best way to go.&lt;/P&gt;
&lt;PRE&gt;data sampling3;
  input visit $;
  visitno=input(compress(visit,,"kd"),8.);
datalines;
1
2
-
a
.
a1
;
run;
 &lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 13:35:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247449#M46410</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-02T13:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error while changing character to numberi (due to missing data points)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247456#M46414</link>
      <description>&lt;P&gt;Agreed&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;. If this is part of a system with regular delivery, there should definitely be a data validation step prior to the data type conversion routine. But once validated (on errors tracked separately), I see no problem of using the ?? operator.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 13:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-changing-character-to-numberi-due-to-missing-data/m-p/247456#M46414</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-02T13:53:06Z</dc:date>
    </item>
  </channel>
</rss>

