turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Proc Tab percentage totals repeating

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-27-2016 11:16 AM

**Proc** **tabulate** data=exc_cnt_1 order= data format=**10.** S=[cellwidth=**100**];

Class prog_ctgy CODEDESC;

Var GROSS_LN_AMT ln_cnt;

Table CODEDESC=' ' all={label='Total' S=[background = lightblue cellwidth=**100**]} *[STYLE=[Font_Weight=BOLD]],

prog_ctgy*(ln_cnt=''*sum='Exceptions Units' ln_cnt=''*colpctn='% in Units'

GROSS_LN_AMT=''*sum='Exceptions$' GROSS_LN_AMT=''*colpctn='% in Dollars' )

all={label='Grand Total' S=[background = lightblue]} *[STYLE=[Font_Weight=BOLD]] *ln_cnt =' '*sum=' ' / box='Exception Codes';

TITLE 'Summary';

**run**;

The code produced the attached proc tab results. My question is why does the percent column for GROSS_LN_AMT=''*colpctn='% in Dollars' match ln_cnt=''*colpctn='% in Units' exactly. It should be a measure of the totals

Accepted Solutions

Solution

10-27-2016
01:27 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Q1983

10-27-2016 12:19 PM

HI,

There is a difference between PCTN and PCTSUM and also between COLPCTN and COLPCTSUM. If you want the denominator for GROSS_LN_AMT to be based on the SUM, then this

GROSS_LN_AMT=''*colpctn='% in Dollars'

probably needs to change to

GROSS_LN_AMT=''*colpctsum='% in Dollars'

But, since you did not post data, no one can run your code -- but that is my guess.

cynthia

There is a difference between PCTN and PCTSUM and also between COLPCTN and COLPCTSUM. If you want the denominator for GROSS_LN_AMT to be based on the SUM, then this

GROSS_LN_AMT=''*colpctn='% in Dollars'

probably needs to change to

GROSS_LN_AMT=''*colpctsum='% in Dollars'

But, since you did not post data, no one can run your code -- but that is my guess.

cynthia

All Replies

Solution

10-27-2016
01:27 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Q1983

10-27-2016 12:19 PM

There is a difference between PCTN and PCTSUM and also between COLPCTN and COLPCTSUM. If you want the denominator for GROSS_LN_AMT to be based on the SUM, then this

GROSS_LN_AMT=''*colpctn='% in Dollars'

probably needs to change to

GROSS_LN_AMT=''*colpctsum='% in Dollars'

But, since you did not post data, no one can run your code -- but that is my guess.

cynthia