<?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: wide to long with first set of columns stay the same in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882524#M348658</link>
    <description>I can't download excel at the moment, so no idea what your samples look like. It's much easier if you include the sample data in your posts.</description>
    <pubDate>Mon, 26 Jun 2023 20:16:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2023-06-26T20:16:34Z</dc:date>
    <item>
      <title>wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882516#M348655</link>
      <description>&lt;P&gt;I'm sure this should be simple, but it's taking me a while to find it. I want to change a wide data set to a long data set. However, I want the first sets of columns to stay the same. I'm attaching two made up, fictional data sets. Testwide.xlsx is the input data set, that has a wide format, and I want to change it to testlong.xlsx, which would be the output data set, with a long format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can find lots of websites on changing wide to long, but only when you pivot or transpose starting at the first variable, and all the other ones transpose. I want the first set of columns to stay the same for each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 20:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882516#M348655</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2023-06-26T20:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882518#M348656</link>
      <description>You can set those as multiple by variables.</description>
      <pubDate>Mon, 26 Jun 2023 20:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882518#M348656</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-26T20:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882521#M348657</link>
      <description>&lt;P&gt;Hi Reeza. Thanks for responding. What would I do, in SAS, to change the wide data set into the long data set. You mean something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=testwide out=testlong;&lt;/P&gt;
&lt;P&gt;by county group indicator;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 20:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882521#M348657</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2023-06-26T20:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882524#M348658</link>
      <description>I can't download excel at the moment, so no idea what your samples look like. It's much easier if you include the sample data in your posts.</description>
      <pubDate>Mon, 26 Jun 2023 20:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882524#M348658</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-26T20:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882527#M348660</link>
      <description>&lt;P&gt;I usually don't include in my posts because they often don't show up the way I have them, but here goes. This is the wide version&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 336pt;" border="0" width="448" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;County&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;group&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;indicator&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;city&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;burbs&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;rural&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;Total&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;87&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;45&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;23&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;23&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;54&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;18&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to change it to this long version&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;County&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;group&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;indicator&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;location&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;value&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;city&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;87&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;burbs&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;rural&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;23&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;total&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;city&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;23&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;burbs&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;54&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;rural&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;wijits&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;total&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;city&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;burbs&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;18&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;rural&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Albany&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Capital&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;total&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;city&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;burbs&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;rural&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;Da Bronx&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;NYC&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;thingies&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;total&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 26 Jun 2023 20:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882527#M348660</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2023-06-26T20:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882528#M348661</link>
      <description>Your sample code looks correct, I'd explicitly add the variables to transpose via a VAR statement but I think it will default to everything else.</description>
      <pubDate>Mon, 26 Jun 2023 20:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882528#M348661</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-26T20:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: wide to long with first set of columns stay the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882531#M348662</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was getting 0 rows of output until i put in the var line, so that looks right. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 20:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wide-to-long-with-first-set-of-columns-stay-the-same/m-p/882531#M348662</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2023-06-26T20:28:44Z</dc:date>
    </item>
  </channel>
</rss>

