<?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 ERROR: Variable XXX in list does not match type prescribed for this in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346517#M79923</link>
    <description>&lt;P&gt; See the comments in the code below. &lt;/P&gt;

&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname RV '/folders/myfolders/Week 7'; /*Recall previous permanent dataset*/
&lt;BR /&gt;*This step is useless, you're creating a new dataset that's identical to the old one;
data rv.RV_Market_Analysis; /*new dataset*/
	set rv.rv_marketdo; /*previous dataset*/
run;
&lt;BR /&gt;*This doesn't add anything to your project or answer so you don't need this step. Open the dataset instead of printing it;
proc print data=rv.rv_market_analysis;
run;

Proc format;
	value bracket 0-29='Under 30'
			30-50='30-50'
			50-100='Over 50';
run;
&lt;BR /&gt;/*This is bad coding style the SET and DATA statement should have different names. &lt;BR /&gt;When you use this type of coding it becomes harder to determine where an error occurred&lt;BR /&gt;or when the mistake is. It also means you have to re-run your whole code every time rather than just the latest steps. &lt;BR /&gt;&lt;BR /&gt;Change the SET statement to be the data set from the first data step&lt;BR /&gt;*/&lt;BR /&gt;
Data rv.RV_Market_Analysis;
	set rv.RV_Market_Analysis;
	label Age_Bracket = 'Age Bracket';
	Age_Bracket = PUT(Age, bracket.);
run;
&lt;BR /&gt;*If you're going to use PRINT at least limit it, so you don't get the full listing&lt;BR /&gt;ADD (obs=20) after the data set name;&lt;BR /&gt;
proc print data=rv.rv_market_analysis label;
run;

proc freq data=rv.rv_market_analysis;
	format age bracket.;
	tables age*gender;
run;
&lt;BR /&gt;/*It's rarely likely to have the CLASS  and VAR statements have the same variables. &lt;BR /&gt;CLASS is for the variables that you want the analysis grouped by. &lt;BR /&gt;VAR is for the variables you want to have statistics, ie mean of variable in VAR. &lt;BR /&gt;*/
&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;proc means data=rv.rv_market_analysis;
	format age bracket.;
	class age gender;
	var age gender;
run;&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Sun, 02 Apr 2017 19:24:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-04-02T19:24:49Z</dc:date>
    <item>
      <title>SAS ERROR: Variable XXX in list does not match type prescribed for this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346509#M79919</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm a student learning base SAS with university edition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My instruction for this step is as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;4) &amp;nbsp;Create a&amp;nbsp;&lt;U&gt;Means Table using Proc Means&lt;/U&gt;:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i) &amp;nbsp;Include in your table only the variables: &amp;nbsp;Gender and Age&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ii) &amp;nbsp;Format the Age variable using your age format in step 2.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iii) &amp;nbsp;Please interpret your Proc Means output by answering the following questions &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4a) &amp;nbsp;What is the mean age of a female in the "Under 30" age group?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4b) &amp;nbsp;What is the mean age of a male in the "Over 50" age group?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem I'm having is that I keep getting this error on my last data step {proc mean}:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE class="sasLog"&gt;&lt;STRONG&gt;ERROR: Variable gender in list does not match type prescribed for this list.&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;My code and log are as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname RV '/folders/myfolders/Week 7'; /*Recall previous permanent dataset*/

data rv.RV_Market_Analysis; /*new dataset*/
	set rv.rv_marketdo; /*previous dataset*/
run;

proc print data=rv.rv_market_analysis;
run;

Proc format;
	value bracket 0-29='Under 30'
			30-50='30-50'
			50-100='Over 50';
run;

Data rv.RV_Market_Analysis;
	set rv.RV_Market_Analysis;
	label Age_Bracket = 'Age Bracket';
	Age_Bracket = PUT(Age, bracket.);
run;

proc print data=rv.rv_market_analysis label;
run;

proc freq data=rv.rv_market_analysis;
	format age bracket.;
	tables age*gender;
run;

&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;proc means data=rv.rv_market_analysis;
	format age bracket.;
	class age gender;
	var age gender;
run;&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 proc means data=rv.rv_market_analysis;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 format age bracket.;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;64 class age gender/missing;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;65 var age gender;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR: Variable gender in list does not match type prescribed for this list.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE MEANS used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;67&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;68 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;81&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Thanks, in advance for your help!&lt;/DIV&gt;</description>
      <pubDate>Sun, 02 Apr 2017 18:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346509#M79919</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-02T18:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS ERROR: Variable XXX in list does not match type prescribed for this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346513#M79920</link>
      <description>&lt;P&gt;You didn't show us your data, but it looks like you are trying to get the average of values like "M" and "F".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what you want for that last step is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc means data=rv.rv_market_analysis;
	class gender age_bracket;
	var age;
