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

 

 Data tbl;
 input branch sales;
 cards;
 1  10
 2  20
 3  30
 4  40
 ;
 run;


 proc format;
value FFMT 
1='North'
2='South'
3='East'
4='West';
Run;


Data tbl2;
set tbl;
FORMAT branch FFMT.;
Run;


proc report data=tbl2  headline split='#' spacing=1 nowd
style(report)={cellpadding=1 cellspacing=1}
style(header)={font_size=2  font_weight=MEDIUM  font_face=david  background=cx99ccaa}
style(column)={font_size=1}; 
columns  branch sales;
define branch/ display 
	"Branch"  center;
define sales/  order order=internal descending
	"SALES 2018";
Run;

Hello

 

I want  that in the proc report field branch will appear 2 times: In one column as a formatted value (south,north,east,west)

In second column as a non formatted value( 1,2,3,4)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MichaelLarsen
SAS Employee

Try this:

 

proc report data=tbl2  headline split='#' spacing=1 nowd
style(report)={cellpadding=1 cellspacing=1}
style(header)={font_size=2  font_weight=MEDIUM  font_face=david  background=cx99ccaa}
style(column)={font_size=1}; 
columns  branch branch=branch2 sales;
define branch/ display 
	"Branch"  center;
define branch2/ display 
	"Branch unformatted" format=best. center;
define sales/  order order=internal descending
	"SALES 2018";
Run;

Regards,

Michael

View solution in original post

2 REPLIES 2
MichaelLarsen
SAS Employee

Try this:

 

proc report data=tbl2  headline split='#' spacing=1 nowd
style(report)={cellpadding=1 cellspacing=1}
style(header)={font_size=2  font_weight=MEDIUM  font_face=david  background=cx99ccaa}
style(column)={font_size=1}; 
columns  branch branch=branch2 sales;
define branch/ display 
	"Branch"  center;
define branch2/ display 
	"Branch unformatted" format=best. center;
define sales/  order order=internal descending
	"SALES 2018";
Run;

Regards,

Michael

gamotte
Rhodochrosite | Level 12

Hello,

 

Data tbl;
 input branch sales;
 cards;
 1  10
 2  20
 3  30
 4  40
 ;
 run;


 proc format;
value FFMT 
1='North'
2='South'
3='East'
4='West';
Run;

proc report data=tbl  headline split='#' spacing=1 nowd
style(report)={cellpadding=1 cellspacing=1}
style(header)={font_size=2  font_weight=MEDIUM  font_face=david  background=cx99ccaa}
style(column)={font_size=1}; 
columns  branch branch2 sales;
define branch/ display 
	"Branch"  center;
define branch2 / computed format=FFMT.;
define sales/  order order=internal descending
	"SALES 2018";
compute branch2;
	branch2=branch;
endcomp;
Run;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 805 views
  • 1 like
  • 3 in conversation