<?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: Getting count and total count to work in proc print in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184574#M303589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="255172" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: If the OP doesn't have any variable to sum, I agree with you that tabulate or report may be needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I find it interesting that including a sum statement, with no variables, doesn't product any error, but doesn't honor the 2nd title for the n= option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since every time I've submitted anything to the SAS ballot, I've gotten an unsatisfactory response, I won't submit one in this case.&amp;nbsp; However, I'd call this a bug (actually two discrepancies in the manual).&amp;nbsp; One or more variables are supposedly required with a sum statement, but apparently aren't.&amp;nbsp; And, when a sum statement is included, proc print is supposed to do the total sum and honor the secondary n= variable label line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anyone from SAS reading this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Dec 2013 23:26:37 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2013-12-30T23:26:37Z</dc:date>
    <item>
      <title>Getting count and total count to work in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184571#M303586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to get a total count as well as a break count by login_user_id. From what I found on the web, the following code should work, but it does not give me a total count. Could someone please advise me on what I'm missing?&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;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;=R_WData.Mapext4 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;label&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;sumlabel&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;n&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'Login Count = '&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'Total Login Count = '&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; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; login_user_id;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; login_user_id; &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;var&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; Fname Lname login_user_id Activity_attempt_dttm;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;title1&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;"Users for a Selected Time Period"&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; &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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 20:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184571#M303586</guid>
      <dc:creator>tbagger70</dc:creator>
      <dc:date>2013-12-30T20:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Getting count and total count to work in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184572#M303587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing a sum statement, but I don't think that will help you with this dataset, as you don't have anything to sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you had a numeric variable for which a sum would be relevant, e.g., time_spent, then you could use something like:&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;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy;"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;=R_WData.Mapext4 &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;label&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;sumlabel&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;n&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;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: purple;"&gt;'Login Count = '&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: purple;"&gt;'Total Login Count = '&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;&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; login_user_id;&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; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; login_user_id;&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; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; Fname Lname login_user_id Activity_attempt_dttm;&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; sum time_spent;&lt;BR /&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;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;title1&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: purple;"&gt;"Users for a Selected Time Period"&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;&lt;STRONG style="font-size: 10pt; line-height: 1.5em; font-style: inherit; font-family: 'Courier New'; color: navy;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; 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;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&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; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;and you would then obtain what you are looking for.&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; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 22:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184572#M303587</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-30T22:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting count and total count to work in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184573#M303588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to use proc report or tabulate instead of proc print for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 23:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184573#M303588</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-30T23:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getting count and total count to work in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184574#M303589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="255172" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: If the OP doesn't have any variable to sum, I agree with you that tabulate or report may be needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I find it interesting that including a sum statement, with no variables, doesn't product any error, but doesn't honor the 2nd title for the n= option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since every time I've submitted anything to the SAS ballot, I've gotten an unsatisfactory response, I won't submit one in this case.&amp;nbsp; However, I'd call this a bug (actually two discrepancies in the manual).&amp;nbsp; One or more variables are supposedly required with a sum statement, but apparently aren't.&amp;nbsp; And, when a sum statement is included, proc print is supposed to do the total sum and honor the secondary n= variable label line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anyone from SAS reading this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 23:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184574#M303589</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-30T23:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting count and total count to work in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184575#M303590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that the issue is using the combination of BY and ID variables.&amp;nbsp; This has always been a special case for PROC PRINT. Doing that will defeat the SUMLABEL option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Dec 2013 02:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-count-and-total-count-to-work-in-proc-print/m-p/184575#M303590</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-12-31T02:26:53Z</dc:date>
    </item>
  </channel>
</rss>

