<?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 ERROR: Variable in list does not match type prescribed for this list. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/ERROR-Variable-in-list-does-not-match-type-prescribed-for-this/m-p/374402#M2955</link>
    <description>&lt;P&gt;Dear SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have encountered problems in changing variable type from character to numeric.&lt;/P&gt;&lt;P&gt;Specifically, from my PROC CONTENTS results, a few variables have been labelled as categorical when they are numeric in nature, prohibiting the PROC UNIVARIATE to be executed successfully.&lt;/P&gt;&lt;P&gt;For example, the variable Number_of_pregnancies should be numeric, but it has been considered as categorical/character by SAS studio.So, PROC UNIVARIATE cannot proceed with it by showing error in the log file.&lt;/P&gt;&lt;P&gt;The error I have obtained has been illustrated in the attachment along this message, so please have a look at the image attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone kindly provide some hints on how to solve this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14059i5E9E9CFA4D076715/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="error_variable_type_prescribed_list.PNG" title="error_variable_type_prescribed_list.PNG" /&gt;</description>
    <pubDate>Mon, 10 Jul 2017 09:14:39 GMT</pubDate>
    <dc:creator>kjyon2</dc:creator>
    <dc:date>2017-07-10T09:14:39Z</dc:date>
    <item>
      <title>ERROR: Variable in list does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ERROR-Variable-in-list-does-not-match-type-prescribed-for-this/m-p/374402#M2955</link>
      <description>&lt;P&gt;Dear SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have encountered problems in changing variable type from character to numeric.&lt;/P&gt;&lt;P&gt;Specifically, from my PROC CONTENTS results, a few variables have been labelled as categorical when they are numeric in nature, prohibiting the PROC UNIVARIATE to be executed successfully.&lt;/P&gt;&lt;P&gt;For example, the variable Number_of_pregnancies should be numeric, but it has been considered as categorical/character by SAS studio.So, PROC UNIVARIATE cannot proceed with it by showing error in the log file.&lt;/P&gt;&lt;P&gt;The error I have obtained has been illustrated in the attachment along this message, so please have a look at the image attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone kindly provide some hints on how to solve this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14059i5E9E9CFA4D076715/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="error_variable_type_prescribed_list.PNG" title="error_variable_type_prescribed_list.PNG" /&gt;</description>
      <pubDate>Mon, 10 Jul 2017 09:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ERROR-Variable-in-list-does-not-match-type-prescribed-for-this/m-p/374402#M2955</guid>
      <dc:creator>kjyon2</dc:creator>
      <dc:date>2017-07-10T09:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Variable in list does not match type prescribed for this list.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ERROR-Variable-in-list-does-not-match-type-prescribed-for-this/m-p/374404#M2956</link>
      <description>&lt;P&gt;First of all, I would get rid of all those idiotic 'some_hard_to_read_text'n names and use standard SAS-compatible names. 'XXXXXXXXX'n names only cause confusion and unnecessary work during typing.&lt;/P&gt;
&lt;P&gt;'Smokes_(years)'n can easily be replaced by smokes_years without any loss of meaning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a variable that should be numeric is imported as character, you have to look at the data in the external file and correct the import process.&lt;/P&gt;
&lt;P&gt;If a variable can't be corrected there, you have to replace it with a step like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let varname=place_your_varname_here;

data want;
set have (rename=(&amp;amp;varname=__&amp;amp;varname));
&amp;amp;varname = input(__&amp;amp;varname,best.); /* use a proper informat here */
drop __&amp;amp;varname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 09:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ERROR-Variable-in-list-does-not-match-type-prescribed-for-this/m-p/374404#M2956</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-10T09:22:32Z</dc:date>
    </item>
  </channel>
</rss>

