<?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 Variable *insert variable* does not match type prescribed for this list. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545627#M150972</link>
    <description>&lt;P&gt;In your imput statement you define all variables as strings. Proc means can only deal with numeric variables. Remove all the $ signs in the input statement and it should hopefully work.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Mar 2019 20:34:53 GMT</pubDate>
    <dc:creator>heffo</dc:creator>
    <dc:date>2019-03-24T20:34:53Z</dc:date>
    <item>
      <title>Error Variable *insert variable* does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545625#M150970</link>
      <description>&lt;DIV&gt;I am trying to run descriptive statistics using PROC MEANS in SAS. However I am getting that my inserted variables are not match type prescribed. Nothing I am doing is working. What am i doing wrong. Also, I get this error for all 14 variables and I am trying to run descriptive statistics on all 14 variables.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;filename winedata '/folders/myfolders/390 hw/wine.data.txt';&lt;/DIV&gt;&lt;DIV&gt;data wine;&lt;/DIV&gt;&lt;DIV&gt;infile winedata DELIMITER=',';&lt;/DIV&gt;&lt;DIV&gt;input iden $ Alco $ Mali $ Ash $ Alca $ Magn $ Tota $ Flav $ Nonf $ proa $ Colo $ Hue $ OD28 $ Prol $; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TITLE 'Wine Summary Data';&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;proc print data=wine;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;proc means data=wine n mean; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;by iden;&lt;/DIV&gt;&lt;DIV&gt;var iden Alco Mali Ash Alca Magn Tota Flav Nonf proa Colo Hue OD28 Prol;&lt;/DIV&gt;&lt;DIV&gt;run;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sun, 24 Mar 2019 20:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545625#M150970</guid>
      <dc:creator>twocents</dc:creator>
      <dc:date>2019-03-24T20:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error Variable *insert variable* does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545626#M150971</link>
      <description>&lt;P&gt;You cannot take the mean of a character string.&lt;/P&gt;
&lt;P&gt;Why did you define the variables as character in your INPUT statement if you want to use them as numbers?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 20:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545626#M150971</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-24T20:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error Variable *insert variable* does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545627#M150972</link>
      <description>&lt;P&gt;In your imput statement you define all variables as strings. Proc means can only deal with numeric variables. Remove all the $ signs in the input statement and it should hopefully work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 20:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545627#M150972</guid>
      <dc:creator>heffo</dc:creator>
      <dc:date>2019-03-24T20:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error Variable *insert variable* does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545648#M150986</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267766"&gt;@twocents&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV&gt;I am trying to run descriptive statistics using PROC MEANS in SAS. However I am getting that my inserted variables are not match type prescribed. Nothing I am doing is working. What am i doing wrong. Also, I get this error for all 14 variables and I am trying to run descriptive statistics on all 14 variables.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;filename winedata '/folders/myfolders/390 hw/wine.data.txt';&lt;/DIV&gt;
&lt;DIV&gt;data wine;&lt;/DIV&gt;
&lt;DIV&gt;infile winedata DELIMITER=',';&lt;/DIV&gt;
&lt;DIV&gt;input iden $ Alco $ Mali $ Ash $ Alca $ Magn $ Tota $ Flav $ Nonf $ proa $ Colo $ Hue $ OD28 $ Prol $; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;TITLE 'Wine Summary Data';&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;proc print data=wine;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;proc means data=wine n mean; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;by iden;&lt;/DIV&gt;
&lt;DIV&gt;var iden Alco Mali Ash Alca Magn Tota Flav Nonf proa Colo Hue OD28 Prol;&lt;/DIV&gt;
&lt;DIV&gt;run;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please use a code box when inserting code, it makes it easier to read and copy/paste. As others have mentioned, the issue is with the $ sign, because that tells SAS to read it in as a character variable. And you can't calculate the mean on a set of characters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data wine;
infile winedata DELIMITER=',';
input iden $ &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;Alco Mali Ash Alca Magn Tota Flav Nonf proa Colo Hue OD28 Prol&lt;/STRONG&gt;&lt;/FONT&gt;;  
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;



&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;TITLE 'Wine Detail Data';&lt;/STRONG&gt;&lt;/FONT&gt;
proc print data=wine;
run;

&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;TITLE 'Wine Summary Statistics';&lt;/STRONG&gt;&lt;/FONT&gt;
proc means data=wine n mean; &amp;nbsp; &amp;nbsp;
by iden; &lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;*is the data sorted already? If not you may get an error here as well;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
var iden Alco Mali Ash Alca Magn Tota Flav Nonf proa Colo Hue OD28 Prol;
run;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;Things in read are ones I've changed or re-ordered.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you data is sorted, otherwise your BY statement won't work properly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 23:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545648#M150986</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-24T23:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error Variable *insert variable* does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545659#M150994</link>
      <description>&lt;P&gt;Thank you so much. I am still learning everything with SAS so I apologize for my formatting.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 23:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-insert-variable-does-not-match-type-prescribed/m-p/545659#M150994</guid>
      <dc:creator>twocents</dc:creator>
      <dc:date>2019-03-24T23:52:54Z</dc:date>
    </item>
  </channel>
</rss>

