<?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 Multiple Length Specified for a Varible in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602667#M16850</link>
    <description>&lt;P&gt;I am running this code and it keeps warning me that the variable StateCd has multiple lengths specified. The variable must be named StateCd, so how can I fix this? I have attached my code below.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA HypTabs.States (LABEL = 'Study States');&lt;BR /&gt;ATTRIB StateNum LABEL = 'State Number' LENGTH = 8&lt;BR /&gt;StateCd LABEL = 'State Code' LENGTH = $2&lt;BR /&gt;StateNm LABEL = 'State Name' LENGTH = $20;&lt;BR /&gt;SET HypImpt.States;&lt;BR /&gt;BY StateNum;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC CONTENTS DATA = HypTabs.States VARNUM;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC PRINT DATA = HypTabs.States;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2019 03:04:30 GMT</pubDate>
    <dc:creator>walkerel</dc:creator>
    <dc:date>2019-11-08T03:04:30Z</dc:date>
    <item>
      <title>Multiple Length Specified for a Varible</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602667#M16850</link>
      <description>&lt;P&gt;I am running this code and it keeps warning me that the variable StateCd has multiple lengths specified. The variable must be named StateCd, so how can I fix this? I have attached my code below.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA HypTabs.States (LABEL = 'Study States');&lt;BR /&gt;ATTRIB StateNum LABEL = 'State Number' LENGTH = 8&lt;BR /&gt;StateCd LABEL = 'State Code' LENGTH = $2&lt;BR /&gt;StateNm LABEL = 'State Name' LENGTH = $20;&lt;BR /&gt;SET HypImpt.States;&lt;BR /&gt;BY StateNum;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC CONTENTS DATA = HypTabs.States VARNUM;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC PRINT DATA = HypTabs.States;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 03:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602667#M16850</guid>
      <dc:creator>walkerel</dc:creator>
      <dc:date>2019-11-08T03:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Length Specified for a Varible</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602669#M16851</link>
      <description>&lt;P&gt;You define a length for StateCD but this variable already exists in your source data set with a different length.&lt;/P&gt;
&lt;P&gt;If you really want to change the length then you will have to create a new variable with the same name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds1;
  length stateCd $4;
  stateCd='ABCD';
  output;
  stop;
run;

data ds2;
  length stateCD $2;
  set ds1(rename=(stateCD=_stateCD));
  stateCD=_stateCD;
  drop _stateCD;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Be aware that like in the code above if the new variable has a shorter length than the string from your source variable, the string might get truncated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 03:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602669#M16851</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-11-08T03:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Length Specified for a Varible</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602671#M16852</link>
      <description>Before changing anything, examine StateCd in your original data.  Verify that all.the values are no more than 2 characters long.&lt;BR /&gt;&lt;BR /&gt;If that's the case, it is OK to run your program and ignore the warning.</description>
      <pubDate>Fri, 08 Nov 2019 03:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602671#M16852</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-11-08T03:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Length Specified for a Varible</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602673#M16853</link>
      <description>&lt;P&gt;Thank you for the help! I got the problem solved!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 03:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602673#M16853</guid>
      <dc:creator>walkerel</dc:creator>
      <dc:date>2019-11-08T03:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Length Specified for a Varible</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602710#M16854</link>
      <description>&lt;P&gt;Try option :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options varlenchk=nowarn ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Nov 2019 12:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Multiple-Length-Specified-for-a-Varible/m-p/602710#M16854</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-08T12:14:21Z</dc:date>
    </item>
  </channel>
</rss>

