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-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!

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