<?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 Proc Transpose, can anyone help? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72019#M20835</link>
    <description>Staff_id    Product      Pts_Earned&lt;BR /&gt;
182715    EPE          150&lt;BR /&gt;
182825    EASB        22200&lt;BR /&gt;
182825    EIKPA       1056&lt;BR /&gt;
182825    EKD          810&lt;BR /&gt;
182825    EPE         2400&lt;BR /&gt;
182825    ESM        30&lt;BR /&gt;
&lt;BR /&gt;
From the above dataset, i got the following answer.&lt;BR /&gt;
&lt;BR /&gt;
Staff_id  EASB   EIKPA   EKD   EPE   ESM&lt;BR /&gt;
182715  150 &lt;BR /&gt;
182825  22200 1056       810      2400   30&lt;BR /&gt;
&lt;BR /&gt;
What happend to 182715, it supposed to be EPE, not EASB?   &lt;BR /&gt;
&lt;BR /&gt;
Can anyone help?&lt;BR /&gt;
&lt;BR /&gt;
My code:&lt;BR /&gt;
PROC TRANSPOSE DATA=I OUT=TEST(RENAME=(COL1=EASB COL2=EIKPA COL3=EKD COL4=EPE COL5=ESM)) NAME=PRODUCT;&lt;BR /&gt;
&lt;BR /&gt;
BY STAFF_ID;&lt;BR /&gt;
&lt;BR /&gt;
VAR PTS_EARNED;&lt;BR /&gt;
&lt;BR /&gt;
LABEL PRODUCT = 'PRODUCT';&lt;BR /&gt;
&lt;BR /&gt;
RUN;</description>
    <pubDate>Mon, 29 Mar 2010 15:37:47 GMT</pubDate>
    <dc:creator>toffee</dc:creator>
    <dc:date>2010-03-29T15:37:47Z</dc:date>
    <item>
      <title>Proc Transpose, can anyone help?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72019#M20835</link>
      <description>Staff_id    Product      Pts_Earned&lt;BR /&gt;
182715    EPE          150&lt;BR /&gt;
182825    EASB        22200&lt;BR /&gt;
182825    EIKPA       1056&lt;BR /&gt;
182825    EKD          810&lt;BR /&gt;
182825    EPE         2400&lt;BR /&gt;
182825    ESM        30&lt;BR /&gt;
&lt;BR /&gt;
From the above dataset, i got the following answer.&lt;BR /&gt;
&lt;BR /&gt;
Staff_id  EASB   EIKPA   EKD   EPE   ESM&lt;BR /&gt;
182715  150 &lt;BR /&gt;
182825  22200 1056       810      2400   30&lt;BR /&gt;
&lt;BR /&gt;
What happend to 182715, it supposed to be EPE, not EASB?   &lt;BR /&gt;
&lt;BR /&gt;
Can anyone help?&lt;BR /&gt;
&lt;BR /&gt;
My code:&lt;BR /&gt;
PROC TRANSPOSE DATA=I OUT=TEST(RENAME=(COL1=EASB COL2=EIKPA COL3=EKD COL4=EPE COL5=ESM)) NAME=PRODUCT;&lt;BR /&gt;
&lt;BR /&gt;
BY STAFF_ID;&lt;BR /&gt;
&lt;BR /&gt;
VAR PTS_EARNED;&lt;BR /&gt;
&lt;BR /&gt;
LABEL PRODUCT = 'PRODUCT';&lt;BR /&gt;
&lt;BR /&gt;
RUN;</description>
      <pubDate>Mon, 29 Mar 2010 15:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72019#M20835</guid>
      <dc:creator>toffee</dc:creator>
      <dc:date>2010-03-29T15:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose, can anyone help?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72020#M20836</link>
      <description>You are not using the PROC correctly - don't presume that the incoming COLn is "sorted by SAS".  Look to use additional functions to get the desired result.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 29 Mar 2010 15:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72020#M20836</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-29T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose, can anyone help?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72021#M20837</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
If I get your requirement correctly, you can accomplish the desired task using arrays also. &lt;BR /&gt;
Try with this code. check whether you are getting right output or not?&lt;BR /&gt;
&lt;BR /&gt;
data dd;&lt;BR /&gt;
infile datalines;&lt;BR /&gt;
input Staff_id Product $ Pts_Earned;&lt;BR /&gt;
datalines;&lt;BR /&gt;
182715 EPE 150&lt;BR /&gt;
182825 EASB 22200&lt;BR /&gt;
182825 EIKPA 1056&lt;BR /&gt;
182825 EKD 810&lt;BR /&gt;
182825 EPE 2400&lt;BR /&gt;
182825 ESM 30&lt;BR /&gt;
;&lt;BR /&gt;
data dds(drop=product pts_earned);&lt;BR /&gt;
length staff_id 8.;&lt;BR /&gt;
array prd{5} EASB EIKPA EKD EPE ESM;&lt;BR /&gt;
set dd;&lt;BR /&gt;
if product='EPE' then EPE=pts_earned;&lt;BR /&gt;
if product='EASB' then EASB=pts_earned;&lt;BR /&gt;
if product='EIKPA' then EIKPA=pts_earned;&lt;BR /&gt;
if product='EKD' then EKD=pts_earned;&lt;BR /&gt;
if product='ESM' then ESM=pts_earned;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Deendayal Cheni&lt;BR /&gt;
Oracle Corporation (Formerly Sun Microsystems Inc.)</description>
      <pubDate>Mon, 29 Mar 2010 19:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72021#M20837</guid>
      <dc:creator>Deendayal</dc:creator>
      <dc:date>2010-03-29T19:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose, can anyone help?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72022#M20838</link>
      <description>Stick with PROC TRANSPOSE (coded correctly), given the fewer moving parts (code lines) involved.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 29 Mar 2010 20:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72022#M20838</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-29T20:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose, can anyone help?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72023#M20839</link>
      <description>Hi ,&lt;BR /&gt;
&lt;BR /&gt;
You can try this piece of code . It will work correctly.&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=dd ;&lt;BR /&gt;
by staff_id product;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc transpose  data=dd out=dd_tran prefix=product;&lt;BR /&gt;
by staff_id ;&lt;BR /&gt;
var pts_earned;&lt;BR /&gt;
id product;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 31 Mar 2010 11:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-can-anyone-help/m-p/72023#M20839</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-31T11:21:27Z</dc:date>
    </item>
  </channel>
</rss>

