BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

Proc tabulate data=exc_cnt order= data format=10. S=[cellwidth=150];

Class prog_ctgy CODEDESC;

Var gr_amt cnt_cd;

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

prog_ctgy*(cnt_cd=''*sum='Exceptions Units' gr_amt=''*sum='Exceptions$' /** colpctn*/ )

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

TITLE 'Summary';

footnote1 &rptdate;

 

run;

This code produced the dataset enclosed in the attachment.  Now I want to add a column percentage total per exception code, grouped by prg_catg.  AS you can see I used colpctn however unable to get it to work in the individual columns.  It need to be a separate measure based on gross loan amount and the number of cnt_cd, shown in the VAR section.   The yellow portion represents where I want to put the data.

1 REPLY 1
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... shows how to create data step code from your existing data set. Then we can test code against your data and see the actual output.

 

For showing "highlighted change" you may be better off posting an image.

 

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1107 views
  • 0 likes
  • 2 in conversation