<?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: need help with code in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538439#M6942</link>
    <description>&lt;P&gt;Ok hold on I think I see where the confusion is. So VSORRES has several different values in and one of them is Temperature. There are other values such as blood pressure, height, hand domaniance, pulse and respiratory rate. So temperature is not the only value in this column. I just want to take only the temperature values from this column and convert those to farhenheit if they aren't already farhenheit. The VSORRES = RIGHT that you saw was in reference to the hand domaniance not temperature. So it looks like the input function didn't work on the hand domainance ones for some reason. But I also just checked my working dataset and the Celsius numbers have not converted to farhenheit.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Feb 2019 21:03:00 GMT</pubDate>
    <dc:creator>Patelbb</dc:creator>
    <dc:date>2019-02-25T21:03:00Z</dc:date>
    <item>
      <title>Input function error - help to debug</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538413#M6931</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone please help me with my code. I'm not sure why the input function is not working and I've tried to play with it but nothing seems to fix it. Here is the log. I've shortened it bit since I was having posting this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT&gt;27&amp;nbsp; set dbsdtm.vs;&lt;BR /&gt;228&amp;nbsp; by usubjid;&lt;BR /&gt;229&lt;BR /&gt;230&amp;nbsp; length ftemp 8;&lt;BR /&gt;231&amp;nbsp; label ftemp = ?Temperature (F)?;&lt;BR /&gt;232&lt;BR /&gt;233&amp;nbsp; vsorresx = input(vsorres , best.);&lt;BR /&gt;234&lt;BR /&gt;235&amp;nbsp; if vsorresu = 'C' then ftemp = (vsorresx * 9 / 5) + 32;&lt;BR /&gt;236&amp;nbsp; if vsorresu = 'F' then ftemp = vsorresx;&lt;BR /&gt;237&amp;nbsp; else ftemp = .;&lt;BR /&gt;238&lt;BR /&gt;239&amp;nbsp; run;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;NOTE: Invalid argument to function INPUT at line 233 column 12.&lt;BR /&gt;STUDYID=ABC-123 DOMAIN=VS USUBJID=1160-2508 VSSEQ=12 VSTESTCD=HNDDOM VSTEST=Hand Dominance VSORRES=RIGHT VSORRESU=&lt;BR /&gt;VSSTRESC=RIGHT VSSTRESN=. VSSTRESU=&amp;nbsp; VSSTAT=&amp;nbsp; VSREASND=&amp;nbsp; VSBLFL=Y VISITNUM=-1 VISIT=SCREENING EPOCH=SCREENING VSDTC=2013-01-25&lt;BR /&gt;VSTPT=&amp;nbsp; VSTPTNUM=. FIRST.USUBJID=0 LAST.USUBJID=0 ftemp=. vsorresx=. _ERROR_=1 _N_=12&lt;BR /&gt;&lt;BR /&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 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; 77 at 233:12&lt;BR /&gt;NOTE: There were 3821 observations read from the data set DBSDTM.VS.&lt;BR /&gt;NOTE: The data set WORK.VITALS has 3821 observations and 21 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.09 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.09 seconds&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Any help is appreciated! Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538413#M6931</guid>
      <dc:creator>Patelbb</dc:creator>
      <dc:date>2019-02-25T20:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538414#M6932</link>
      <description>&lt;P&gt;As the log clearly shows you tried to convert 'RIGHT' to a number.&lt;/P&gt;
&lt;P&gt;What number did you expect it to create?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS There is not really any BEST informat. If you use that name it is just an alias for the normal numeric informat.&amp;nbsp; Plus the concept of a "best" informat doesn't even make any sense.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538414#M6932</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-25T20:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Input function error - help to debug</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538415#M6933</link>
      <description>Please use a descriptive subject line for your posts that better reflect your question. I've updated this question as an example.</description>
      <pubDate>Mon, 25 Feb 2019 20:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538415#M6933</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-25T20:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538416#M6934</link>
      <description>&lt;PRE&gt;NOTE: Invalid argument to function INPUT at line 233 column 12.
