<?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 Need Help to arrange data without Proc transpose in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174670#M44862</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My data is in this shape:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 amit 36&amp;nbsp; physics&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;1 nitu 28&amp;nbsp; chemistry&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 ketu 28 biology&lt;/P&gt;&lt;P&gt;2 amit 98&lt;/P&gt;&lt;P&gt;2 nitu 78&lt;/P&gt;&lt;P&gt;2 ketu 28&lt;/P&gt;&lt;P&gt;3 amit 74&lt;/P&gt;&lt;P&gt;3 nitu 93&lt;/P&gt;&lt;P&gt;3 ketu 92&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to transpose it to below shape without using proc transpose.&lt;/P&gt;&lt;P&gt;the output should look like &lt;/P&gt;&lt;P&gt;1 amit 36 98 74&lt;/P&gt;&lt;P&gt;2 nitu 28 78 93&lt;/P&gt;&lt;P&gt;3 ketu 28 28 92&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to use any hard coding in this e.g. in arrays statement i don't want to mention the subject names physics chemistry biology and array elements should also be computed in macros only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jul 2014 10:47:08 GMT</pubDate>
    <dc:creator>PuneetSingh</dc:creator>
    <dc:date>2014-07-10T10:47:08Z</dc:date>
    <item>
      <title>Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174670#M44862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My data is in this shape:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 amit 36&amp;nbsp; physics&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;1 nitu 28&amp;nbsp; chemistry&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 ketu 28 biology&lt;/P&gt;&lt;P&gt;2 amit 98&lt;/P&gt;&lt;P&gt;2 nitu 78&lt;/P&gt;&lt;P&gt;2 ketu 28&lt;/P&gt;&lt;P&gt;3 amit 74&lt;/P&gt;&lt;P&gt;3 nitu 93&lt;/P&gt;&lt;P&gt;3 ketu 92&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to transpose it to below shape without using proc transpose.&lt;/P&gt;&lt;P&gt;the output should look like &lt;/P&gt;&lt;P&gt;1 amit 36 98 74&lt;/P&gt;&lt;P&gt;2 nitu 28 78 93&lt;/P&gt;&lt;P&gt;3 ketu 28 28 92&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to use any hard coding in this e.g. in arrays statement i don't want to mention the subject names physics chemistry biology and array elements should also be computed in macros only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 10:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174670#M44862</guid>
      <dc:creator>PuneetSingh</dc:creator>
      <dc:date>2014-07-10T10:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174671#M44863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had some questions, firstly why do you not want to use a function designed specifically to do the task you are requesting to do?&amp;nbsp; The only other real option is arrays.&amp;nbsp; You could generate the required array parameters:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(col1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :NUMOPTS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by name col1;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array results{&amp;amp;NUMOPTS.} best.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.name then id=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else id=id+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results{I}=col3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last.name then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 10:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174671#M44863</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-10T10:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174672#M44864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your prompt reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i wrote &lt;/P&gt;&lt;P&gt;results{} = col3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last.name then output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;gave wrong results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as i am not able to understand &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;results{I}=col3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;{I}whats this please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 11:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174672#M44864</guid>
      <dc:creator>PuneetSingh</dc:creator>
      <dc:date>2014-07-10T11:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174673#M44865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I is an incrementor.&amp;nbsp; So the first result you want to put in {1} slot 1 in your array, then next result to slot{2} etc. we use the variable I and add one to that each time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 12:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174673#M44865</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-10T12:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174674#M44866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming that the first column indicates the order that you want the values in the array for that student then you could do this, but PROC TRANSPOSE would do the exact same thing a lot easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cards &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; index name $ result class &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 amit 36&amp;nbsp; physics&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 nitu 28&amp;nbsp; chemistry&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 ketu 28 biology&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2 amit 98&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2 nitu 78&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2 ketu 28&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;3 amit 74&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;3 nitu 93&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;3 ketu 92&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; name index ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; max(index) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; :max &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; score(&amp;amp;max);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(last.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; score(index)=result;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; index result class ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 12:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174674#M44866</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-10T12:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174675#M44867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for this, works wonderfully for my problem.&lt;/P&gt;&lt;P&gt;Though i wasn't able to understand the following: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. two set statements and &lt;/P&gt;&lt;P&gt;2. &lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;score(&lt;STRONG&gt;index&lt;/STRONG&gt;)=result;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;3, if 0 then set (is it refering to _n_?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;thanks so much for the help and if i can understand the way code is executing it would be awesome help. thanks in advance.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 06:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174675#M44867</guid>
      <dc:creator>PuneetSingh</dc:creator>
      <dc:date>2014-07-11T06:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174676#M44868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The extra set statement is a method to insure that NAME is define first. The condition 0 is always false so it is never executed, but SAS will define the variables referenced in the set statement.&amp;nbsp; It is not actually needed, but if you remove it then you should move the ARRAY statement until after the real SET statement to prevent the new SCORExx variables from appearing in the data set before the NAME variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCORE(INDEX)=RESULT is just a normal assignment statement using an array reference.&amp;nbsp; The variable INDEX is used as the index into the array. So if INDEX=1 then the value from RESULT will be placed into SCORE1.&amp;nbsp; Note that because the SET statement is nested inside of the DO loop we do not need to retain the values of the variables SCORE1-SCORE3 that make up the array because we read all of the records from the source in a single iteration of the data step.&amp;nbsp; It also means that we do not have to clear them when we start and new NAME as the data step iteration will clear them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;(last.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; score(&amp;amp;max);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; score(index)=result;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; index result class ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 11:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174676#M44868</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-11T11:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to arrange data without Proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174677#M44869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this one. Or if you are interested about tranposing data by DATA STEP. Refer to the paper of Arthur.T and me .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/538-2013.pdf"&gt;http://support.sas.com/resources/papers/proceedings13/538-2013.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have ;
&amp;nbsp; infile cards truncover ;
&amp;nbsp; input index name $ result class $20.;
cards;
1 amit 36&amp;nbsp; physics
1 nitu 28&amp;nbsp; chemistry
1 ketu 28 biology
2 amit 98 physics
2 nitu 78 chemistry
2 ketu 28 biology
3 amit 74 physics
3 nitu 93 chemistry
3 ketu 92 biology
;
run;

proc sql;
select distinct catt('have(where=(index=',index,' and&amp;nbsp; class="',class,'") rename=(result=_',index,'))')&amp;nbsp; into : list separated by ' ' from have;
quit;
data want(drop=class index);
 merge &amp;amp;list ;
 by name class;
 n+1;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 13:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-to-arrange-data-without-Proc-transpose/m-p/174677#M44869</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-07-11T13:58:04Z</dc:date>
    </item>
  </channel>
</rss>

