<?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: Proc transpose to show months by ID in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696250#M212630</link>
    <description>&lt;P&gt;thanks, this worked beautifully for the visual. I tried the other two solutions but I still get the same errors I got when trying to transpose so this seems like the best option.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2020 16:29:15 GMT</pubDate>
    <dc:creator>CatM</dc:creator>
    <dc:date>2020-11-03T16:29:15Z</dc:date>
    <item>
      <title>Proc transpose to show months by ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696062#M212519</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been looking for some way to transpose data that contains which months certain individuals participated and how this can be turned into a readable table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the data is currently like this&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Month&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; &amp;nbsp; &amp;nbsp; JUN&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; &amp;nbsp; &amp;nbsp; MAY&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; &amp;nbsp; &amp;nbsp; JUN&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; &amp;nbsp; &amp;nbsp; APR&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; &amp;nbsp; &amp;nbsp; MAY&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; &amp;nbsp; &amp;nbsp; JUL&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; &amp;nbsp; &amp;nbsp; AUG&lt;/P&gt;
&lt;P&gt;04&amp;nbsp; &amp;nbsp; &amp;nbsp; AUG&lt;/P&gt;
&lt;P&gt;04&amp;nbsp; &amp;nbsp; &amp;nbsp; SEP&lt;/P&gt;
&lt;P&gt;04&amp;nbsp; &amp;nbsp; &amp;nbsp; OCT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and i want it to look like this:&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;APR&amp;nbsp; &amp;nbsp; &amp;nbsp;MAY&amp;nbsp; &amp;nbsp; JUN&amp;nbsp; &amp;nbsp; JUL&amp;nbsp; &amp;nbsp; AUG&amp;nbsp; &amp;nbsp; &amp;nbsp;SEP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OCT&lt;/P&gt;
&lt;P&gt;01&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;
&lt;P&gt;04&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; &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; &amp;nbsp; X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this possible with proc transpose or with some other proc in SAS?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 00:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696062#M212519</guid>
      <dc:creator>CatM</dc:creator>
      <dc:date>2020-11-03T00:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose to show months by ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696067#M212522</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input ID $      Month $;
cards;
01      JUN

02      MAY

02      JUN

03      APR

03      MAY

03      JUL

03      AUG

04      AUG

04      SEP

04      OCT
;

data want;
 do until(last.id);
  set have;
  by id;
  array t $ APR     MAY    JUN    JUL    AUG     SEP  OCT;
  array u(7)$ _temporary_ ('APR'   'MAY'   'JUN'  'JUL'  'AUG' 'SEP'  'OCT') ;
  _n_=whichc(month,of u(*));
  if _n_ then t(_n_)='x';
 end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Nov 2020 01:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696067#M212522</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-11-03T01:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose to show months by ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696170#M212598</link>
      <description>&lt;PRE&gt;data have;
input ID $      Month $;
cards;
01      JUN
02      MAY
02      JUN
03      APR
03      MAY
03      JUL
03      AUG
04      AUG
04      SEP
04      OCT
;
data have;
 set have;
 value=1;
run;
proc transpose data=have out=temp(drop=_name_);
by id;
var value;
id month;
run;
proc stdize data=temp out=temp1 missing=0 reponly;
var _numeric_;
run;
data want;
retain ID  APR     MAY    JUN    JUL    AUG     SEP       OCT;
set temp1;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Nov 2020 12:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696170#M212598</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-11-03T12:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose to show months by ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696184#M212605</link>
      <description>&lt;P&gt;What if the data stretches over more than one year?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, add a template for the months:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID $ Month $;
datalines;
01      JUN
02      MAY
02      JUN
03      APR
03      MAY
03      JUL
03      AUG
04      AUG
04      SEP
04      OCT
;

data have2;
if 0 then set have;
if _n_ = 1
then do;
  month = 'JAN';
  output;
  month = 'FEB';
  output;
  month = 'MAR';
  output;
  month = 'APR';
  output;
  month = 'MAY';
  output;
  month = 'JUN';
  output;
  month = 'JUL';
  output;
  month = 'AUG';
  output;
  month = 'SEP';
  output;
  month = 'OCT';
  output;
  month = 'NOV';
  output;
  month = 'DEC';
  output;
end;
value = "X";
set have;
output;
run;

proc transpose
  data=have2
  out=want (drop=_name_ where=(id ne ""))
;
by id;
var value;
id month;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Nov 2020 13:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696184#M212605</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-03T13:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose to show months by ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696250#M212630</link>
      <description>&lt;P&gt;thanks, this worked beautifully for the visual. I tried the other two solutions but I still get the same errors I got when trying to transpose so this seems like the best option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 16:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696250#M212630</guid>
      <dc:creator>CatM</dc:creator>
      <dc:date>2020-11-03T16:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose to show months by ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696253#M212631</link>
      <description>&lt;P&gt;Thanks, this is what I was initially attempting but I keep getting an error either in the BY or ID group that says the value appears more than once in the column of data. not sure if there is a work around or if Proc Transpose just isn't set up for duplicate values to be organized in a table like I would like.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 16:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-to-show-months-by-ID/m-p/696253#M212631</guid>
      <dc:creator>CatM</dc:creator>
      <dc:date>2020-11-03T16:31:26Z</dc:date>
    </item>
  </channel>
</rss>

