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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 948 views
  • 0 likes
  • 2 in conversation