<?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: WARNING: Multiple lengths were specified for the variable ... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22319#M3610</link>
    <description>Suggest you use a RENAME=(&lt;OLD_VARNAME&gt;=&lt;NEW_VARNAME&gt;) as a SET "data set" option, and then perform an INPUT function in an assignment statement to get the desired result without the WARNING message.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
length difference rename dataset option site:sas.com&lt;/NEW_VARNAME&gt;&lt;/OLD_VARNAME&gt;</description>
    <pubDate>Tue, 26 Oct 2010 00:20:14 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-10-26T00:20:14Z</dc:date>
    <item>
      <title>WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22318#M3609</link>
      <description>Gday,&lt;BR /&gt;
&lt;BR /&gt;
I want to remove all error/warning messages from my code.&lt;BR /&gt;
&lt;BR /&gt;
I have a pretty simple piece of code, where the STATE have been defined with different lengths.&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;1490&lt;BR /&gt;
1491  DATA WPolSummary0;&lt;BR /&gt;
1492     format state $5.;&lt;BR /&gt;
1493     SET&lt;BR /&gt;
1494        rateBusPack&lt;BR /&gt;
1495        rateISR&lt;BR /&gt;
1496        rateBW&lt;BR /&gt;
1497        rateCAR&lt;BR /&gt;
1498     ;&lt;BR /&gt;
1499  RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;WARNING: Multiple lengths were specified for the variable &lt;U&gt;state&lt;/U&gt; by input data set(s). This may&lt;BR /&gt;
         cause truncation of data.&lt;/B&gt;&lt;BR /&gt;
NOTE: There were 95507 observations read from the data set WORK.RATEBUSPACK.&lt;BR /&gt;
NOTE: There were 1822 observations read from the data set WORK.RATEISR.&lt;BR /&gt;
NOTE: There were 70663 observations read from the data set WORK.RATEBW.&lt;BR /&gt;
NOTE: There were 19263 observations read from the data set WORK.RATECAR.&lt;BR /&gt;
NOTE: The data set WORK.WPOLSUMMARY0 has 187255 observations and 32 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           2.98 seconds&lt;BR /&gt;
      cpu time            0.96 seconds&lt;/I&gt;&lt;BR /&gt;
^^&lt;BR /&gt;
&lt;BR /&gt;
The offending dataset is &lt;I&gt;WORK.RATEBW&lt;/I&gt;, the length is $255 whereas the rest have been defined as $5.&lt;BR /&gt;
&lt;BR /&gt;
In this dataset, how can I define the length to a smaller number than the largest value, eg $5?  &lt;BR /&gt;
&lt;BR /&gt;
I have observed that if I specify a larger number, eg $500, there are no errors, but I know that the STATE values are never longer than five character.&lt;BR /&gt;
&lt;BR /&gt;
I don't want to create a new variable and re-allocate the values.&lt;BR /&gt;
&lt;BR /&gt;
I don't want to use system options eg &lt;I&gt;VARLENCHK=&lt;/I&gt;.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
edit:&lt;BR /&gt;
I should say that I'm using SAS 9.2 on Windows&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: John T

Message was edited by: John T</description>
      <pubDate>Mon, 25 Oct 2010 22:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22318#M3609</guid>
      <dc:creator>JohnT</dc:creator>
      <dc:date>2010-10-25T22:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22319#M3610</link>
      <description>Suggest you use a RENAME=(&lt;OLD_VARNAME&gt;=&lt;NEW_VARNAME&gt;) as a SET "data set" option, and then perform an INPUT function in an assignment statement to get the desired result without the WARNING message.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
length difference rename dataset option site:sas.com&lt;/NEW_VARNAME&gt;&lt;/OLD_VARNAME&gt;</description>
      <pubDate>Tue, 26 Oct 2010 00:20:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22319#M3610</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-26T00:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22320#M3611</link>
      <description>Hi Scott,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your response, but I don't want that solution.&lt;BR /&gt;
&lt;BR /&gt;
For the time being, this was my solution:&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;DATA WPolSummary0;&lt;BR /&gt;
   length state $500. state2 $5.;&lt;BR /&gt;
   SET &lt;BR /&gt;
      rateBusPack &lt;BR /&gt;
      rateISR &lt;BR /&gt;
      rateBW &lt;BR /&gt;
      rateCAR&lt;BR /&gt;
   ;&lt;BR /&gt;
&lt;BR /&gt;
   state2 = state;&lt;BR /&gt;
   drop state;&lt;BR /&gt;
   rename state2 = state;&lt;BR /&gt;
