<?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: Proc freq and Transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93537#M19714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's not proc sql that's a datastep which operates differently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Proc SQL, the sum() function adds values over the column, in a datastep it works over a row so 100% makes sense in a datastep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *, totals/sum(totals) as percent&lt;/P&gt;&lt;P&gt;from have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2012 20:10:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-10-12T20:10:01Z</dc:date>
    <item>
      <title>Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93531#M19708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After a 2 way frequency of code and type variables&lt;BR /&gt;TYPE can take the values of C N N/A or Q&lt;BR /&gt;Ex:536 and 537 codes do not have Q&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code&amp;nbsp;&amp;nbsp; type&amp;nbsp;&amp;nbsp; count&amp;nbsp; percent&lt;BR /&gt;532&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.97&lt;BR /&gt;532&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.34&lt;BR /&gt;532&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n/a&amp;nbsp;&amp;nbsp;&amp;nbsp; 305&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 56.90&lt;BR /&gt;532&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.74&lt;BR /&gt;534&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.18&lt;BR /&gt;534&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.55&lt;BR /&gt;534&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.22&lt;BR /&gt;534&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.18&lt;BR /&gt;535&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.55&lt;BR /&gt;535&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.74&lt;BR /&gt;535&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 51&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9.51&lt;BR /&gt;536&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;536&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.18&lt;BR /&gt;536&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&amp;nbsp;&amp;nbsp;&amp;nbsp; 48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.95&lt;BR /&gt;537&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.18&lt;BR /&gt;537&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.18&lt;BR /&gt;537&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.79&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want like shown below but what percentage comes under percent and how to get it there.????????????&lt;BR /&gt;I was told that around 20 percent comes in the first row. How can I get like that...&lt;/P&gt;&lt;P&gt;Also how to get the total variable.....&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt; C&amp;nbsp;&amp;nbsp;&amp;nbsp; Q&amp;nbsp;&amp;nbsp;&amp;nbsp; n&amp;nbsp;&amp;nbsp; n/a&amp;nbsp;&amp;nbsp;&amp;nbsp; code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total&amp;nbsp;&amp;nbsp; percent&lt;/P&gt;&lt;P&gt; 32&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; 34&amp;nbsp; 303&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 532&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 373&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ?????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 15:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93531#M19708</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-12T15:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93532#M19709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have know what percent comes under percent. Do you want it to be the total/grand total for example? Percent is such a bad label, consider using a different term if possible, ie percent of grand total, row percent...&lt;/P&gt;&lt;P&gt;Given the format I'd expect it to be total/grand total for a standard table, but it really depends on what you're doing. From the data it looks like if it was row percent it would be 70% so not sure where the 20% is coming from. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 17:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93532#M19709</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-10-12T17:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93533#M19710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Couple of ways, but in your original output from proc freq you had the percent as well.&lt;/P&gt;&lt;P&gt;If you transpose that variable and then add it up similar to above you can merge it in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can add in the grand total and divide by that using a variety of methods. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 19:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93533#M19710</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-10-12T19:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93534#M19711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Actually what you see above is from several datasets combined. I did it in bits because I wanted identification of each cohort. To give labels and so on in the end. So I guess Percent comin from the proc freq and transpose steps will not work out for me.&lt;/P&gt;&lt;P&gt;Adding the grand total????How can I do that???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the codes I categorized :&lt;/P&gt;&lt;P&gt;734-757 form a dataset&lt;/P&gt;&lt;P&gt;830 and 847 form a dataset&lt;/P&gt;&lt;P&gt;5832-5839 form a dataset&lt;/P&gt;&lt;P&gt;5877-5879 adataset&lt;/P&gt;&lt;P&gt;9342&amp;nbsp; a dataset&lt;/P&gt;&lt;P&gt;9357-9366 a dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set them all finally&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 19:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93534#M19711</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-12T19:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93535#M19712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will work then....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *, totals/sum(totals)&lt;/P&gt;&lt;P&gt;from have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 19:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93535#M19712</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-10-12T19:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93536#M19713</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;Thanks for the help.&lt;/P&gt;&lt;P&gt;I tried this and its not working. A percent variable is created but i get 100 for all the rows!!!1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;data fin;&lt;/P&gt;&lt;P&gt;set cohort_final;&lt;/P&gt;&lt;P&gt;percent=Totals/sum(Totals)*100;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 19:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93536#M19713</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-12T19:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93537#M19714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's not proc sql that's a datastep which operates differently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Proc SQL, the sum() function adds values over the column, in a datastep it works over a row so 100% makes sense in a datastep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *, totals/sum(totals) as percent&lt;/P&gt;&lt;P&gt;from have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 20:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93537#M19714</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-10-12T20:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93538#M19715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got you,&lt;/P&gt;&lt;P&gt;Could you also help me with the data step. I mean how can i get the same thing with Data step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 20:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93538#M19715</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-12T20:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93539#M19716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I guess you probably need two passes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have (in=up) have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; up &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; sum+total;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ^up &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent=total/sum;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; sum;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 20:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93539#M19716</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-12T20:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93540#M19717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hai,&lt;/P&gt;&lt;P&gt;I got the answer.&lt;/P&gt;&lt;P&gt;But could you please explain to me what is two passes. and whats going on with the code you sent..&lt;/P&gt;&lt;P&gt;Also why are we setting the &lt;STRONG&gt;have&lt;/STRONG&gt; dataset&lt;STRONG&gt; twice&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 20:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93540#M19717</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-12T20:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93541#M19718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;"Set have (in=up) have;" is to stack two identical table one after another. It is similar to what 'proc append" does, but with lower efficiency and more control. So we can get the sum in the first 'have', and apply it on the second one, and you want to make sure only the second one get to output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 21:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93541#M19718</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-12T21:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93542#M19719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The most basic and beginner method is to create the total in proc means and then merge it in. You should really use proc sql though, both of these methods are more inefficient in terms of your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=sashelp.class;&lt;/P&gt;&lt;P&gt;output out=grand_total sum(height)=grand_total;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then set grand_total; *merge in total across all rows;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent=height/grand_total;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format percent percent10.1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 21:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93542#M19719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-10-12T21:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93543#M19720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great Help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 21:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-and-Transpose/m-p/93543#M19720</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-12T21:24:00Z</dc:date>
    </item>
  </channel>
</rss>

