<?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: variable type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840572#M332344</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/232758"&gt;@aloou&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;do you know why i get this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length COL2 varchar(*) COL3 varchar(*) COL4 varchar(*) annee_min 8 annee_max 8;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Cannot change variable type that is already defined for variable COL2.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The message is saying that the variable COL2 is already defined.&lt;/P&gt;
&lt;P&gt;But your syntax does not look valid.&amp;nbsp;You cannot have a variable named &lt;FONT face="courier new,courier"&gt;varchar(*)&lt;/FONT&gt;&amp;nbsp;, unless you have validvarname option set to any, but even then you would need to use a name literal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to define COL2 as character then you have to specify the actual LENGTH you want it to have.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length col2 $10 col3 $15 col4 $20 ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Oct 2022 14:48:45 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-10-25T14:48:45Z</dc:date>
    <item>
      <title>variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840506#M332333</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;do you know why i get this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length COL2 varchar(*) COL3 varchar(*) COL4 varchar(*) annee_min 8 annee_max 8;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Cannot change variable type that is already defined for variable COL2.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 12:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840506#M332333</guid>
      <dc:creator>aloou</dc:creator>
      <dc:date>2022-10-25T12:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840572#M332344</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/232758"&gt;@aloou&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;do you know why i get this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length COL2 varchar(*) COL3 varchar(*) COL4 varchar(*) annee_min 8 annee_max 8;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Cannot change variable type that is already defined for variable COL2.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The message is saying that the variable COL2 is already defined.&lt;/P&gt;
&lt;P&gt;But your syntax does not look valid.&amp;nbsp;You cannot have a variable named &lt;FONT face="courier new,courier"&gt;varchar(*)&lt;/FONT&gt;&amp;nbsp;, unless you have validvarname option set to any, but even then you would need to use a name literal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to define COL2 as character then you have to specify the actual LENGTH you want it to have.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length col2 $10 col3 $15 col4 $20 ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:48:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840572#M332344</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-25T14:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840584#M332348</link>
      <description>&lt;P&gt;Suggestion: Show an entire data step or procedure, not just one line of the code. Copy the entire thing from the LOG and paste the copied text into a text box opened on the forum with the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically I would say that you are using a data set that already has a variable named Col2 that is numeric. Then your code would be attempting to change a property of that existing variable, which SAS won't do.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 15:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-type/m-p/840584#M332348</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-25T15:05:13Z</dc:date>
    </item>
  </channel>
</rss>