RUN;&lt;/I&gt;&lt;BR /&gt;
^^&lt;BR /&gt;
&lt;BR /&gt;
Which is essentially, what you suggested.&lt;BR /&gt;
&lt;BR /&gt;
I don't want to perform renaming of variables, if I can get away with it.  Any other ideas?</description>
      <pubDate>Tue, 26 Oct 2010 00:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22320#M3611</guid>
      <dc:creator>JohnT</dc:creator>
      <dc:date>2010-10-26T00:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22321#M3612</link>
      <description>I suspect you are using SAS 9.2 and the VARLENCHK system option is set to WARN. If you want to turn off the warning try:&lt;BR /&gt;
&lt;BR /&gt;
options VARLENCHK = NOWARN;&lt;BR /&gt;
&lt;BR /&gt;
This is the default SAS 9.1.3 behaviour.</description>
      <pubDate>Tue, 26 Oct 2010 02:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22321#M3612</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-10-26T02:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22322#M3613</link>
      <description>So, do also consider that by setting the VARLENCHK option to NOWARN, you may be masking another possible problem symptom condition that could go unnoticed.  I suggest you reconsider the RENAME= approach without limiting yourself with the NOWARN approach.  I have similar recommendations for using SAS OPTIONS DKRICOND / DKROCOND with NOWARN as well.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 26 Oct 2010 16:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22322#M3613</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-26T16:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22323#M3614</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Thanks, I honestly did not expect a solution, I trawled google for an hour looking for one.&lt;BR /&gt;
&lt;BR /&gt;
As Scott mentioned, I don't want to use that system option, as it will hide the real errors.&lt;BR /&gt;
&lt;BR /&gt;
Really, I just wanted to make &lt;I&gt;beautiful&lt;/I&gt; code.  That and remove error/warning messages in the code, so when other people in the team run it, they aren't falsely alerted to issues.&lt;BR /&gt;
&lt;BR /&gt;
The use of the rename statement, whilst it works, in this case, I would no regard as &lt;I&gt;beautiful&lt;/I&gt;.  For the time being it is what I'm using.</description>
      <pubDate>Tue, 26 Oct 2010 22:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22323#M3614</guid>
      <dc:creator>JohnT</dc:creator>
      <dc:date>2010-10-26T22:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22324#M3615</link>
      <description>Okay - whatever steers your mouse-cursor.....beautiful, efficient, well-documented or otherwise operational....&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 26 Oct 2010 22:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22324#M3615</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-26T22:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22325#M3616</link>
      <description>Assuming that you have control (don't we all wish for just such a thing?) of the creation of the incoming data sets, beautiful code would require cleaning up, assigning the correct length to STATE, in the data set WORK.RATEBW.  Then the whole problem goes away.</description>
      <pubDate>Wed, 27 Oct 2010 04:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22325#M3616</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-10-27T04:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22326#M3617</link>
      <description>If you don't mind that the variable state is stored with length 255 in the WPolSummary, and if you don't need the rate* data sets to be in any particular order in the set statement, you can also just switch around the data set names so that rateBW is first in the set statement. &lt;BR /&gt;
&lt;BR /&gt;
set rateBW rateBusPack rateISR rateCAR;</description>
      <pubDate>Wed, 27 Oct 2010 16:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/22326#M3617</guid>
      <dc:creator>martha_sas</dc:creator>
      <dc:date>2010-10-27T16:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/274064#M54645</link>
      <description>&lt;P&gt;&lt;EM&gt;Maybe Scott refered to something like this, which I usually use for adapting dates to Excel format and somehow prefer as more beautiful:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DATA WPolSummary0 &lt;STRONG&gt;(DROP=state_old)&lt;/STRONG&gt;;&lt;BR /&gt;&lt;STRONG&gt;length&amp;nbsp;state $5.;&lt;/STRONG&gt;&lt;BR /&gt;SET&lt;BR /&gt;rateBusPack&lt;BR /&gt;rateISR&lt;BR /&gt;rateBW &lt;STRONG&gt;(RENAME=(state=state_old))&lt;/STRONG&gt;&lt;BR /&gt;rateCAR&lt;BR /&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;state=state_old;&lt;/STRONG&gt;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Cheers!&lt;BR /&gt;(Is this actually used as a "goodbye"? Best wishes or best regards maybe sounds&amp;nbsp; like "too much" here ^^)&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 10:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Multiple-lengths-were-specified-for-the-variable/m-p/274064#M54645</guid>
      <dc:creator>rmoreno</dc:creator>
      <dc:date>2016-05-31T10:51:09Z</dc:date>
    </item>
  </channel>
</rss>

