<?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: What is the best way to create extra rows by swapping variables? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-best-way-to-create-extra-rows-by-swapping-variables/m-p/820748#M324002</link>
    <description>&lt;P&gt;One way is to use RENAME= option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have have(rename=(firstName=lastName lastName=firstName));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Jun 2022 17:35:59 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-06-28T17:35:59Z</dc:date>
    <item>
      <title>What is the best way to create extra rows by swapping variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-best-way-to-create-extra-rows-by-swapping-variables/m-p/820734#M323993</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create extra rows by swapping variables. For example, I have a dataset with two variables first name and last name:&lt;/P&gt;&lt;P&gt;firstName lastName&lt;/P&gt;&lt;P&gt;Sara&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Daner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want an extra row by swapping first name and last name, desired dataset will be like:&lt;/P&gt;&lt;P&gt;firstName lastName&lt;/P&gt;&lt;P&gt;Sara&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Daner&lt;/P&gt;&lt;P&gt;Daner&amp;nbsp; &amp;nbsp; &amp;nbsp; Sara&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to do it? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 16:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-best-way-to-create-extra-rows-by-swapping-variables/m-p/820734#M323993</guid>
      <dc:creator>SAS_taozi</dc:creator>
      <dc:date>2022-06-28T16:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to create extra rows by swapping variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-best-way-to-create-extra-rows-by-swapping-variables/m-p/820748#M324002</link>
      <description>&lt;P&gt;One way is to use RENAME= option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have have(rename=(firstName=lastName lastName=firstName));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jun 2022 17:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-best-way-to-create-extra-rows-by-swapping-variables/m-p/820748#M324002</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-28T17:35:59Z</dc:date>
    </item>
  </channel>
</rss>

