BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASGeek
Obsidian | Level 7

Hello,

I'm have a problem with no highlighting in my results. I get results as expected (and yes, there is a 31Aug2022 in my dates) but nothing highlights. My code is as follows:

 

%let asofdt = '31Aug2022'd;

%let newfile = Newfile_data.xlsx;

 

ods excel file = "&newfile."
options (Sheet_Name = 'Focus_Results');

 

proc report data = newvals nowd missing;
column date_asof
               ATM_results;
define date_asof / "As of Date" f=weekdate17. width = 10;
define ATM_results / "ATM Results" f=comma10. width = 10;
 
compute date_asof;
     if date_asof = &asofdt. then call define(_row_, 'style', 'style={background=yellow}');
endcomp;
run;  
 
ods excel close;
 
Thank you

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
A_Kh
Barite | Level 11

I think you are missing DEFINE statement usage options (eg. DISPLAY); Do you have a clean log? 
See the modification below and try it. 

define date_asof / "As of Date" f=weekdate17. width = 10 display;
define ATM_results / "ATM Results" f=comma10. width = 10 display;

View solution in original post

3 REPLIES 3
A_Kh
Barite | Level 11

I think you are missing DEFINE statement usage options (eg. DISPLAY); Do you have a clean log? 
See the modification below and try it. 

define date_asof / "As of Date" f=weekdate17. width = 10 display;
define ATM_results / "ATM Results" f=comma10. width = 10 display;
ballardw
Super User

@A_Kh wrote:

I think you are missing DEFINE statement usage options (eg. DISPLAY); Do you have a clean log? 
See the modification below and try it. 

define date_asof / "As of Date" f=weekdate17. width = 10 display;
define ATM_results / "ATM Results" f=comma10. width = 10 display;

Bet his log has:

NOTE: Variable date_asof is uninitialized.

By default numeric variables, which include dates, would be SUMMED. Which is why with my small example data set (HINT HINT HINT @SASGeek ) of:

data work.newvals;
   input date_asof :date9. atm_results;
   format date_asof date9.;
datalines;
31Aug2022  123456
01Sep2022  34555
02Oct2022  11111
;

The result looked like the following. Please note the displayed date.

As of Date ATM Results
Thu, Feb 1, 2148 169,122
SASGeek
Obsidian | Level 7

Thank you so much. Using the display worked. 

To answer your question: I did have a clean log and the output looked fine, it's just that it didn't highlight.

 

Thank you!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 3 replies
  • 1200 views
  • 2 likes
  • 3 in conversation