<?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 Combining datasets with different variable length using macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640562#M190837</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to combine imported datasets using macro but i get warning below&lt;/P&gt;&lt;P&gt;WARNING: Multiple lengths were specified for the variable A by input data set(s). This can cause&lt;BR /&gt;truncation of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that var A has different length format automatically assigned during the import procedure.&lt;/P&gt;&lt;P&gt;below is my code.&lt;/P&gt;&lt;P&gt;%macro combine;&lt;BR /&gt;data c;&lt;BR /&gt;set&lt;BR /&gt;%do i = 1 %to 2;&lt;BR /&gt;&amp;amp;library..&amp;amp;&amp;amp;file&amp;amp;i&lt;BR /&gt;%end;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%combine;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 21:05:39 GMT</pubDate>
    <dc:creator>aayo</dc:creator>
    <dc:date>2020-04-16T21:05:39Z</dc:date>
    <item>
      <title>Combining datasets with different variable length using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640562#M190837</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to combine imported datasets using macro but i get warning below&lt;/P&gt;&lt;P&gt;WARNING: Multiple lengths were specified for the variable A by input data set(s). This can cause&lt;BR /&gt;truncation of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that var A has different length format automatically assigned during the import procedure.&lt;/P&gt;&lt;P&gt;below is my code.&lt;/P&gt;&lt;P&gt;%macro combine;&lt;BR /&gt;data c;&lt;BR /&gt;set&lt;BR /&gt;%do i = 1 %to 2;&lt;BR /&gt;&amp;amp;library..&amp;amp;&amp;amp;file&amp;amp;i&lt;BR /&gt;%end;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%combine;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 21:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640562#M190837</guid>
      <dc:creator>aayo</dc:creator>
      <dc:date>2020-04-16T21:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Combining datasets with different variable length using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640573#M190842</link>
      <description>&lt;P&gt;Explicitly define the lengths of the offending variable(s) to their predetermined maximum value (eg. 60 chars)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro combine;
data c;
length problemvar $60;
set
%do i = 1 %to 2;
&amp;amp;library..&amp;amp;&amp;amp;file&amp;amp;i
%end;
;
run;
%mend;
%combine;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2020 21:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640573#M190842</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2020-04-16T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Combining datasets with different variable length using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640577#M190845</link>
      <description>&lt;P&gt;This works fine. Thanks much.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 22:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640577#M190845</guid>
      <dc:creator>aayo</dc:creator>
      <dc:date>2020-04-16T22:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Combining datasets with different variable length using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640610#M190864</link>
      <description>&lt;P&gt;Do not fix this here, prevent it when the data is imported in the first place. Do not use proc import, use a custom data step to read data, where you control all variable attributes.&lt;/P&gt;
&lt;P&gt;See Maxims 31 and 22. Avoid Excel Files, convert to CSV first.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 05:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640610#M190864</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-17T05:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Combining datasets with different variable length using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640891#M190974</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;This is noted.&lt;/P&gt;&lt;P&gt;I have changed my import to data step and made use of csv file.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 23:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-datasets-with-different-variable-length-using-macro/m-p/640891#M190974</guid>
      <dc:creator>aayo</dc:creator>
      <dc:date>2020-04-17T23:21:51Z</dc:date>
    </item>
  </channel>
</rss>

