<?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 converting vertical data into horizantal data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514213#M138650</link>
    <description>&lt;P&gt;This is the Data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data one;&lt;BR /&gt;input ID Act$ Section$;&lt;BR /&gt;datalines;&lt;BR /&gt;1 a1 s1&lt;BR /&gt;1 a1 s1&lt;BR /&gt;1 a2 s3&lt;BR /&gt;2 a1 s1&lt;BR /&gt;2 a1 s2&lt;BR /&gt;2 a1 s3&lt;BR /&gt;2 a3 s4&lt;BR /&gt;2 a4 s5&lt;BR /&gt;3 a1 s1&lt;BR /&gt;3 a1 s2&lt;BR /&gt;3 a1 s3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want this output.&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; Act_section&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1 a2&amp;nbsp; under/section: s1ss2,s3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1 a3 a4&amp;nbsp; under/section s1 s2 s3 s4 s5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1 under/section s1 s2 s3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Nov 2018 10:06:25 GMT</pubDate>
    <dc:creator>Ishwarkumar</dc:creator>
    <dc:date>2018-11-18T10:06:25Z</dc:date>
    <item>
      <title>converting vertical data into horizantal data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514213#M138650</link>
      <description>&lt;P&gt;This is the Data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data one;&lt;BR /&gt;input ID Act$ Section$;&lt;BR /&gt;datalines;&lt;BR /&gt;1 a1 s1&lt;BR /&gt;1 a1 s1&lt;BR /&gt;1 a2 s3&lt;BR /&gt;2 a1 s1&lt;BR /&gt;2 a1 s2&lt;BR /&gt;2 a1 s3&lt;BR /&gt;2 a3 s4&lt;BR /&gt;2 a4 s5&lt;BR /&gt;3 a1 s1&lt;BR /&gt;3 a1 s2&lt;BR /&gt;3 a1 s3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want this output.&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; Act_section&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1 a2&amp;nbsp; under/section: s1ss2,s3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1 a3 a4&amp;nbsp; under/section s1 s2 s3 s4 s5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1 under/section s1 s2 s3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 10:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514213#M138650</guid>
      <dc:creator>Ishwarkumar</dc:creator>
      <dc:date>2018-11-18T10:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: converting vertical data into horizantal data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514214#M138651</link>
      <description>&lt;P&gt;I think that you can try 'proc transpose' or use first and last statement by ID&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 10:11:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514214#M138651</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2018-11-18T10:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: converting vertical data into horizantal data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514223#M138656</link>
      <description>&lt;P&gt;What is the logic here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And why do you want the wide format?&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 10:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514223#M138656</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-18T10:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: converting vertical data into horizantal data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514225#M138657</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input ID Act$ Section$;
datalines;
1 a1 s1
1 a1 s2
1 a2 s3
2 a1 s1
2 a1 s2
2 a1 s3
2 a3 s4
2 a4 s5
3 a1 s1
3 a1 s2
3 a1 s3
;
run;

data want;
 set one ;
 by id;
 length a b $ 200;
 retain a b;
 if first.id then call missing(a,b);
 if not findw(a,strip(act)) then a=catx(' ',a,act);
 if not findw(b,strip(section)) then b=catx(' ',b,section);
 if last.id then do;act_session=catx(' ',a,'under/section:',b);output;end;
drop a b act section;
run;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Nov 2018 11:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-vertical-data-into-horizantal-data/m-p/514225#M138657</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-11-18T11:10:33Z</dc:date>
    </item>
  </channel>
</rss>

