<?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: horizontal to vertical in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676576#M23719</link>
    <description>the solution is missing years.&lt;BR /&gt;&lt;BR /&gt;can you please include years also in the code and rewrite the code again</description>
    <pubDate>Thu, 13 Aug 2020 18:39:14 GMT</pubDate>
    <dc:creator>Raj00007</dc:creator>
    <dc:date>2020-08-13T18:39:14Z</dc:date>
    <item>
      <title>horizontal to vertical</title>
      <link>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676567#M23715</link>
      <description>&lt;P&gt;i have this data,&lt;/P&gt;&lt;P&gt;2001 WALKING AEROBICS TENNIS&lt;BR /&gt;2002 FOOTBALL BASKETBALL TENNIS&lt;BR /&gt;2003 AEROBICS SWIMMING CYCLING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i need to convert it to like this, how?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs Id Pref Sports&lt;BR /&gt;1 2001 1 WALKING&lt;BR /&gt;2 2001 2 AEROBICS&lt;BR /&gt;3 2001 3 TENNIS&lt;BR /&gt;4 2002 1 FOOTBALL&lt;BR /&gt;5 2002 2 BASKETBA&lt;BR /&gt;6 2002 3 TENNIS&lt;BR /&gt;7 2003 1 AEROBICS&lt;BR /&gt;8 2003 2 SWIMMING&lt;BR /&gt;9 2003 3 CYCLING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it something to do with looping, arrays or proc transpose?.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please show&amp;nbsp; me code. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 17:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676567#M23715</guid>
      <dc:creator>Raj00007</dc:creator>
      <dc:date>2020-08-13T17:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: horizontal to vertical</title>
      <link>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676570#M23717</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input year sports_list &amp;amp; $50.;
cards;
2001 WALKING AEROBICS TENNIS
2002 FOOTBALL BASKETBALL TENNIS
2003 AEROBICS SWIMMING CYCLING
;

data want;
 set have;
 do Pref=1 to countw(sports_list);
  sports=scan(sports_list,pref);
  output;
 end;
 keep pref sports;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;/*OR*/&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input year (sports1-sports3) (:$30.);
cards;
2001 WALKING AEROBICS TENNIS
2002 FOOTBALL BASKETBALL TENNIS
2003 AEROBICS SWIMMING CYCLING
;

data want;
 set have;
 array t sports1-sports3;
 do Pref=1 to dim(t);
  sports=t(pref);
  output;
 end;
 keep pref sports;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 18:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676570#M23717</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-08-13T18:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: horizontal to vertical</title>
      <link>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676576#M23719</link>
      <description>the solution is missing years.&lt;BR /&gt;&lt;BR /&gt;can you please include years also in the code and rewrite the code again</description>
      <pubDate>Thu, 13 Aug 2020 18:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676576#M23719</guid>
      <dc:creator>Raj00007</dc:creator>
      <dc:date>2020-08-13T18:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: horizontal to vertical</title>
      <link>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676578#M23720</link>
      <description>&lt;P&gt;My apologies. Change your &lt;STRONG&gt;keep&lt;/STRONG&gt; statement to-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;keep year pref sports;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Aug 2020 18:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/horizontal-to-vertical/m-p/676578#M23720</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-08-13T18:45:57Z</dc:date>
    </item>
  </channel>
</rss>

