BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
epr
Calcite | Level 5 epr
Calcite | Level 5

Hello everyone,

Using this code

proc report data=z12 nowd;

column category dallas collin dekalb;

define category /display ;

define dallas/sum;

  define dekalb/sum;

define collin/sum;   

run;

i got output like this

Category          Dallas   Collin    Dekalb

Age_0_10         10         100       45

Age_10_20       10           20     100

Age_20_40        90           80      300

Age_40_plus     67          877     766

Total              177          1080     1200   I would like to include total like this. what should i include in the code.

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
esjackso
Quartz | Level 8

If i am remebering correctly after your define statements place:

rbreak after / summarize

if you want lines to break up the table from the totals add ul ol after summarize (under line / over line).

Hope that helps

EJ

View solution in original post

4 REPLIES 4
esjackso
Quartz | Level 8

If i am remebering correctly after your define statements place:

rbreak after / summarize

if you want lines to break up the table from the totals add ul ol after summarize (under line / over line).

Hope that helps

EJ

epr
Calcite | Level 5 epr
Calcite | Level 5

I tried this, it ran but idid not get right output

ballardw
Super User

What output did you get?

epr
Calcite | Level 5 epr
Calcite | Level 5

oops my bad,  i did something wrong. I got perfect output with you code EJ. Thank you so much.

Thank you for your input ballrdw.

one small question how to insert that extraword 'Total' in report

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
  • 4 replies
  • 537 views
  • 3 likes
  • 3 in conversation