<?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: Getting different results with proc transpose in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26674#M6103</link>
    <description>I'm glad my "lead" doesn't snoop around the code I write!</description>
    <pubDate>Thu, 10 Mar 2011 18:06:56 GMT</pubDate>
    <dc:creator>DavidJ</dc:creator>
    <dc:date>2011-03-10T18:06:56Z</dc:date>
    <item>
      <title>Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26668#M6097</link>
      <description>I'm transposing a table that has ID, Year and Name. The data looks like this&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
1 1990 Bob&lt;BR /&gt;
1 1991 Ken&lt;BR /&gt;
1 1997 Cindy&lt;BR /&gt;
1 1998 Will&lt;BR /&gt;
2 1990 Jack&lt;BR /&gt;
2 1991 Frank&lt;BR /&gt;
2 1992 Mindy&lt;BR /&gt;
&lt;BR /&gt;
I was expecting my data to look like this&lt;BR /&gt;
ID 1990   1991   1992   1997     1998&lt;BR /&gt;
1   Bob    Ken               Cindy   Will&lt;BR /&gt;
2   Jack   Frank    Mindy&lt;BR /&gt;
&lt;BR /&gt;
But what is happening is that it comes out like this&lt;BR /&gt;
ID 1990 1991 1997 1998 1992 &lt;BR /&gt;
1  Bob  Ken   Cindy Will        &lt;BR /&gt;
2 Jack Frank                  Mindy&lt;BR /&gt;
&lt;BR /&gt;
I'm guessing since my first id doesn't have all the years that is why this happens.  What is the best way to get around this issue and have the years display in the correct order?&lt;BR /&gt;
&lt;BR /&gt;
Thank you</description>
      <pubDate>Thu, 10 Mar 2011 15:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26668#M6097</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-03-10T15:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26669#M6098</link>
      <description>Hello Jerry,&lt;BR /&gt;
&lt;BR /&gt;
The easiest is to use RETAIN berfore SET on the result dataset:&lt;BR /&gt;
[pre]data i;&lt;BR /&gt;
  input ID Year Name $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 1990 Bob&lt;BR /&gt;
1 1991 Ken&lt;BR /&gt;
1 1997 Cindy&lt;BR /&gt;
1 1998 Will&lt;BR /&gt;
2 1990 Jack&lt;BR /&gt;
2 1991 Frank&lt;BR /&gt;
2 1992 Mindy&lt;BR /&gt;
run;&lt;BR /&gt;
proc transpose data=i out=t prefix=y;&lt;BR /&gt;
  id year;&lt;BR /&gt;
  var Name;&lt;BR /&gt;
  by id;&lt;BR /&gt;
run;&lt;BR /&gt;
data t;&lt;BR /&gt;
  retain ID y1990-y1998;&lt;BR /&gt;
  set t;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Thu, 10 Mar 2011 15:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26669#M6098</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-10T15:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26670#M6099</link>
      <description>SPR,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply.  Isn't there a way to do it within the proc transpose?&lt;BR /&gt;
I'm trying to do it in the least amount of data sets.  The lead here gets mad if there is extra steps.&lt;BR /&gt;
&lt;BR /&gt;
Thank you again it is appreciated&lt;BR /&gt;
&lt;BR /&gt;
Jerry</description>
      <pubDate>Thu, 10 Mar 2011 15:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26670#M6099</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-03-10T15:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26671#M6100</link>
      <description>Jerry,&lt;BR /&gt;
&lt;BR /&gt;
It is impossible to do it with proc TRANSPOSE. Other possible solution could be to add and odservation having Year=1992 and Nane=" " to the input dataset. However, this is still additional step. (:-) &lt;BR /&gt;
&lt;BR /&gt;
SPR</description>
      <pubDate>Thu, 10 Mar 2011 15:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26671#M6100</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-10T15:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26672#M6101</link>
      <description>&amp;gt; SPR,&lt;BR /&gt;
&amp;gt; I'm trying to do it in the least amount of data sets.&lt;BR /&gt;
&amp;gt;  The lead here gets mad if there is extra steps.&lt;BR /&gt;
&lt;BR /&gt;
Your "lead" may need to learn more SAS.  This is an extra unneeded step.&lt;BR /&gt;
[pre]&lt;BR /&gt;
data class;&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc sort;&lt;BR /&gt;
   by sex;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Where you would just as easily and more efficiently.&lt;BR /&gt;
[/pre]proc sort data=sashelp.class out=class;[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
As mentioned PROC TRANSPOSE will create the variables as they are encountered.  Also mentioned to make the program data driven I would do something like this.  There are no extra steps to achieve the desired result.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data test;&lt;BR /&gt;
   input id:$1. year name:$8.;&lt;BR /&gt;
   cards;&lt;BR /&gt;
1 1990 Bob&lt;BR /&gt;
1 1991 Ken&lt;BR /&gt;
1 1997 Cindy&lt;BR /&gt;
1 1998 Will&lt;BR /&gt;
2 1990 Jack&lt;BR /&gt;
2 1991 Frank&lt;BR /&gt;
2 1992 Mindy&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc summary data=test nway;&lt;BR /&gt;
   class year;&lt;BR /&gt;
   output out=year(drop=_:);&lt;BR /&gt;
   run;&lt;BR /&gt;
data testV / view=testV;&lt;BR /&gt;
   set year test;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc transpose prefix=y data=testV out=wide(where=(not missing(id)));&lt;BR /&gt;
   by id;&lt;BR /&gt;
   var name;&lt;BR /&gt;
   id year;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
Obs    id    _NAME_    y1990    y1991    y1992    y1997    y1998&lt;BR /&gt;
&lt;BR /&gt;
 1     1      name     Bob      Ken               Cindy    Will&lt;BR /&gt;
 2     2      name     Jack     Frank    Mindy&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 10 Mar 2011 17:22:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26672#M6101</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-10T17:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26673#M6102</link>
      <description>SPR &amp;amp; data _null_,&lt;BR /&gt;
&lt;BR /&gt;
Thank you both for all the help.  I was able to use what you both provided to take care of this issue.  If he has any problems with the way I do it I will have him show me a better way.  LOL&lt;BR /&gt;
&lt;BR /&gt;
Thank you again&lt;BR /&gt;
&lt;BR /&gt;
Jerry</description>
      <pubDate>Thu, 10 Mar 2011 17:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26673#M6102</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-03-10T17:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26674#M6103</link>
      <description>I'm glad my "lead" doesn't snoop around the code I write!</description>
      <pubDate>Thu, 10 Mar 2011 18:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26674#M6103</guid>
      <dc:creator>DavidJ</dc:creator>
      <dc:date>2011-03-10T18:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26675#M6104</link>
      <description>Hi:&lt;BR /&gt;
  An alternate approach (just for something completely different). Using ACROSS items with PROC REPORT can result in something akin to what you get with TRANSPOSE. The difference is that other approaches do not require you to know the year values ahead of time, but if you are going to use RENAME with PROC REPORT, you would either need to know the values ahead of time or "macroize" the solution.&lt;BR /&gt;
 &lt;BR /&gt;
  Using COMPLETECOLS with PRELOADFMT allows you to create "empty" columns for the years 1993-1996 that are not in the data (see #2) if that would be desired.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data names;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input ID year name $;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 1990 Bob&lt;BR /&gt;
1 1991 Ken&lt;BR /&gt;
1 1997 Cindy&lt;BR /&gt;
1 1998 Will&lt;BR /&gt;
2 1990 Jack&lt;BR /&gt;
2 1991 Frank&lt;BR /&gt;
2 1992 Mindy&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
            &lt;BR /&gt;
options nocenter ls=125;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=names;&lt;BR /&gt;
  title 'Before PROC REPORT';&lt;BR /&gt;
run;&lt;BR /&gt;
             &lt;BR /&gt;
** 1) Use PROC REPORT to get output dataset with only the years in the data;&lt;BR /&gt;
proc report data=names nowd&lt;BR /&gt;
     out=work.yearout(rename=(_c2_=yr1990 _c3_=yr1991 _c4_=yr1992 _c5_=yr1997 _c6_=yr1998 n=numyr ) &lt;BR /&gt;
                      drop=_break_);&lt;BR /&gt;
  title '1) PROC REPORT #1 creates work.yearout';&lt;BR /&gt;
  column ID year,name n;&lt;BR /&gt;
  define id /group;&lt;BR /&gt;
  define year /across;&lt;BR /&gt;
  define name/display ' ';&lt;BR /&gt;
  define n / 'Count' noprint;&lt;BR /&gt;
run;&lt;BR /&gt;
           &lt;BR /&gt;
proc print data=yearout;&lt;BR /&gt;
  title '1) YEAROUT data from PROC REPORT';&lt;BR /&gt;
run;&lt;BR /&gt;
                        &lt;BR /&gt;
** 2) Get all years between 1990 and 1998 using PROC REPORT;&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value wantyr&lt;BR /&gt;
    1990='1990'&lt;BR /&gt;
    1991='1991'&lt;BR /&gt;
    1992='1992'&lt;BR /&gt;
    1993='1993'&lt;BR /&gt;
    1994='1994'&lt;BR /&gt;
    1995='1995'&lt;BR /&gt;
    1996='1996'&lt;BR /&gt;
    1997='1997'&lt;BR /&gt;
    1998='1998';&lt;BR /&gt;
