<?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 trt1 by input data set(s). in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898721#M355238</link>
    <description>&lt;P&gt;I think is kind of self explanatory.&lt;/P&gt;
&lt;P&gt;Do a PROC CONTENTS on both input datasets and compare your variable definitions.&lt;/P&gt;
&lt;P&gt;If you have deviations, you could specify a LENGTH statement prior to SET and use the largest length value for your input variable(s).&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 09:57:35 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2023-10-16T09:57:35Z</dc:date>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898722#M355234</link>
      <description>Yeah, I checked the proc contents to check the size of variables but that&lt;BR /&gt;that also didn't work. This warning has been ever present in my code even&lt;BR /&gt;though I have been using the largest length value for the input variables.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Oct 2023 10:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898722#M355234</guid>
      <dc:creator>diwashsapkota</dc:creator>
      <dc:date>2023-10-16T10:02:54Z</dc:date>
    </item>
    <item>
      <title>WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898720#M355237</link>
      <description>&lt;DIV class=""&gt;I am getting the following warnings in my code every time I specify the length of the variables:&lt;/DIV&gt;&lt;DIV class=""&gt;WARNING: Multiple lengths were specified for the variable trt1 by input data set(s). This can cause truncation of data.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;The code that is giving me the error is:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;data oneae;
set dummy1 ae4(rename=(placebo=trt1 Xanomeline_High_Dose=trt2
Xanomeline_Low_Dose=trt3));
ord=1;
aeterm='Subject with at least one AE';
tot1="&amp;amp;bign1";
tot2="&amp;amp;bign2";
tot3="&amp;amp;bign3";
run;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Oct 2023 09:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898720#M355237</guid>
      <dc:creator>diwashsapkota</dc:creator>
      <dc:date>2023-10-16T09:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898721#M355238</link>
      <description>&lt;P&gt;I think is kind of self explanatory.&lt;/P&gt;
&lt;P&gt;Do a PROC CONTENTS on both input datasets and compare your variable definitions.&lt;/P&gt;
&lt;P&gt;If you have deviations, you could specify a LENGTH statement prior to SET and use the largest length value for your input variable(s).&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 09:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898721#M355238</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-10-16T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898727#M355235</link>
      <description>&lt;P&gt;Please share you log with the code, and proc contents.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 10:47:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898727#M355235</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-10-16T10:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898747#M355239</link>
      <description>As long as you make sure the length of this variable is long enough ,and would not get any problem, you could try this option to suppress the warning info.&lt;BR /&gt;&lt;BR /&gt;option varlenchk=nowarn;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Oct 2023 11:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898747#M355239</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-10-16T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898782#M355249</link>
      <description>&lt;P&gt;At least in my SAS9.4M7 environment under Windows you get this warning only if the variable in the first table got a shorter length defined than in the second table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will use the first occurrence of a source variable to create the pdv and though if this first occurrence is the shorter length then string truncation is possible and though the Warning is correct and should remain.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way to avoid such a truncation issue is to define the variable length explicitly before the set statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ata have1;
  length var $1;
  var='A';
run;
data have2;
  length var $2;
  var='BB';
run;

/* creates warning because test1 got the variable with a shorter length */
data test1;
  set have1 have2;
run;

/* var with greater length defined before the set statement: no warning */
data test2;
  length var $2;
  set have1 have2;
run;

/* source table with var that has greater length first in set statement: no warning */
data test3;
  set have2 have1;
run;


/* and here if you don't know the max length in advance */
proc sql;
  create table layout as
    select * from have1(obs=0)
    union corr all
    select * from have2(obs=0)
    ;
quit;

data test4;
  set layout have1 have2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 13:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898782#M355249</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-16T13:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Multiple lengths were specified for the variable trt1 by input data set(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898796#M355252</link>
      <description>&lt;P&gt;Based on this program, what you need to compare is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The length of TRT1 in DUMMY1&lt;/P&gt;
&lt;P&gt;vs.&lt;/P&gt;
&lt;P&gt;The length of PLACEBO in AE4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you try to control the length using a LENGTH statement, that statement must come before the SET statement.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 14:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-WARNING-Multiple-lengths-were-specified-for-the-variable-trt1/m-p/898796#M355252</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-10-16T14:12:18Z</dc:date>
    </item>
  </channel>
</rss>

