BookmarkSubscribeRSS Feed
keen_sas
Quartz | Level 8

Hi All , 

 

I have a variable and this variable is printed using proc report. Using call define to highlight the particular value of the entire string. But call define is highlighting the entire observation instead of particular string. From the below example I have a string "I know SAS programming". In this string i need to highlight only the SAS keyword  and this word is present in another variable to differentiate this in the original string. Call define is not allowing to highlight particular keyword in the string. Any suggestion/alternative to highlight only a specific word in the string as 

 

data compare;
length str1 $64;
str='I know SAS programming';
str1='SAS*';
output;
str='Python programming ac';
str1='Python*';
output;
str ='SAS and R programming' ;
str1='SAS and R*';
output;
run;

 

Required output: Highlighting only the specified keywords from another variable

Str1 Str2
SAS* I know SAS programming
Python* Python programming 
SAS and R* SAS and R programming

 

2 REPLIES 2
ballardw
Super User

You should show what you have tried in code and provide some actual example data.

 

You are going to have to break the string apart so style elements can be supplied to just part of the string and may not be a trivial activity depending on the actual values you want highlighted.

jimbarbour
Meteorite | Level 14

@keen_sas

 

Please take a look at this post:  https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-pro...

 

I think that post explains how to do just what you're asking.

 

Jim

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 793 views
  • 0 likes
  • 3 in conversation