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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 1024 views
  • 0 likes
  • 2 in conversation