BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Q1983
Lapis Lazuli | Level 10

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
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

View solution in original post

1 REPLY 1
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 951 views
  • 1 like
  • 2 in conversation