<?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 to carry the label of a source variable when creating a new variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693571#M211505</link>
    <description>&lt;P&gt;Create a data set with the names of the variables and labels from the starting set.&lt;/P&gt;
&lt;P&gt;Add the matching new variable names to that data set.&lt;/P&gt;
&lt;P&gt;Use the data set to write Proc Datasets code to modify data set 2 after creation to use the labels.&lt;/P&gt;
&lt;P&gt;You can find some examples on the forum of using Call Execute in a data step to call Proc datasets to rename variables, label syntax would be similar using the New name and old label in a modify block.&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 17:44:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-10-22T17:44:59Z</dc:date>
    <item>
      <title>How to carry the label of a source variable when creating a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693562#M211503</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my pgm, when i created variables&lt;FONT color="#FF0000"&gt; d,e f, in data step two,&amp;nbsp;&amp;nbsp;&lt;FONT color="#000000"&gt;I am seeing the variable labels for these variables. i need to carry labels of source variables. Please suggest&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input a $ b $ c;
label a ='some' b='somm' c='somn';
datalines;
nn ss 1
dk mm 2
;

data two;
set one;
d=a;
e=b;
f=c;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 17:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693562#M211503</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2020-10-22T17:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to carry the label of a source variable when creating a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693571#M211505</link>
      <description>&lt;P&gt;Create a data set with the names of the variables and labels from the starting set.&lt;/P&gt;
&lt;P&gt;Add the matching new variable names to that data set.&lt;/P&gt;
&lt;P&gt;Use the data set to write Proc Datasets code to modify data set 2 after creation to use the labels.&lt;/P&gt;
&lt;P&gt;You can find some examples on the forum of using Call Execute in a data step to call Proc datasets to rename variables, label syntax would be similar using the New name and old label in a modify block.&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 17:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693571#M211505</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-22T17:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to carry the label of a source variable when creating a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693572#M211506</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
merge
  one
  one (rename=(a=d b=e c=f))
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 17:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693572#M211506</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T17:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to carry the label of a source variable when creating a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693577#M211508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68272"&gt;@knveraraju91&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table two as
select *, a as d, b as e, c as f
from one;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 17:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-carry-the-label-of-a-source-variable-when-creating-a-new/m-p/693577#M211508</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-10-22T17:59:34Z</dc:date>
    </item>
  </channel>
</rss>

