<?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 Hi Need to Transpose and add labels from an existing variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/694916#M211983</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been struggling with this for a couple days, so hope somebody out there has done this before.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that is currently vertical, and I want to transpose it to be horizontal.&amp;nbsp; That's no problem with PROC TRANSPOSE.&amp;nbsp; The tricky part is that after the data is transposed, I need to assign labels to the new variables from a field that existed in the initial data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have something like this:&lt;/P&gt;&lt;P&gt;variable_name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;field_label&lt;/P&gt;&lt;P&gt;INV&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physician&lt;/P&gt;&lt;P&gt;INST&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Institution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have transposed the dataset to this:&lt;/P&gt;&lt;P&gt;INV&amp;nbsp; &amp;nbsp; &amp;nbsp; INST&lt;/P&gt;&lt;P&gt;Dr Joe&amp;nbsp; Hospital1&lt;/P&gt;&lt;P&gt;Dr Jane Hospital2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am not sure how to do is assign the values from field_label to the INV and INST variables after the transpose.&amp;nbsp; &amp;nbsp; I have 397 rows in the intial dataset, and it can change in the future, so I really want to be able to do this dynamically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 15:48:14 GMT</pubDate>
    <dc:creator>biglerc</dc:creator>
    <dc:date>2020-10-28T15:48:14Z</dc:date>
    <item>
      <title>Hi Need to Transpose and add labels from an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/694916#M211983</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been struggling with this for a couple days, so hope somebody out there has done this before.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that is currently vertical, and I want to transpose it to be horizontal.&amp;nbsp; That's no problem with PROC TRANSPOSE.&amp;nbsp; The tricky part is that after the data is transposed, I need to assign labels to the new variables from a field that existed in the initial data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have something like this:&lt;/P&gt;&lt;P&gt;variable_name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;field_label&lt;/P&gt;&lt;P&gt;INV&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physician&lt;/P&gt;&lt;P&gt;INST&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Institution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have transposed the dataset to this:&lt;/P&gt;&lt;P&gt;INV&amp;nbsp; &amp;nbsp; &amp;nbsp; INST&lt;/P&gt;&lt;P&gt;Dr Joe&amp;nbsp; Hospital1&lt;/P&gt;&lt;P&gt;Dr Jane Hospital2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am not sure how to do is assign the values from field_label to the INV and INST variables after the transpose.&amp;nbsp; &amp;nbsp; I have 397 rows in the intial dataset, and it can change in the future, so I really want to be able to do this dynamically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 15:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/694916#M211983</guid>
      <dc:creator>biglerc</dc:creator>
      <dc:date>2020-10-28T15:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Need to Transpose and add labels from an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/694921#M211986</link>
      <description>&lt;P&gt;IDLABEL &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=proc&amp;amp;docsetTarget=p1baki8ibq833kn1r8vbnrvyv5x8.htm&amp;amp;locale=en" target="_self"&gt;option&lt;/A&gt; in PROC TRANSPOSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=.....;
...
idlabel field_label;
...
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/272683"&gt;@biglerc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been struggling with this for a couple days, so hope somebody out there has done this before.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset that is currently vertical, and I want to transpose it to be horizontal.&amp;nbsp; That's no problem with PROC TRANSPOSE.&amp;nbsp; The tricky part is that after the data is transposed, I need to assign labels to the new variables from a field that existed in the initial data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I have something like this:&lt;/P&gt;
&lt;P&gt;variable_name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;field_label&lt;/P&gt;
&lt;P&gt;INV&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Physician&lt;/P&gt;
&lt;P&gt;INST&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Institution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have transposed the dataset to this:&lt;/P&gt;
&lt;P&gt;INV&amp;nbsp; &amp;nbsp; &amp;nbsp; INST&lt;/P&gt;
&lt;P&gt;Dr Joe&amp;nbsp; Hospital1&lt;/P&gt;
&lt;P&gt;Dr Jane Hospital2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am not sure how to do is assign the values from field_label to the INV and INST variables after the transpose.&amp;nbsp; &amp;nbsp; I have 397 rows in the intial dataset, and it can change in the future, so I really want to be able to do this dynamically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 15:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/694921#M211986</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-28T15:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Need to Transpose and add labels from an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/726546#M225765</link>
      <description>Thank you so much, Reeza! Sorry for my delay in replying!</description>
      <pubDate>Mon, 15 Mar 2021 21:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-Need-to-Transpose-and-add-labels-from-an-existing-variable/m-p/726546#M225765</guid>
      <dc:creator>biglerc</dc:creator>
      <dc:date>2021-03-15T21:19:51Z</dc:date>
    </item>
  </channel>
</rss>

