<?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 to numeric in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901223#M40173</link>
    <description>&lt;P&gt;If you are getting errors in the log, show us the ENTIRE log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, I don't know what this is referring to.&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/459723"&gt;@Adi27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have converted the character values to numeric still it is showing this!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2023 13:05:18 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-11-02T13:05:18Z</dc:date>
    <item>
      <title>converting character value to numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901222#M40172</link>
      <description>&lt;P&gt;Hi my code is showing an error of not being able to find the values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* New dataset for available products */&lt;BR /&gt;data AvailableProducts;&lt;BR /&gt;set Qed.Products;&lt;BR /&gt;where available = 'T';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* New dataset for unavailable products */&lt;BR /&gt;data UnavailableProducts;&lt;BR /&gt;set Qed.Products;&lt;BR /&gt;where available = 'F';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* New dataset for converting grams and rating to numeric values */&lt;BR /&gt;Data Qed_Converted;&lt;BR /&gt;Set Qed.Products;&lt;BR /&gt;rating_num = input(rating, best32.);&lt;BR /&gt;grams_num = input(grams, best32.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Descriptive Statistics for available products */&lt;BR /&gt;PROC MEANS DATA=AvailableProducts;&lt;BR /&gt;VAR grams price rating;&lt;BR /&gt;OUTPUT OUT=AvailableStats&lt;BR /&gt;MEAN=Avg_grams Avg_price Avg_rating;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have converted the character values to numeric still it is showing this!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 12:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901222#M40172</guid>
      <dc:creator>Adi27</dc:creator>
      <dc:date>2023-11-02T12:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: converting character value to numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901223#M40173</link>
      <description>&lt;P&gt;If you are getting errors in the log, show us the ENTIRE log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, I don't know what this is referring to.&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/459723"&gt;@Adi27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have converted the character values to numeric still it is showing this!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 13:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901223#M40173</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-02T13:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: converting character value to numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901224#M40174</link>
      <description>this is the log: 88 /* Descriptive Statistics for available products */&lt;BR /&gt;89 PROC MEANS DATA=AvailableProducts;&lt;BR /&gt;90 VAR grams price rating;&lt;BR /&gt;ERROR: Variable grams in list does not match type prescribed for this list.&lt;BR /&gt;ERROR: Variable price in list does not match type prescribed for this list.&lt;BR /&gt;ERROR: Variable RATING not found.&lt;BR /&gt;91 OUTPUT OUT=AvailableStats&lt;BR /&gt;92 MEAN=Avg_grams Avg_price Avg_rating;&lt;BR /&gt;93 RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.AVAILABLESTATS may be incomplete. When this step was stopped there were 0 observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.AVAILABLESTATS was not replaced because this step was stopped.&lt;BR /&gt;NOTE: PROCEDURE MEANS used (Total process time):</description>
      <pubDate>Thu, 02 Nov 2023 13:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901224#M40174</guid>
      <dc:creator>Adi27</dc:creator>
      <dc:date>2023-11-02T13:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: converting character value to numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901229#M40175</link>
      <description>&lt;P&gt;Your converted variables are in dataset qed_converted (with a _num suffix), but you use dataset availableproducts in the PROC MEANS.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 13:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901229#M40175</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-11-02T13:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: converting character value to numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901233#M40176</link>
      <description>&lt;P&gt;You can streamline your process a lot:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data
  availableproducts
  unavailableproducts
;
set qed.products;
rating_num = input(rating,best32.);
grams_num = input(grams,best32.);&lt;BR /&gt;ptice_num = input(price,best32.);
drop rating grams price;
rename
  rating_num=rating
  grams_num=grams&lt;BR /&gt;  price_num=price
;
select (available);
  when ("T") output availableproducts;
  when ("F") output unavailableproducts;
end;
run;

proc means data=availableproducts;
var grams price rating;
output
  out=availablestats
  mean=avg_grams avg_price avg_rating
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But you should first ask yourself why the conversions are needed in the first place. Numbers stored in character variables point to a faulty import process which brings the data into SAS, e.g. using a bad medium (Excel files) or PROC IMPORT.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 13:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/converting-character-value-to-numeric/m-p/901233#M40176</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-11-02T13:30:39Z</dc:date>
    </item>
  </channel>
</rss>

