BookmarkSubscribeRSS Feed
Apprentice
Calcite | Level 5

I am trying to format the header encased by Red below. Can you please guide?

 

Apprentice_0-1653451598944.png

 

Code: 


proc sort data=temp_data ;
By Specialist;
run;


%LET DATE = %sysfunc( putn( %sysfunc( date() ), MMDDYY10. ));
%LET REPORT_DATESTAMP = %sysfunc(strip(&AUDIT_YEAR))-%sysfunc(strip(&AUDIT_MONTH));

 

/* ODS CODE */

ODS EXCEL file="/windows/Reporting/TEST_REPORT_Specilist- &REPORT_DATESTAMP..xlsx" STYLE=EXCEL
options(

sheet_interval="bygroup"

EMBEDDED_TITLES = 'YES'
EMBEDDED_FOOTNOTES = 'YES'
sheet_label="#"
FLOW = "Header,data"
absolute_row_height = "23px"
absolute_column_width = '17,32,20,20,20,10,10'
EMBED_TITLES_ONCE= 'YES'
EMBED_FOOTNOTES_ONCE = 'YES'
start_at1='A,1'
GRIDLINES = 'ON'
FROZEN_HEADERS = 'OFF'
);

TITLE1 j=left lspace=1 height=15pt font='Arial' BOX=2 bold color=black "Monthly Employee Scorecard";
TITLE2 j=left lspace=1 height=13pt font='Arial' color=BLACK "Reporting Period: &REPORT_DATESTAMP";
TITLE3 j=left lspace=1 height=13pt font='Arial' color=BLACK "Team : #byval(Team)";
TITLE4 j=left lspace=1 height=13pt font='Arial' color=BLACK "Team : #byval(Supervisor)";


FOOTNOTE J=RIGHT LSPACE=1 HEIGHT=10PT FONT='Times New Roman' COLOR=BLACK "Report Created On: &DATE";

 

PROC PRINT DATA=work.TEMP_DATA noobs

style(header)=[font = ("Arial") fontsize=11pt just=center VERTICALALIGN=CENTER font_weight = bold backgroundcolor=white foreground=blue borderstyle=solid] 
style (data) = [font_face='Arial' just=center VERTICALALIGN=CENTER bordertopstyle=solid bordertopwidth=0pt borderstyle=solid ];
By Specialist;

Var 'Categories'n /Style(data) = {TAGATTR="Type:Sting Wrap:No" };
Var 'No_of_Random_Audited_Files'n /Style(data) = {TAGATTR="Type:Number Wrap:No"};
Var 'Total_File_Points'n /Style(data) = {TAGATTR="Type:Number Wrap:No"};
Var 'Minor_Error_Points'n /Style(data) = {TAGATTR="Type:Number Wrap:No"};
Var 'Major_Error_Points'n /Style(data) = {TAGATTR="Type:Number Wrap:No"};
Var 'Actual'n /Style(data) = {TAGATTR="Type:Number format:0.00% Wrap:No"};
Var 'Standard'n /Style(data) = {TAGATTR="Type:Number format:0.00% Wrap:No"};
RUN;

ODS EXCEL CLOSE;

 

2 REPLIES 2
Rick_SAS
SAS Super FREQ

SAS supports the #BYVAR and #BYVAL keywords, which you can specify in a TITLE statement. See "How to use the #BYVAR and #BYVAL keywords ...in SAS"

 

In this case, I think you can get what you want by using

OPTION BYLINE;

TITLE3;

If not, you can use the #BYVAR keyword to insert the name of the BY-group variable ("Specialist") and #BYVAL to insert the value of the current level (eg, "Ada Casusus").

Apprentice
Calcite | Level 5

Thanks Rick_SAS. I'll try your recommendation.

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 save with the early bird rate—just $795!

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
  • 875 views
  • 1 like
  • 2 in conversation