DATA Step, Macro, Functions and more

proc tabulate question

Regular Contributor
Posts: 179

proc tabulate question

proc sql;

create table action as

select distinct Region,count(ln_no) as ln, sum(balance) as bal

from main;

where region = 'West';


Sample output is

Region             ln                          bal

West           2500                     2300000

I created a proc tabulate with the intention of capturing both the count of the ln_no and the sum of the balance

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

  Class Region;
  Var ln;
  Table Region=' ' all={label='Grand Total' S=[background = lightblue cellwidth=160]} *[STYLE=[Font_Weight=BOLD]],
        Region='Status '*ln=' '*sum=' '
        all={label='Grand Total' S=[background = lightblue]} *[STYLE=[Font_Weight=BOLD]] *ln=' '*sum=' ' / box='Investor Group';
  TITLE 'Loan Status';

My results give me a summary of the count of the loan however I am not getting the total or sum of the balance.  Essentially I am getting the 2500 but not the 2300000.  In addition how would I format the bal so it reads as a dollar format such as $2,300,000.00

Posts: 9,371

Re: proc tabulate question


  I already gave a partial answer in the other forum where you posted this question. Short version: BAL needs to be USED in VAR statement and TABLE statement to show up in output.


Regular Contributor
Posts: 179

Re: proc tabulate question

Posted in reply to Cynthia_sas

Thanks that was a typo to repeat this

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation