<?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 transpose in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798237#M39231</link>
    <description>&lt;P&gt;Was asked the following question:&lt;/P&gt;
&lt;PRE&gt;1) Reshape the data from long to wide according to the Date variable&lt;BR /&gt;(i.e., creating multiple new variables based on Date). Retain ID, LastName, and DOB &lt;BR /&gt;on each line, and use the values in Event as the new variable names.&lt;/PRE&gt;
&lt;P&gt;I thought I had it but when I use my code, nothing in the dataset seemed to change? There were still 100 rows like the original dataset&lt;/P&gt;
&lt;PRE&gt;proc transpose data = covidlng.covidlong out = cohortwide prefix = Event;&lt;BR /&gt;	by id lastname dob;&lt;BR /&gt;	id event;&lt;BR /&gt;	var date;&lt;BR /&gt;	run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saza_0-1645648703500.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68788iEF591E61CE83F1B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saza_0-1645648703500.png" alt="saza_0-1645648703500.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;what I see when I hit run&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saza_0-1645649985336.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68791i1CE2B64E3B2C33C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saza_0-1645649985336.png" alt="saza_0-1645649985336.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc contents for OG dataset&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saza_1-1645650016330.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68792i119D11D52063D88B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saza_1-1645650016330.png" alt="saza_1-1645650016330.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc contents for the cohort wide&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>Wed, 23 Feb 2022 21:00:28 GMT</pubDate>
    <dc:creator>saza</dc:creator>
    <dc:date>2022-02-23T21:00:28Z</dc:date>
    <item>
      <title>transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798237#M39231</link>
      <description>&lt;P&gt;Was asked the following question:&lt;/P&gt;
&lt;PRE&gt;1) Reshape the data from long to wide according to the Date variable&lt;BR /&gt;(i.e., creating multiple new variables based on Date). Retain ID, LastName, and DOB &lt;BR /&gt;on each line, and use the values in Event as the new variable names.&lt;/PRE&gt;
&lt;P&gt;I thought I had it but when I use my code, nothing in the dataset seemed to change? There were still 100 rows like the original dataset&lt;/P&gt;
&lt;PRE&gt;proc transpose data = covidlng.covidlong out = cohortwide prefix = Event;&lt;BR /&gt;	by id lastname dob;&lt;BR /&gt;	id event;&lt;BR /&gt;	var date;&lt;BR /&gt;	run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saza_0-1645648703500.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68788iEF591E61CE83F1B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saza_0-1645648703500.png" alt="saza_0-1645648703500.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;what I see when I hit run&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saza_0-1645649985336.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68791i1CE2B64E3B2C33C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saza_0-1645649985336.png" alt="saza_0-1645649985336.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc contents for OG dataset&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saza_1-1645650016330.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68792i119D11D52063D88B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saza_1-1645650016330.png" alt="saza_1-1645650016330.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc contents for the cohort wide&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>Wed, 23 Feb 2022 21:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798237#M39231</guid>
      <dc:creator>saza</dc:creator>
      <dc:date>2022-02-23T21:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798240#M39232</link>
      <description>Show the log and proc contents on each data set please.</description>
      <pubDate>Wed, 23 Feb 2022 20:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798240#M39232</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-23T20:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798243#M39233</link>
      <description>Sure, added them to the original post</description>
      <pubDate>Wed, 23 Feb 2022 20:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798243#M39233</guid>
      <dc:creator>saza</dc:creator>
      <dc:date>2022-02-23T20:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798244#M39234</link>
      <description>That's a proc print, not proc contents and for only one data set. &lt;BR /&gt;&lt;BR /&gt;But your log shows that your output data set has 472 records not 100, are you sure you're checking the correct output data set?</description>
      <pubDate>Wed, 23 Feb 2022 20:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798244#M39234</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-23T20:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798250#M39235</link>
      <description>I am sorry for the confusion on my end. Hopefully my update helps</description>
      <pubDate>Wed, 23 Feb 2022 21:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798250#M39235</guid>
      <dc:creator>saza</dc:creator>
      <dc:date>2022-02-23T21:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798258#M39236</link>
      <description>&lt;P&gt;What does your LOG look like? Copy the text from the log, open a text box on the forum using the &amp;lt;/&amp;gt; icon above the message window and paste the text. Include the program statements and all the notes or messages from that code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran your code on your data set and get 472 records in the output data set, which is the same as you show in the proc contents for the wide set. The original data set has 1416 observations. So I do not see where you are getting 100.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that perhaps you do not want to use PREFIX=EVENT has that makes the new variable names EVENT+the value of the event variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 21:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798258#M39236</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-23T21:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798260#M39237</link>
      <description>&lt;P&gt;Your log and code and everything looks correct. What makes you think it's wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 21:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798260#M39237</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-23T21:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: transpose</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798262#M39238</link>
      <description>&lt;P&gt;I think SAS Studio only shows you the first 50 or 100 records by default, you need to press a button to see the rest of the records?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 21:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/transpose/m-p/798262#M39238</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-23T21:44:00Z</dc:date>
    </item>
  </channel>
</rss>