run;&lt;BR /&gt;
                           &lt;BR /&gt;
proc report data=names nowd completecols&lt;BR /&gt;
     out=work.allyears(&lt;BR /&gt;
       rename=(_c2_=yr1990 _c3_=yr1991 _c4_=yr1992 _c5_=yr1993 _c6_=yr1994 _c7_=yr1995 _c8_=yr1996 _c9_=yr1997 _c10_=yr1998 n=numyr ) &lt;BR /&gt;
       drop=_break_  );&lt;BR /&gt;
  title '2) PROC REPORT #2 creates work.allyears';&lt;BR /&gt;
  column ID year,name n;&lt;BR /&gt;
  define id /group;&lt;BR /&gt;
  define year /across preloadfmt f=wantyr.;&lt;BR /&gt;
  define name/display ' ';&lt;BR /&gt;
  define n / 'Count' noprint;&lt;BR /&gt;
run;&lt;BR /&gt;
                 &lt;BR /&gt;
proc print data=allyears;&lt;BR /&gt;
  title '2) ALLYEARS data from PROC REPORT';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 10 Mar 2011 18:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26675#M6104</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-03-10T18:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26676#M6105</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
if you like data steps you can use a proc sql-data step solution:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
*consecutive years;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
	select cats('yr',min(year)), cats('yr',max(year)),min(year),max(year)  into :yr_min, :yr_max, :lb, :hb separated by ' ' from names;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data want;&lt;BR /&gt;
&lt;BR /&gt;
do until(last.id);&lt;BR /&gt;
set names;&lt;BR /&gt;
by id;&lt;BR /&gt;
&lt;BR /&gt;
array yr{&amp;amp;lb:&amp;amp;hb} $ 12  &amp;amp;yr_min-&amp;amp;yr_max;&lt;BR /&gt;
yr{year}=name;&lt;BR /&gt;
&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
drop year name;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
*Universal;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
	select cats('yr', years) into :all_y separated by ' ' from (select distinct(year) as years from names)&lt;BR /&gt;
	order by years ;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
data want1;&lt;BR /&gt;
&lt;BR /&gt;
do until(last.id);&lt;BR /&gt;
set names;&lt;BR /&gt;
by id;&lt;BR /&gt;
&lt;BR /&gt;
z=countw(substr("&amp;amp;all_y",1,findw("&amp;amp;all_y",cats('yr',year))+5));&lt;BR /&gt;
&lt;BR /&gt;
array yr{*} $ 12  &amp;amp;all_y;&lt;BR /&gt;
yr{z}=name;&lt;BR /&gt;
&lt;BR /&gt;
end;&lt;BR /&gt;
drop year name z;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Marius</description>
      <pubDate>Mon, 14 Mar 2011 22:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26676#M6105</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-14T22:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting different results with proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26677#M6106</link>
      <description>Hi.&lt;BR /&gt;
I looked so many replys ,So I also think it for a while.&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="Section1" style=""&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;data&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; i;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;BR /&gt;
ID Year Name $;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;1 1990 Bob&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;1 1991 Ken&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;1 1997 Cindy&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;1 1998 Will&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;2 1990 Jack&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;2 1991 Frank&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;2 1992 Mindy&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;sort&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;=i;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; id year;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;sql&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;BR /&gt;
temp &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;BR /&gt;
id,year&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; id &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;BR /&gt;
&lt;BR /&gt;
i),(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;BR /&gt;
year &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; i)&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;order&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; id,year;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;quit&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;data&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; _temp;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;merge&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; i temp;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; id year;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;transpose&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;=_temp &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;=result(drop=_name_) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;prefix&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;=_;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; id;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;id&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; year;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;&lt;SPAN style=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; name;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp&lt;BR /&gt;
[/pre]

Message was edited by: Ksharp</description>
      <pubDate>Tue, 15 Mar 2011 05:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-different-results-with-proc-transpose/m-p/26677#M6106</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-15T05:25:51Z</dc:date>
    </item>
  </channel>
</rss>

