<?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: rename in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55225#M11769</link>
    <description>I'm not sure if PHYS_CITY (added 'S') is a typo, but if not, and assuming that this is a character variable, you could do something like:&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
&lt;BR /&gt;
set old;&lt;BR /&gt;
&lt;BR /&gt;
if md_city ne '' and phy_city = '' then phys_city = md_city;&lt;BR /&gt;
&lt;BR /&gt;
else if md_city = '' and phy_city ne '' then phys_city = phy_city;&lt;BR /&gt;
&lt;BR /&gt;
else do;&lt;BR /&gt;
&lt;BR /&gt;
phys_city = '';&lt;BR /&gt;
&lt;BR /&gt;
put 'WARNING: Both city variables are missing for ' _n_=;&lt;BR /&gt;
&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
    <pubDate>Thu, 16 Jul 2009 21:01:35 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-07-16T21:01:35Z</dc:date>
    <item>
      <title>rename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55224#M11768</link>
      <description>Hi,&lt;BR /&gt;
 Until april the vendor gave the filed name as md_city and since may it was changed to phy_city. Now my dataset has values for these two fields. I would want to have the data from these two fields into a single field phys_city.&lt;BR /&gt;
How do I do it without any dataloss?</description>
      <pubDate>Thu, 16 Jul 2009 17:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55224#M11768</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-07-16T17:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: rename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55225#M11769</link>
      <description>I'm not sure if PHYS_CITY (added 'S') is a typo, but if not, and assuming that this is a character variable, you could do something like:&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
&lt;BR /&gt;
set old;&lt;BR /&gt;
&lt;BR /&gt;
if md_city ne '' and phy_city = '' then phys_city = md_city;&lt;BR /&gt;
&lt;BR /&gt;
else if md_city = '' and phy_city ne '' then phys_city = phy_city;&lt;BR /&gt;
&lt;BR /&gt;
else do;&lt;BR /&gt;
&lt;BR /&gt;
phys_city = '';&lt;BR /&gt;
&lt;BR /&gt;
put 'WARNING: Both city variables are missing for ' _n_=;&lt;BR /&gt;
&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 16 Jul 2009 21:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55225#M11769</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-16T21:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: rename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55226#M11770</link>
      <description>Yet another way of doing the same.&lt;BR /&gt;
&lt;BR /&gt;
Assuming that none or only one of the columns has values for each row.&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
set old;&lt;BR /&gt;
length PHYS_CITY $200;&lt;BR /&gt;
PHYS_CITY=coalescec(MD_CITY,PHY_CITY);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Check the online documentation for the COALESCEC function:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a002518268.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a002518268.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Don't forget to allocate PHYS_CITY with enough size to hold values.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;.</description>
      <pubDate>Fri, 17 Jul 2009 07:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/rename/m-p/55226#M11770</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-07-17T07:26:04Z</dc:date>
    </item>
  </channel>
</rss>

