<?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 in SAS DI STUDIO in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636119#M188922</link>
    <description>Thank you very much my friend!</description>
    <pubDate>Tue, 31 Mar 2020 09:23:02 GMT</pubDate>
    <dc:creator>farshidowrang</dc:creator>
    <dc:date>2020-03-31T09:23:02Z</dc:date>
    <item>
      <title>Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/635842#M188837</link>
      <description>&lt;P&gt;Dear friends,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have many tables connected to a LOOKUP transformation. There is a&amp;nbsp;character variable (let's call it X) which has different length in the tables. I want all of them be finally $5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put(X , $5.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the EXPRESSION for the variable X in the LOOKUP transformation but it didn't solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know how I can solve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Farshid Owrang&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/635842#M188837</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2020-03-30T15:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/635918#M188863</link>
      <description>&lt;P&gt;Is the issue that the X column is longer or shorter than $5 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specify the variable length prior to a SET statement that reads a table with a column named X, or before any other computation that might implicitly set the variables length.&amp;nbsp; By doing so, the code forces the variable length, not side effects.&lt;/P&gt;
&lt;PRE&gt;data want;
  length x $5;
...
* set statement;
* formula statement;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Mar 2020 18:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/635918#M188863</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-03-30T18:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636066#M188899</link>
      <description>&lt;P&gt;Is this a data step? I assume so since this message is not displayed by SQL afaik.&lt;/P&gt;
&lt;P&gt;If you set the length to 5, and some of the variables (not the values, SAS does not check the values) are longer than 5, th message is displayed because the variables with a length greater than 5 might be truncated to 5, and therefore lose data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;X=put(X,$5.);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;does not reset the length of the variable, only the length of the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Y=put(X,$5.);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;drop X;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;rename Y=X;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;should do what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 03:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636066#M188899</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-31T03:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636094#M188910</link>
      <description>&lt;P&gt;The expression gets used for the target table and not for source tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Implementing ETL processes using DIS the same named variable should always mean the same and have the same attributes in all tables so best way would be to fix the source problem. You can use &lt;EM&gt;Tool/Standardize Columns&lt;/EM&gt; for this task. Once metadata is fixed you also need to re-create permanent physical tables for such changes to take effect. And you need to redeploy all DIS jobs using any of the tables with changed metadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Lookup Transformation doesn't let you change input variable attributes.&amp;nbsp;If it isn't possible for you to fix the source problem then one way to go is to add a SQL Extract node where you create the variable as required, define the target as view and then use this view as input to the Lookup Transformation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 06:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636094#M188910</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-31T06:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636119#M188922</link>
      <description>Thank you very much my friend!</description>
      <pubDate>Tue, 31 Mar 2020 09:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636119#M188922</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2020-03-31T09:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636120#M188923</link>
      <description>Thank you very much!</description>
      <pubDate>Tue, 31 Mar 2020 09:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636120#M188923</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2020-03-31T09:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple lengths were specified for the variable in SAS DI STUDIO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636121#M188924</link>
      <description>Perfect!&lt;BR /&gt;&lt;BR /&gt;Thank you very much!</description>
      <pubDate>Tue, 31 Mar 2020 09:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-lengths-were-specified-for-the-variable-in-SAS-DI/m-p/636121#M188924</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2020-03-31T09:23:55Z</dc:date>
    </item>
  </channel>
</rss>

