BookmarkSubscribeRSS Feed
Amber_Nicole94
Obsidian | Level 7

I am using the "list data wizard" in SAS EG 7.1 and having some trouble on formatting.

 

How do I change the output from printing the variable in the "Subtotal Of" to the word "subtotal"?

 

Example, I have the variable "At Risk" in the "subtotal of" role. The two values of at risk are "yes" or "no". In the output it is subtotaling these correctly, however instead of saying subtotal next to the values, it says the word "At Risk". I would like to change that to either say "Subtotal" or "Yes Subtotal" / "No Subtotal".

 

 

2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
PROC REPORT gives you more control over this than PROC PRINT (List Data Wizard).

What code have you tried?

cynthia
Amber_Nicole94
Obsidian | Level 7
PROC SORT
	DATA=WORK.QUERY_FOR_APPEND_TABLE_0001(FIRSTOBS=1  KEEP="At Risk?"n Origin Destination Units "% OT"n "% <1"n "% <2"n "% <4"n "% <6"n "% <12"n "% <24"n "<48"n)
	OUT=WORK.SORTTempTableSorted
	;
	BY "At Risk?"n;
RUN;
TITLE;
TITLE1 "Report Listing";
FOOTNOTE;
FOOTNOTE1 "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";

PROC PRINT DATA=WORK.SORTTempTableSorted
	NOOBS
	LABEL
	ROWS=PAGE
	;
	VAR "At Risk?"n Origin Destination Units "% OT"n "% <1"n "% <2"n "% <4"n "% <6"n "% <12"n "% <24"n "<48"n;
	BY "At Risk?"n;
	PAGEBY "At Risk?"n;
	SUM Units "% OT"n "% <1"n "% <2"n "% <4"n "% <6"n "% <12"n "% <24"n "<48"n;
	LABEL "At Risk?"n="   ";
RUN;
/* -------------------------------------------------------------------
   End of task code
   ------------------------------------------------------------------- */
RUN; QUIT;
%_eg_conditional_dropds(WORK.SORTTempTableSorted);
TITLE; FOOTNOTE;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1282 views
  • 0 likes
  • 2 in conversation