<?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 WARNING: Multiple lengths.... in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819402#M40901</link>
    <description>&lt;P&gt;I'm getting this warning for diagnosis code which has varying lengths - the longest (including the decimal) is 7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I fix it so that I stop getting this error? I tried the below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
23         data aa_dd;
24         length icd $7;
25         merge aa(in=ina)
26         	  diag;
27         by claimHeaderId;
28         if ina;
29         
30         run;

WARNING: Multiple lengths were specified for the variable icd by input data set(s). This can cause truncation of data.

      &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Jun 2022 17:48:18 GMT</pubDate>
    <dc:creator>bhca60</dc:creator>
    <dc:date>2022-06-21T17:48:18Z</dc:date>
    <item>
      <title>WARNING: Multiple lengths....</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819402#M40901</link>
      <description>&lt;P&gt;I'm getting this warning for diagnosis code which has varying lengths - the longest (including the decimal) is 7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I fix it so that I stop getting this error? I tried the below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
23         data aa_dd;
24         length icd $7;
25         merge aa(in=ina)
26         	  diag;
27         by claimHeaderId;
28         if ina;
29         
30         run;

WARNING: Multiple lengths were specified for the variable icd by input data set(s). This can cause truncation of data.

      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2022 17:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819402#M40901</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-06-21T17:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths....</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819403#M40902</link>
      <description>&lt;P&gt;Compare the variable lengths in the 2 datasets aa and diag&lt;BR /&gt;My guess is you have a common variable on both datasets that has different lengths defined.&lt;BR /&gt;You might want to run a PROC CONTENTS on them both&lt;BR /&gt;&lt;BR /&gt;Here's a simple example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test10 ;
	length a $10 ;
	a="1234567890" ;
	output ;
run ;

data test8 ;
	length a $8 ;
	a="12345678" ;
	output ;
run ;

data join ;
	set test8 test10 ;
run ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and here's the log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;2    data test10 ;
3        length a $10 ;
4        a="1234567890" ;
5        output ;
6    run ;

NOTE: The data set WORK.TEST10 has 1 observations and 1 variables.
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be
      shifted by the "BEST" format.
NOTE: DATA statement used (Total process time):
      real time           0.13 seconds
      cpu time            0.00 seconds


7
8    data test8 ;
9        length a $8 ;
10       a="12345678" ;
11       output ;
12   run ;

NOTE: The data set WORK.TEST8 has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


13
14   data join ;
15       set test8 test10 ;
16   run ;

WARNING: Multiple lengths were specified for the variable a by input data set(s). This can cause
         truncation of data.
NOTE: There were 1 observations read from the data set WORK.TEST8.
NOTE: There were 1 observations read from the data set WORK.TEST10.
NOTE: The data set WORK.JOIN has 2 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2022 17:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819403#M40902</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-06-21T17:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths....</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819406#M40903</link>
      <description>Yes, thank you; in one set the icd is $50 and the other is $100. Would I just do the same code only change it to length icd  $100?</description>
      <pubDate>Tue, 21 Jun 2022 18:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819406#M40903</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-06-21T18:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths....</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819411#M40905</link>
      <description>&lt;P&gt;Yes, typically you would want to use the length of the longest character variable&lt;BR /&gt;If you run the simple test code, you'll notice that the work.join dataset ends up truncating the second observations from "1234567890" to "12345678" (Not Good)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 18:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/WARNING-Multiple-lengths/m-p/819411#M40905</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-06-21T18:12:52Z</dc:date>
    </item>
  </channel>
</rss>

