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)
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
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
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.