<?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: Suggestions on how to make my code more efficient in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629202#M186036</link>
    <description>That works! Thank you!</description>
    <pubDate>Tue, 03 Mar 2020 18:02:03 GMT</pubDate>
    <dc:creator>luvscandy27</dc:creator>
    <dc:date>2020-03-03T18:02:03Z</dc:date>
    <item>
      <title>Suggestions on how to make my code more efficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629173#M186028</link>
      <description>&lt;P&gt;I have data like below:&lt;/P&gt;
&lt;P&gt;Incomplete Incomplete_pct Stalled Stalled_pct Unbegun Unbegun_pct Complete Complete_pct&lt;BR /&gt;19751&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.24179&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 37591&amp;nbsp; &amp;nbsp;6.16992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;146644 24.06911&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 405276&amp;nbsp; &amp;nbsp; &amp;nbsp; 66.51916&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;But I would like for my data to look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;STATUS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COUNT PERCENT &lt;BR /&gt;Incomplete&amp;nbsp; &amp;nbsp;19751&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.2&lt;BR /&gt;Stalled&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 37591&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6.2&lt;BR /&gt;Unbegun&amp;nbsp; &amp;nbsp; &amp;nbsp;146644&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24.1&lt;BR /&gt;Complete&amp;nbsp; &amp;nbsp; &amp;nbsp;405276&amp;nbsp; &amp;nbsp; &amp;nbsp; 66.5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to create the table I want using the code below. My question is I feel &lt;BR /&gt;there should be an easier way. Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data = test1 out = test2 (rename=col1=COUNTS _name_ =STATUS));&lt;BR /&gt;var incomplete stalled unbegun complete; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc transpose data = test1 out = test3 (rename=col1=PERCENT _name_ =STATUS_2));&lt;BR /&gt;var incomplete_pct stalled_pct unbegun_pct complete_pct; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data combine; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;merge test2 test3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;format counts comma8.0 percent 8.1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 16:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629173#M186028</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2020-03-03T16:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Suggestions on how to make my code more efficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629177#M186030</link>
      <description>&lt;P&gt;Why try to fix the data after the fact?&amp;nbsp; Why not go back to the original program that created the data in the wrong format and fix that original program so it generates data in the proper format?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 16:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629177#M186030</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-03-03T16:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Suggestions on how to make my code more efficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629194#M186033</link>
      <description>&lt;P&gt;Whether it is easier or not but another way is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   array c Incomplete Stalled Unbegun Complete;
   array r Incomplete_pct Stalled_pct Unbegun_pct Complete_pct;
   length status $ 10;
   do i= 1 to dim(c);
      status = vname(c[i]);
      count  = c[i];
      percent= r[i];
      output;
   end;
   keep status count percent;
run;&lt;/PRE&gt;
&lt;P&gt;Which might be preferred if there were additional variables, such as identifiers from the starting records that you would want on each&amp;nbsp; output record. Just add those to the Keep statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 17:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629194#M186033</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-03T17:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Suggestions on how to make my code more efficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629202#M186036</link>
      <description>That works! Thank you!</description>
      <pubDate>Tue, 03 Mar 2020 18:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suggestions-on-how-to-make-my-code-more-efficient/m-p/629202#M186036</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2020-03-03T18:02:03Z</dc:date>
    </item>
  </channel>
</rss>

