<?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: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698082#M25479</link>
    <description>&lt;P&gt;Reducing the length of the variable ssn has been discussed recently in epic-length, so please use the search function to find it. Best way to solve such problem is fixing the code creating the variable with the wrong length, not reducing it afterwards. &lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2020 06:31:20 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-11-11T06:31:20Z</dc:date>
    <item>
      <title>How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698075#M25478</link>
      <description>&lt;P&gt;After trying many examples of solutions I have found here on SAS communities I still can't get this to work.&amp;nbsp; The incoming SSN variable is $12 with a format and informat.&amp;nbsp; What we want is $11 with no format or informat.&amp;nbsp; I thought that by specifying the LENGTH statement before the SET statement that it would solve the problem but I am still getting the warning.&amp;nbsp;&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;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.new;

LENGTH SSN $11;

RETAIN SSN VisitDt HtIn WtLb SBP DBP;

SET dataset;

LABEL     SSN     = 'Social Security Number'
          VisitDt = 'Visit Date'
          HtIn    = 'Height (In)'
          WtLb    = 'Weight (Lb)'
          SBP     = 'Systolic BP (mmHg)'
          DBP     = 'Diastolic BP (mmHg)';

FORMAT SSN SBP DBP; 
INFORMAT SSN;

KEEP SSN VisitDt HtIn WtLb SBP DBP;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698075#M25478</guid>
      <dc:creator>txim33</dc:creator>
      <dc:date>2020-12-10T15:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698082#M25479</link>
      <description>&lt;P&gt;Reducing the length of the variable ssn has been discussed recently in epic-length, so please use the search function to find it. Best way to solve such problem is fixing the code creating the variable with the wrong length, not reducing it afterwards. &lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 06:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698082#M25479</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-11-11T06:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698086#M25480</link>
      <description>&lt;P&gt;As soon as you forcibly shorten an existing variable, you will get the WARNING, and that is as it should be.&lt;/P&gt;
&lt;P&gt;The proper way to deal with this is to fix your import process(es), so that the datasets are created with consistent variable attributes across the board.&lt;/P&gt;
&lt;P&gt;If you do not have it already, set up a catalog that describes the attributes, and use that for writing the import programs.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 06:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/698086#M25480</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-11T06:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/699345#M25608</link>
      <description>&lt;P&gt;Hi Kurt,&lt;BR /&gt;Thank you for your solution. I hadn't thought of that. Unfortunately for this issue we are supposed to find a way to code the change in variable length. Also, this is an excel file import and because of my system configuration I have to use PROC IMPORT. Can you specify variable lengths when importing that way? What finally worked for me was this (this is not the whole datastep - just the part that addresses the variable length):&lt;BR /&gt;DATA WORK.new;&lt;BR /&gt;&lt;BR /&gt;LENGTH SSN $11;&lt;BR /&gt;&lt;BR /&gt;RETAIN SSN VisitDt HtIn WtLb SBP DBP;&lt;BR /&gt;&lt;BR /&gt;SET dataset (RENAME = (SSN = SSN_temp));&lt;BR /&gt;&lt;BR /&gt;SSN= SSN_temp;&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;A&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/699345#M25608</guid>
      <dc:creator>txim33</dc:creator>
      <dc:date>2020-12-10T15:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/699370#M25611</link>
      <description>&lt;P&gt;To get full control of the import process (the "E" in "ETL"), load the file in Excel and save the sheet as a .csv file. That file can be read with a data step, where you set all attributes consistently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, your correction step is the best you can do.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 06:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/699370#M25611</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-17T06:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/701866#M25833</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was having the same issue. Heres what worked for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to strip the SSN in the IA data to not have any spaces before or after which I did with the following code. This made it 11 characters long&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	WORK.data;
LENGTH SSN $11;
SET	import.vit (RENAME=(SSN=SSN2));	
KEEP SSN VisitDt HtIn WtLb SBP DBP;
HtIn=ROUND(.393701*HtCm, 1);
WtLb=ROUND(2.20462*WtKg, 1);
SSN=STRIP(SSN2);
FORMAT VisitDt DATE9.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then to get rid of the formats and in-formats on the combined data I used the following code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA tabs.vit;
SET tabs.vit;
FORMAT SSN HtIn WtLb SBP DBP;
INFORMAT SSN VisitDt HtIn WtLb SBP DBP;
RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/701866#M25833</guid>
      <dc:creator>hspears</dc:creator>
      <dc:date>2020-12-10T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix WARNING: Multiple lengths were specified for the variable SSN by input data set(s)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/701868#M25834</link>
      <description>&lt;P&gt;To only change formats and informats, it is better to use PROC DATASETS, as that only rewrites the first dataset page, and not the whole dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 18:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-WARNING-Multiple-lengths-were-specified-for-the/m-p/701868#M25834</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-26T18:33:45Z</dc:date>
    </item>
  </channel>
</rss>

