<?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: SAS problem in log (very strange..) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12464#M1665</link>
    <description>as you can see the conversion message is written even if the statement is not executed. &lt;BR /&gt;
&lt;BR /&gt;
A simple way to "fix" it would be to use VVALUE function as&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data STRANGE_LOG;&lt;BR /&gt;
   set sashelp.class(obs=3);&lt;BR /&gt;
   length test $8;&lt;BR /&gt;
   test = vvalue(age);&lt;BR /&gt;
   format age 8.3; *format of choice;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Or if you don't use SAS V9 you will need to determine the variable type and then write some "flex code".</description>
    <pubDate>Thu, 05 Nov 2009 12:43:27 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2009-11-05T12:43:27Z</dc:date>
    <item>
      <title>SAS problem in log (very strange..)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12462#M1663</link>
      <description>Hello dears SAS users&lt;BR /&gt;
Have a look on it :&lt;BR /&gt;
If i submit the following code (very basic code):&lt;BR /&gt;
data STRANGE_LOG;&lt;BR /&gt;
   set sashelp.class(obs=3);&lt;BR /&gt;
   if vtype(age) eq "N" then do;&lt;BR /&gt;
      test=put(age, 8.);&lt;BR /&gt;
   end; &lt;BR /&gt;
   else if vtype(age) eq "C" then do;&lt;BR /&gt;
      test=age;&lt;BR /&gt;
   end;	&lt;BR /&gt;
run;&lt;BR /&gt;
I will get the following log :&lt;BR /&gt;
NOTE: Numeric values have been converted to character values at the places given by:&lt;BR /&gt;
      (Line):(Column).&lt;BR /&gt;
      390:12&lt;BR /&gt;
NOTE: There were 3 observations read from the data set SASHELP.CLASS.&lt;BR /&gt;
NOTE: The data set WORK.STRANGE_LOG has 3 observations and 6 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
But if i submit this code :&lt;BR /&gt;
&lt;BR /&gt;
data STRANGE_LOG2;&lt;BR /&gt;
   set sashelp.class(obs=3);&lt;BR /&gt;
   if vtype(age) eq "N" then do;&lt;BR /&gt;
      test=put(age, 8.);&lt;BR /&gt;
   end; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I will get this in my log:&lt;BR /&gt;
NOTE: There were 3 observations read from the data set SASHELP.CLASS.&lt;BR /&gt;
NOTE: The data set WORK.STRANGE_LOG2 has 3 observations and 6 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
So why it's written in the first case&lt;BR /&gt;
NOTE: Numeric values have been converted to character values at the places given by:&lt;BR /&gt;
      (Line):(Column).&lt;BR /&gt;
      390:12&lt;BR /&gt;
and not in the second case ?&lt;BR /&gt;
&lt;BR /&gt;
Why there is this note, even if the process will never go into the &lt;BR /&gt;
else if vtype(age) eq "C" then do;&lt;BR /&gt;
      test=age;&lt;BR /&gt;
   end;	?????&lt;BR /&gt;
because age is numeric.&lt;BR /&gt;
&lt;BR /&gt;
It's very important because i'm currently working for a big pharma and it's strictly&lt;BR /&gt;
forbidden to have  the note "Numeric values have been converted to character values.." in the log.&lt;BR /&gt;
&lt;BR /&gt;
Could you help me please ?&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your answers.</description>
      <pubDate>Thu, 05 Nov 2009 09:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12462#M1663</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-05T09:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem in log (very strange..)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12463#M1664</link>
      <description>Hi.&lt;BR /&gt;
&lt;BR /&gt;
You got SAS confused with the first datastep.&lt;BR /&gt;
&lt;BR /&gt;
These two statements are ambiguous&lt;BR /&gt;
&lt;BR /&gt;
[pre]test=put(age, 8.);&lt;BR /&gt;
&lt;BR /&gt;
test=age[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Being age a NUMERIC var on SASHEP.CLASS, SAS inherited the type for the test var.&lt;BR /&gt;
&lt;BR /&gt;
You should explicitly declare TEST as a character variable, through the LENGTH statement.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000218807.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000218807.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Thu, 05 Nov 2009 12:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12463#M1664</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-11-05T12:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem in log (very strange..)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12464#M1665</link>
      <description>as you can see the conversion message is written even if the statement is not executed. &lt;BR /&gt;
&lt;BR /&gt;
A simple way to "fix" it would be to use VVALUE function as&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data STRANGE_LOG;&lt;BR /&gt;
   set sashelp.class(obs=3);&lt;BR /&gt;
   length test $8;&lt;BR /&gt;
   test = vvalue(age);&lt;BR /&gt;
   format age 8.3; *format of choice;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Or if you don't use SAS V9 you will need to determine the variable type and then write some "flex code".</description>
      <pubDate>Thu, 05 Nov 2009 12:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12464#M1665</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-11-05T12:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem in log (very strange..)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12465#M1666</link>
      <description>Thank you</description>
      <pubDate>Thu, 05 Nov 2009 13:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-in-log-very-strange/m-p/12465#M1666</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-05T13:49:52Z</dc:date>
    </item>
  </channel>
</rss>