run; 
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2017 18:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346513#M79920</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-02T18:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS ERROR: Variable XXX in list does not match type prescribed for this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346516#M79922</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127439"&gt;@bldudley&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm a student learning base SAS with university edition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;My instruction for this step is as follows:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;4) &amp;nbsp;Create a&amp;nbsp;&lt;U&gt;Means Table using Proc Means&lt;/U&gt;:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i) &amp;nbsp;Include in your table only the variables: &amp;nbsp;Gender and Age&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ii) &amp;nbsp;Format the Age variable using your age format in step 2.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iii) &amp;nbsp;Please interpret your Proc Means output by answering the following questions &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4a) &amp;nbsp;What is the mean age of a female in the "Under 30" age group?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4b) &amp;nbsp;What is the mean age of a male in the "Over 50" age group?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The problem I'm having is that I keep getting this error on my last data step {proc mean}:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="sasLog"&gt;&lt;STRONG&gt;ERROR: Variable gender in list does not match type prescribed for this list.&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;My code and log are as follows:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname RV '/folders/myfolders/Week 7'; /*Recall previous permanent dataset*/

data rv.RV_Market_Analysis; /*new dataset*/
	set rv.rv_marketdo; /*previous dataset*/
run;

proc print data=rv.rv_market_analysis;
run;

Proc format;
	value bracket 0-29='Under 30'
			30-50='30-50'
			50-100='Over 50';
run;

Data rv.RV_Market_Analysis;
	set rv.RV_Market_Analysis;
	label Age_Bracket = 'Age Bracket';
	Age_Bracket = PUT(Age, bracket.);
run;

proc print data=rv.rv_market_analysis label;
run;

proc freq data=rv.rv_market_analysis;
	format age bracket.;
	tables age*gender;
run;

&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;proc means data=rv.rv_market_analysis;
	format age bracket.;
	class age gender;
	var age gender;
run;&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;61&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;62 proc means data=rv.rv_market_analysis;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;63 format age bracket.;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;64 class age gender/missing;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;65 var age gender;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR: Variable gender in list does not match type prescribed for this list.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;66 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE MEANS used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;67&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;68 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;81&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Thanks, in advance for your help!&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2017 19:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346516#M79922</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-02T19:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS ERROR: Variable XXX in list does not match type prescribed for this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346517#M79923</link>
      <description>&lt;P&gt; See the comments in the code below. &lt;/P&gt;

&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname RV '/folders/myfolders/Week 7'; /*Recall previous permanent dataset*/
&lt;BR /&gt;*This step is useless, you're creating a new dataset that's identical to the old one;
data rv.RV_Market_Analysis; /*new dataset*/
	set rv.rv_marketdo; /*previous dataset*/
run;
&lt;BR /&gt;*This doesn't add anything to your project or answer so you don't need this step. Open the dataset instead of printing it;
proc print data=rv.rv_market_analysis;
run;

Proc format;
	value bracket 0-29='Under 30'
			30-50='30-50'
			50-100='Over 50';
run;
&lt;BR /&gt;/*This is bad coding style the SET and DATA statement should have different names. &lt;BR /&gt;When you use this type of coding it becomes harder to determine where an error occurred&lt;BR /&gt;or when the mistake is. It also means you have to re-run your whole code every time rather than just the latest steps. &lt;BR /&gt;&lt;BR /&gt;Change the SET statement to be the data set from the first data step&lt;BR /&gt;*/&lt;BR /&gt;
Data rv.RV_Market_Analysis;
	set rv.RV_Market_Analysis;
	label Age_Bracket = 'Age Bracket';
	Age_Bracket = PUT(Age, bracket.);
run;
&lt;BR /&gt;*If you're going to use PRINT at least limit it, so you don't get the full listing&lt;BR /&gt;ADD (obs=20) after the data set name;&lt;BR /&gt;
proc print data=rv.rv_market_analysis label;
run;

proc freq data=rv.rv_market_analysis;
	format age bracket.;
	tables age*gender;
run;
&lt;BR /&gt;/*It's rarely likely to have the CLASS  and VAR statements have the same variables. &lt;BR /&gt;CLASS is for the variables that you want the analysis grouped by. &lt;BR /&gt;VAR is for the variables you want to have statistics, ie mean of variable in VAR. &lt;BR /&gt;*/
&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;proc means data=rv.rv_market_analysis;
	format age bracket.;
	class age gender;
	var age gender;
run;&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sun, 02 Apr 2017 19:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346517#M79923</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-02T19:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS ERROR: Variable XXX in list does not match type prescribed for this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346524#M79928</link>
      <description>&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2017 20:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-ERROR-Variable-XXX-in-list-does-not-match-type-prescribed/m-p/346524#M79928</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-02T20:39:21Z</dc:date>
    </item>
  </channel>
</rss>