STUDYID=ABC-123 DOMAIN=VS USUBJID=1160-2508 VSSEQ=12 VSTESTCD=HNDDOM 
VSTEST=Hand Dominance &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;VSORRES=RIGHT&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;Your input function has VSORRES as the first argument, and it is trying to convert something to best. format, which is a numeric format. The value of VSORRES is RIGHT, which can't be converted to a numeric format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; is correct, you can't use the best. informat there because there is no such informat.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538416#M6934</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-25T20:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538418#M6935</link>
      <description>&lt;P&gt;So my input function isn't necessary then? If so, how do I go about fixing the code so that I don't get the note the character values have been converted to numeric?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538418#M6935</guid>
      <dc:creator>Patelbb</dc:creator>
      <dc:date>2019-02-25T20:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538420#M6936</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237206"&gt;@Patelbb&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So my input function isn't necessary then? If so, how do I go about fixing the code so that I don't get the note the character values have been converted to numeric?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, at this time, none of us can answer this question. It's not a matter of fixing the code. It is a matter of you designing a meaningful process. You have to tell us what you want SAS to do when VSORRES has the value RIGHT.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538420#M6936</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-25T20:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538424#M6937</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237206"&gt;@Patelbb&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So my input function isn't necessary then? If so, how do I go about fixing the code so that I don't get the note the character values have been converted to numeric?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Perhaps explain (comments in your code help this process) what you're trying to accomplish with that line of code? What did you think it did and what do you want to do with it?&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;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; vsorresx = input(vsorres , best.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538424#M6937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-25T20:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538425#M6938</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I want to create a working data set&amp;nbsp; that includes all the variables from the vital set dataset but also create a new variable (FTEMP) that will store only&amp;nbsp;&lt;FONT&gt;Fahrenheit temperature values (e.g. convert all Centigrade temperatures to Fahrenheit, copy the Fahrenheit temperatures, and remove all missing temperatures).&amp;nbsp; To do this, I know I have to look at the VSORRESU and VSORRES values. When I was looking at those variables I saw that they were character values and I needed to convert them into numeric so i could use them to convert the Celsius values to Farhenheit.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538425#M6938</guid>
      <dc:creator>Patelbb</dc:creator>
      <dc:date>2019-02-25T20:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538428#M6939</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237206"&gt;@Patelbb&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I want to create a working data set&amp;nbsp; that includes all the variables from the vital set dataset but also create a new variable (FTEMP) that will store only&amp;nbsp;&lt;FONT&gt;Fahrenheit temperature values (e.g. convert all Centigrade temperatures to Fahrenheit, copy the Fahrenheit temperatures, and remove all missing temperatures).&amp;nbsp; To do this, I know I have to look at the VSORRESU and VSORRES values. When I was looking at those variables I saw that they were character values and I needed to convert them into numeric so i could use them to convert the Celsius values to Farhenheit.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have not addressed the issue, which I stated:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;You have to tell us what you want SAS to do when VSORRES has the value RIGHT." &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Saying you want to convert RIGHT to numeric is a meaningless statement.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538428#M6939</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-25T20:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538432#M6940</link>
      <description>&lt;P&gt;I'm sorry I don't understand what you mean...&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538432#M6940</guid>
      <dc:creator>Patelbb</dc:creator>
      <dc:date>2019-02-25T20:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538434#M6941</link>
      <description>&lt;P&gt;You variable VSORRES has the value RIGHT, a character string. How do you convert it to numeric?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:49:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538434#M6941</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-25T20:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538439#M6942</link>
      <description>&lt;P&gt;Ok hold on I think I see where the confusion is. So VSORRES has several different values in and one of them is Temperature. There are other values such as blood pressure, height, hand domaniance, pulse and respiratory rate. So temperature is not the only value in this column. I just want to take only the temperature values from this column and convert those to farhenheit if they aren't already farhenheit. The VSORRES = RIGHT that you saw was in reference to the hand domaniance not temperature. So it looks like the input function didn't work on the hand domainance ones for some reason. But I also just checked my working dataset and the Celsius numbers have not converted to farhenheit.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 21:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538439#M6942</guid>
      <dc:creator>Patelbb</dc:creator>
      <dc:date>2019-02-25T21:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: need help with code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538441#M6943</link>
      <description>&lt;P&gt;The log shows that this variable had the value of RIGHT (see the highlighted portion below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;NOTE: Invalid argument to function INPUT at line 233 column 12.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STUDYID=ABC-123 DOMAIN=VS USUBJID=1160-2508 VSSEQ=12 VSTESTCD=HNDDOM VSTEST=Hand Dominance &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;VSORRES=RIGHT&lt;/STRONG&gt;&lt;/FONT&gt; VSORRESU=&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VSSTRESC=RIGHT VSSTRESN=. VSSTRESU=&amp;nbsp; VSSTAT=&amp;nbsp; VSREASND=&amp;nbsp; VSBLFL=Y VISITNUM=-1 VISIT=SCREENING EPOCH=SCREENING VSDTC=2013-01-25&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VSTPT=&amp;nbsp; VSTPTNUM=. FIRST.USUBJID=0 LAST.USUBJID=0 ftemp=. vsorresx=. _ERROR_=1 _N_=12&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Run a PROC FREQ on the variable you want to convert, VSORRES to see what types of values are in that column.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have several variations you need to code for all of them to be handled.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example, you can use anydigit() to check for the presence of numbers.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can make your code execute conditionally:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if anydigit(vsorres) then measurement = input(vsorres, best12.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you can look at only temperature which is likely indicated in another variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if otherVariable = 'Temperature' then temp = input(vsorres, 8.);&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Feb 2019 21:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538441#M6943</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-25T21:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Input function error - help to debug</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538442#M6944</link>
      <description>&lt;P&gt;Are you sure you want to add a VARIABLE to this tall/skinny format?&lt;/P&gt;
&lt;P&gt;Shouldn't you be adding an OBSERVATION instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But anyway the issue is you need to test whether the current observation has a temperature reading before trying to convert the temperature!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if vsorresu = 'C' then 
   ftemp = (input(vsorres,32.) * 9 / 5) + 32
;
else if vsorresu = 'F' then ftemp =  input(vsorres,32.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 21:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538442#M6944</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-25T21:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Input function error - help to debug</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538444#M6945</link>
      <description>&lt;P&gt;Ohh ok thank you so much!!!! This makes more sense now!!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 21:11:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-function-error-help-to-debug/m-p/538444#M6945</guid>
      <dc:creator>Patelbb</dc:creator>
      <dc:date>2019-02-25T21:11:22Z</dc:date>
    </item>
  </channel>
</rss>

