BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sb51469
Fluorite | Level 6

Hello,

 

I have been trying to create a Excel using PROC report. I am not attaching my actual code due to Non-disclosure. But let me try to explain using a demo.

 

Data new;

Text = "Income Multiples";

run;

 

Proc report data=new nowd noheader;

column text;

define text /display;

run;

 

I am using ODS tagsets Excelxp for this. My desired output in the excel should be something like this, "Income Multiple", which should appear in one Cell only. I am working on Version 9.2. I have no clue how to do this. I know I can apply style(column)={foreground=<color>}. But I have to present the same in 2 different colors. Need help on this.

1 ACCEPTED SOLUTION

Accepted Solutions
sb51469
Fluorite | Level 6

Hello @RW9, I found a solution. Albeit the concept is same, just the syntax is different. It should be something like this.

 

text="^S={foreground=red}Income^S={} ^S={foreground=blue}Multiples^S={}";

 

I found the solution in this paper by Mr. Derek Morgan, Washington University Medical School, St. Louis, MO. Here is the link.

http://www2.sas.com/proceedings/sugi31/051-31.pdf

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

There is something called "inline formatting" where with the use of an escapechar you add in formatting:

http://support.sas.com/resources/papers/proceedings09/222-2009.pdf

 

So maybe:

ods escapechar="^";

data new;
  text="^{style [foreground=red]}Income ^{style [foreground=blue]}Multiples";
run;

proc report...

Not tested.

 

sb51469
Fluorite | Level 6

Hello RW9,

Tested this one yesterday, but it seems not enough, something else is probably also needed.

Anyways I am exploring the inline formatting thing you just specified I am looking into it.

I will post the solution if I get one.

thanks for giving me some direction.

sb51469
Fluorite | Level 6

Hello @RW9, I found a solution. Albeit the concept is same, just the syntax is different. It should be something like this.

 

text="^S={foreground=red}Income^S={} ^S={foreground=blue}Multiples^S={}";

 

I found the solution in this paper by Mr. Derek Morgan, Washington University Medical School, St. Louis, MO. Here is the link.

http://www2.sas.com/proceedings/sugi31/051-31.pdf

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 3 replies
  • 1238 views
  • 0 likes
  • 2 in conversation