BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Barite | Level 11
Hello,

Do you know how to change a style in Line Methode please?
I would like to have the blue line with obj.line(). I changed a size (with option size: 1 mm), but I don’t know how to change a color.

Thank you for your help
Best regards,
Marie
1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @SASdevAnneMarie 

 

Maybe something like this?

data _null_;
	if _n_=1 then do;
		dcl odsout obj();
		obj.line(size:"1", style_attr: "bordercolor=blue");
	end;
run;

Best,

View solution in original post

7 REPLIES 7
ballardw
Super User

Please show a more complete example of the code you are using or attempting.

 

Often a single line of code interacts with other bits and we need to see a bit more to provide a better answer. Best is to provide code of an entire data step or procedure. Copy the code from the editor and paste it into a code box opened on the forum with either the </> or "running man" icons that appear at the top of the message window. Please be aware that the main message windows will reformat text and sometimes make code extremely hard to read and occasionally insert artifacts that will make the code fail.

PhilC
Rhodochrosite | Level 12

Got it to work

 

filename rwiOut "C:\Users\::REDACTED::";
ods html close;
ods html path=rwiOut file="UnformatText.html" style=Festival;


title "Using the DATA Argument";
data _null_;
dcl odsout obj();
   obj.format_text(data: "This text is displayed with the FORMAT_TEXT method."); 
   obj.note(data: "This text is displayed with the NOTE method.");
   obj.line(size:"1", style_attr: "bordercolor=blue");
run;

I couldn't get it to work with my default ODS style.  The ability to create HRs, horizontal rules, maybe dependent on the style you use.  

SASdevAnneMarie
Barite | Level 11
Thank you! It works!
PhilC
Rhodochrosite | Level 12

I have never seen this, but I was trying to do just what this says it does weeks ago.  Thanks, and good luck

ed_sas_member
Meteorite | Level 14

Hi @SASdevAnneMarie 

 

Maybe something like this?

data _null_;
	if _n_=1 then do;
		dcl odsout obj();
		obj.line(size:"1", style_attr: "bordercolor=blue");
	end;
run;

Best,

SASdevAnneMarie
Barite | Level 11
Thank you very much!
It works!
PhilC
Rhodochrosite | Level 12

This might help, I'm learning this with you.

Adding Unformatted Text to Your Output - SAS® 9.4 ODS: Advanced Topics, 3e

 

This object is used with a particular environment which is demonstrated here.  I still haven't tried to add the line function yet...

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 7 replies
  • 1814 views
  • 2 likes
  • 4 in conversation