Hello experts,
I would like to write the hyperlink after the text like:
Information: hyperlink
But, when I run the code (see below), the result is:
Information (a lot of spaces) hyperlink
I can't find how to write the text and the adresse in the same line.
Thank you for your help!
OPTION NODATE NONUMBER;
OPTIONS PAPERSIZE=A4;
OPTIONS TOPMARGIN=0.5 in BOTTOMMARGIN=0.5 in LEFTMARGIN=0.5 in RIGHTMARGIN=0.5 in;
ODS NORESULTS;
ODS PDF FILE = "XXXXXX\TEST.pdf" dpi=1800;
data _NULL_;
set SASHELP.CLASS(obs=1);
declare odsout obj();
obj.format_text( data: "Information:",
overrides: " just=left color=green font_weight=bold font_size=8pt ");
obj.href(data:
"Adresse", url: 'https://www.test.fr/', inline_attr:'color=blue');
Run;
ODS PDF CLOSE;
Best regards,
Marie
If you want the obj.format_text and the obj.href to output to the same line, I suspect you'll have to construct them as two cells in the same row of a table, as in:
data _NULL_;
set SASHELP.CLASS(obs=1);
declare odsout obj();
obj.table_start();
obj.row_start();
obj.cell_start();
obj.format_text( data: "Information:",overrides: " just=left color=green font_weight=bold font_size=8pt ");
obj.cell_end();
obj.cell_start();
obj.href(data:"Adresse", url: 'https://www.test.fr/', inline_attr:'color=blue');
obj.cell_end();
obj.row_end();
obj.table_end();
run;
I suspect there are options for the obj.table_start() method thiat will allow you to elminate table grid lines, and left-justify the entire table.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.