<?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: Identically named vriables in sas dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234025#M42765</link>
    <description>&lt;P&gt;I thought the same so I did a proc content to carefully check the spellings:&lt;/P&gt;
&lt;P&gt;This is an example of what shows up in the proc contents:&lt;/P&gt;
&lt;P&gt;Variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp; Format&amp;nbsp;&amp;nbsp;&amp;nbsp; Informat&amp;nbsp;&amp;nbsp;&amp;nbsp; Label&lt;/P&gt;
&lt;P&gt;Txtcmmnt&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp; 1754&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Is there anything you would like to add?&lt;/P&gt;
&lt;P&gt;Txtcmmnt&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp; 146&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $146&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its the second one with no label that I would like to delete.&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Nov 2015 15:06:44 GMT</pubDate>
    <dc:creator>dr2014</dc:creator>
    <dc:date>2015-11-10T15:06:44Z</dc:date>
    <item>
      <title>Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234022#M42763</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am working with 3 sas datasets each of which have 2 identically named variables e.g txtcmmnt. One of them has a label and the other doesn't. When I use a keep option it only shows one variable but a proc contents or a veiw of the datasets it shows the 2 variables.&amp;nbsp;I need to stack the 3 datasets into a final sas dataset . I would like to delete the variable with no label. How should I do it? Any suggestions will be helpful.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 14:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234022#M42763</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-11-10T14:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234023#M42764</link>
      <description>I am not sure if we could have 2 variables with the same name in the same dataset. Could you please check again, i think they will be some difference in names of those 2 variables.</description>
      <pubDate>Tue, 10 Nov 2015 15:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234023#M42764</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-10T15:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234025#M42765</link>
      <description>&lt;P&gt;I thought the same so I did a proc content to carefully check the spellings:&lt;/P&gt;
&lt;P&gt;This is an example of what shows up in the proc contents:&lt;/P&gt;
&lt;P&gt;Variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp; Format&amp;nbsp;&amp;nbsp;&amp;nbsp; Informat&amp;nbsp;&amp;nbsp;&amp;nbsp; Label&lt;/P&gt;
&lt;P&gt;Txtcmmnt&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp; 1754&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Is there anything you would like to add?&lt;/P&gt;
&lt;P&gt;Txtcmmnt&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp; 146&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $146&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its the second one with no label that I would like to delete.&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 15:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234025#M42765</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-11-10T15:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234028#M42767</link>
      <description>&lt;P&gt;As &lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151" target="_self"&gt;&lt;SPAN class="login-bold"&gt;Jagadishkatam&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;has metioned, you cannot have two separate columns, which have the same name in one dataset. &amp;nbsp;Its not possible within SAS. &amp;nbsp;Can you provide example data?&lt;/P&gt;
&lt;P&gt;If you stack data, then it should keep the properties of the first dataset:&lt;/P&gt;
&lt;PRE&gt;data tmp;
  label a="Hello";
  a="Abc";
run;
data tmp2;
  a="Def";
run;
data final;
  set tmp tmp2;
run;&lt;/PRE&gt;
&lt;P&gt;One way you could force it is to use SQL, with union all, and specify the labels in the first select:&lt;/P&gt;
&lt;PRE&gt;proc sql;  
  create table FINAL as
  select  VARA label="xyz"
  from    TMP
  union all
  select * 
  from    TMP2
  union all...
quit;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Nov 2015 15:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234028#M42767</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-10T15:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234037#M42768</link>
      <description>&lt;P&gt;I agree with both of you. I checked the spellings of the variables . There is uppercase 'I' and looked to see if it is a '1' and it is not. The thing is when I try to stack the datasets , inspite of getting the lengths uniform on the variable txtcmmnt it gives me a warning message:&lt;/P&gt;
&lt;P&gt;WARNING: Multiple lengths were specified for the variable txtCmmnt by input data set(s). This can cause&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; truncation of data&lt;/P&gt;
&lt;P&gt;The new lengths get applied only to the variable with the label. Have you come across something like this? Also, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;, the dataset looks like this&lt;/P&gt;
&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="3" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl63" style="height: 15.0pt; width: 48pt;" height="20" width="64"&gt;ID&lt;/TD&gt;
&lt;TD class="xl63" style="border-left: none; width: 48pt;" width="64"&gt;txtcmmnt&lt;/TD&gt;
&lt;TD class="xl63" style="border-left: none; width: 48pt;" width="64"&gt;txtcmmnt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl63" style="height: 15.0pt; border-top: none;" align="right" height="20"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;eerrr&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl63" style="height: 15.0pt; border-top: none;" align="right" height="20"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;rrrrr&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl63" style="height: 15.0pt; border-top: none;" align="right" height="20"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;ttttt&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;r&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 10 Nov 2015 15:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234037#M42768</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-11-10T15:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234039#M42769</link>
      <description>&lt;P&gt;Try opening the properties of the two datasets. &amp;nbsp;What you are showing below doesn't really show anything. &amp;nbsp;I suspect the two variables have the same LABEL, but the variable NAME is different. &amp;nbsp;Run a proc contents of each one, or right click on the file and select properties.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 15:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234039#M42769</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-10T15:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234040#M42770</link>
      <description>&lt;P&gt;I figured it . The upper case 'I' was the lower case 'l' (L). I dropped the variable and it works fine. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 15:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234040#M42770</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-11-10T15:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Identically named vriables in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234218#M42815</link>
      <description>dr2014: Your question would have been answered much quicker if you had included the ACTUAL variable names. There is no 'l' or '1' in the examples.</description>
      <pubDate>Wed, 11 Nov 2015 16:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identically-named-vriables-in-sas-dataset/m-p/234218#M42815</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2015-11-11T16:08:17Z</dc:date>
    </item>
  </channel>
</rss>

