<?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 Convert long data to wide in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621711#M182811</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-02-01 at 5.59.59 PM.png" style="width: 380px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35803i6A0CAA1A897A0340/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-02-01 at 5.59.59 PM.png" alt="Screen Shot 2020-02-01 at 5.59.59 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I originally have that and i wanted to change the format so it would look like this for example:&lt;/P&gt;&lt;P&gt;Observation&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XML&amp;nbsp; &amp;nbsp; &amp;nbsp; ZIP&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 35&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 97&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;44&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;190&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this code:&lt;/P&gt;&lt;P&gt;proc transpose&lt;BR /&gt;data = my_data&lt;BR /&gt;out = diff_columns_data;&lt;BR /&gt;by exec_type;&lt;BR /&gt;var input_type;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my result looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-02-01 at 6.05.37 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35804i4A663799271F2D35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-02-01 at 6.05.37 PM.png" alt="Screen Shot 2020-02-01 at 6.05.37 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated! Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 01 Feb 2020 23:08:12 GMT</pubDate>
    <dc:creator>angelicamagpan0</dc:creator>
    <dc:date>2020-02-01T23:08:12Z</dc:date>
    <item>
      <title>Convert long data to wide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621711#M182811</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-02-01 at 5.59.59 PM.png" style="width: 380px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35803i6A0CAA1A897A0340/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-02-01 at 5.59.59 PM.png" alt="Screen Shot 2020-02-01 at 5.59.59 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I originally have that and i wanted to change the format so it would look like this for example:&lt;/P&gt;&lt;P&gt;Observation&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XML&amp;nbsp; &amp;nbsp; &amp;nbsp; ZIP&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 35&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 97&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;44&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;190&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this code:&lt;/P&gt;&lt;P&gt;proc transpose&lt;BR /&gt;data = my_data&lt;BR /&gt;out = diff_columns_data;&lt;BR /&gt;by exec_type;&lt;BR /&gt;var input_type;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my result looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-02-01 at 6.05.37 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35804i4A663799271F2D35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-02-01 at 6.05.37 PM.png" alt="Screen Shot 2020-02-01 at 6.05.37 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated! Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2020 23:08:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621711#M182811</guid>
      <dc:creator>angelicamagpan0</dc:creator>
      <dc:date>2020-02-01T23:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert long data to wide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621713#M182812</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input type $	exec_time;
cards;
xml	35
xml	97
xml	110
xml	250
xml	190
xml	110
xml	600
zip	10
zip	44
zip	65
zip	77
zip	43
zip	44
;

data temp;
 set have;
 by type;
 if first.type then n=0;
  n+1;
run;

proc sort data=temp;
by n;
run;

proc transpose data=temp out=want;
by n;
var exec_time;
id type;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Feb 2020 23:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621713#M182812</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-02-01T23:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert long data to wide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621734#M182824</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge
  have (
    rename=(exec_time=xml)
    where=(input_type = "xml")
  )
  have (
    rename=(exec_time=zip)
    where=(input_type = "zip")
  )
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 02 Feb 2020 07:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621734#M182824</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-02T07:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert long data to wide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621851#M182878</link>
      <description>&lt;P&gt;Try double-transpose: (1) transpose by type, (2) by _name_:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input type $ exec_time;
cards;
xml 35
xml 97
xml 110
xml 250
xml 190
xml 110
xml 600
zip 10
zip 44
zip 65
zip 77
zip 43
zip 44
;
run;

proc transpose data=have out=have_trx;
by type;
var exec_time;
run;

proc transpose data=have_trx out=want(drop=_name_);
by _name_;
id type;
var col:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 03:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-long-data-to-wide/m-p/621851#M182878</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-02-03T03:58:44Z</dc:date>
    </item>
  </channel>
</rss>

