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

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 313 views
  • 0 likes
  • 3 in conversation