<?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: Multiple lengths were specified for the variable XX by input data set(s) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314854#M68630</link>
    <description>&lt;P&gt;I would place a small wager that all of your WIO&amp;amp;i data sets were created with separate Proc Import statements. Import &lt;STRONG&gt;guesses&lt;/STRONG&gt; about the length of variables and if they length changes for values from set to set or the number examined in each proc import (default 20) is small then you get different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may be better off going back to the import and use one of the methods to read each file with the same data step.&lt;/P&gt;
&lt;P&gt;NOTE: Starting with Excel files often compounds this issue due to the lack of constraints on individual files.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 15:46:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-11-28T15:46:49Z</dc:date>
    <item>
      <title>Multiple lengths were specified for the variable XX by input data set(s)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314668#M68571</link>
      <description>&lt;P&gt;When I try to save a &lt;U&gt;work&lt;/U&gt;.dataset as a &lt;U&gt;sas&lt;/U&gt;.dataset I get the following&amp;nbsp;warning message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;Multiple lengths were specified for the variable X by input data set(s). This can cause truncation of data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;FONT color="#000000"&gt;The dataset (WIO) has&amp;nbsp;2467 columns (C, D, E etc.) and 36960 rows. IIOdat is the library.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;&lt;FONT color="#000000"&gt;Code:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class="sasSource"&gt;%macro setlist;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;%do i=2000 %to 2014;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;WIO&amp;amp;i&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;%end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;%mend setlist;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;data IIOdat.WIO;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;set %setlist;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;run;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Log:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="sasSource"&gt;58 %macro setlist;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;59 %do i=2000 %to 2014;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;60 WIO&amp;amp;i&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61 %end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 %mend setlist;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;64 data IIOdat.WIO;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;65 set %setlist;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable JU by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable OC by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable SK by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable UO by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable ABA by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable AFI by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable AJQ by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable ALU by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable AQC by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable AUG by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable AWO by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable AYS by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BAW by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BFE by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BHI by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BJM by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BNI by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BNM by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BNU by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BSC by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable BWK by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable CHE by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable CJI by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Multiple lengths were specified for the variable CNL by input data set(s). This can cause&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;truncation of data.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2000.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2001.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2002.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2003.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2004.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2005.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2006.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2007.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2008.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2009.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2010.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2011.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2012.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2013.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 2464 observations read from the data set WORK.WIO2014.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set IIODAT.WIO has 36960 observations and 2467 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 35.36 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 11.51 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;STRONG&gt;What does this mean, and what can I do to fix it?&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;All help is very appreciated!!&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sun, 27 Nov 2016 22:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314668#M68571</guid>
      <dc:creator>biringstad</dc:creator>
      <dc:date>2016-11-27T22:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable XX by input data set(s)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314825#M68625</link>
      <description>&lt;P&gt;SAS will look at the first instance of a field and set the ongoing format based on what it sees that first time. If some other value is assigned to that field that is longer it may not fit (say it sees a 5 character field first and then another dataset comes in later and has a 10 character value in that field).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you need to do some data grooming on the datasets you wish to use in the macro, formatting each variable to the same length before setting them together.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 14:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314825#M68625</guid>
      <dc:creator>TheShark</dc:creator>
      <dc:date>2016-11-28T14:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable XX by input data set(s)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314854#M68630</link>
      <description>&lt;P&gt;I would place a small wager that all of your WIO&amp;amp;i data sets were created with separate Proc Import statements. Import &lt;STRONG&gt;guesses&lt;/STRONG&gt; about the length of variables and if they length changes for values from set to set or the number examined in each proc import (default 20) is small then you get different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may be better off going back to the import and use one of the methods to read each file with the same data step.&lt;/P&gt;
&lt;P&gt;NOTE: Starting with Excel files often compounds this issue due to the lack of constraints on individual files.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 15:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/314854#M68630</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-28T15:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable XX by input data set(s)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/315544#M68861</link>
      <description>&lt;P&gt;Thank you for the advises. I ended up changing the code for how I imported the csv files in the beginning of the programme, where I specified the&amp;nbsp;length of the character and numeric variables - It seems like that&amp;nbsp;solved the truncation problem. Thus, in stead of using 'PROC IMPORT' to import multiple csv files, I used the INPUT statement to import the files.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-XX-by-input/m-p/315544#M68861</guid>
      <dc:creator>biringstad</dc:creator>
      <dc:date>2016-11-30T14:58:43Z</dc:date>
    </item>
  </channel>
</rss>

