<?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: Can some one try it in arrays I have done in proc transpose method.. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413085#M67440</link>
    <description>&lt;P&gt;Another good resource is this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2017 21:36:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-11-13T21:36:38Z</dc:date>
    <item>
      <title>Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413064#M67436</link>
      <description>&lt;P&gt;Can some one try it in arrays I have done in proc transpose method..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input id name$ gtype$ grade;&lt;BR /&gt;cards;&lt;BR /&gt;10 aa e 70&lt;BR /&gt;10 aa f 80&lt;BR /&gt;10 aa g 90&lt;BR /&gt;10 aa h 70&lt;BR /&gt;10 aa i 60&lt;BR /&gt;10 bb g 90&lt;BR /&gt;10 bb h 70&lt;BR /&gt;10 bb i 60&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=want out=want;&lt;/P&gt;&lt;P&gt;by id name;&lt;/P&gt;&lt;P&gt;var grade;&lt;/P&gt;&lt;P&gt;id gtype;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired&amp;nbsp;Output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;transpose the above data by using arrays&lt;/P&gt;&lt;P&gt;/*/*output*/*;&lt;BR /&gt;id name e f g h i&lt;BR /&gt;10 aa 70 80 90 70 60&lt;BR /&gt;10 bb . . 90 70 60&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413064#M67436</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-13T21:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413067#M67437</link>
      <description>&lt;P&gt;I hope this link can help both of us:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paper 082-2013 Sharpening Your Skills in Reshaping data: PROC TRANSPOSE vs. Array Processing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/082-2013.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings13/082-2013.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413067#M67437</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-11-13T21:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413085#M67440</link>
      <description>&lt;P&gt;Another good resource is this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413085#M67440</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T21:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413105#M67442</link>
      <description>&lt;P&gt;For what it's worth, I totally disagree with Art Li's conclusion. In my experience, datasetp array processing is almost ALWAYS faster than proc transpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's why I published a macro a couple of years ago that accomplishes the task that way. Take a look at:&amp;nbsp;&lt;A href="http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset" target="_blank"&gt;http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you download and run that macro, and then run:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
  input name$ gtype$ grade;
  do id=1 to 500000;
    output;
  end;
  cards;
aa e 70
aa f 80
aa g 90
aa h 70
aa i 60
bb g 90
bb h 70
bb i 60
;
run;

proc sort data=have;
  by id name;
run;

proc transpose data=have out=want;
by id name;
var grade;
id gtype;
run;

%transpose(data=have, out=want2, by=id name, var=grade, id=gtype);
&lt;/PRE&gt;
&lt;P&gt;you'll see why I question his conclusion. The disparity increases when one is expanding a wide file (2 or more variables) to be even wider.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 22:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413105#M67442</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-11-13T22:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413117#M67443</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;gt;For what it's worth, I totally disagree with Art Li's conclusion. In my experience, datasetp array processing is almost ALWAYS faster than proc transpose.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Writing a PROC TRANSPOSE is much faster than writing a data step array method.&amp;nbsp;Plus its more dynamic and handles the addition/change of fields more easily. &lt;/SPAN&gt;&lt;SPAN&gt;So if you'll get back those few minutes in&amp;nbsp;processing&amp;nbsp;time it's worth the array, but usually I find that's not&amp;nbsp;the case. &amp;nbsp;The macro does&amp;nbsp;make that a non-issue though.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 23:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413117#M67443</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T23:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413134#M67444</link>
      <description>&lt;P&gt;Not only does the macro approach to using arrays make the extra coding a non issue, when one is transposing a combination of character and numeric variables, or going from wide to wider, the macro approach still only requires a single line of code, while the coding for proc transpose creates a significant issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 00:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413134#M67444</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-11-14T00:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413156#M67446</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp; &amp;nbsp;Hi Art, Thank you for the great insight. I have learned something that I wasn't sure about despite having a copy of your %transpose macro. The macro approach generally seems rather "compiler intensive" while the macro processor does so much work, the other SAS elements sleep in the input stack waiting in queue to go to the compiler. Would there be a potential overhead more than proc transpose? Am i making sense or being silly? Sorry if the latter is the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure if this is from you and Xia Keshan, I suppose the solution must be immaculate. I'm just curious.&lt;/P&gt;&lt;P&gt;Also an idea, why not incorporate the macro as an autocall macro as a part of the other list of autocall macros like %cmpress etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen Srinivasan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 02:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413156#M67446</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-11-14T02:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can some one try it in arrays I have done in proc transpose method..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413178#M67452</link>
      <description>&lt;P&gt;It takes less time to run (besides, for complex transpositions, much, much less time to code), so I can't see how it could be more compiler intensive. It take less cpu and processing time than running proc transpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not intended as a proc transpose replacement, as there are still things one can do with proc transpose that the macro wasn't intended to accomplish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for making it an autocall macro .. that is totally up to the user since any macro can be compiled and stored that way. Take a look at:&amp;nbsp;&lt;A href="http://analytics.ncsu.edu/sesug/2008/SBC-126.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2008/SBC-126.pdf&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 03:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-some-one-try-it-in-arrays-I-have-done-in-proc-transpose/m-p/413178#M67452</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-11-14T03:17:12Z</dc:date>
    </item>
  </channel>
</rss>

