BookmarkSubscribeRSS Feed
BrunoSilva
Quartz | Level 8
Hi there,

I would like to know if is possible to add the attribute ID for each TR tag on a HTML table produced by the proc report.

I would like to get something like this with proc report or proc print

....
....



I already have a table with ID for each column.

ods listing close;
ods html file='teste.html' style=fancyPrinter;

proc report data=sashelp.class nowd;

column name sex age height;

define name / display
style(COLUMN) = {tagattr='id="1"'};
define sex / display
style(COLUMN) = {tagattr='id="2"'};
define age / display
style(COLUMN) = {tagattr='id="3"'};
define height / display
style(COLUMN) = {tagattr='id="4"'};
run;

ods html close;



Thanks
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi,
I do not believe there is a way to "touch" the <tr> -- at least -inside- PROC REPORT syntax. That's because the <tr> tag is generated by the beginning of the row of data being sent to ODS. And, since the beginning of the row event in ODS -only- generates the <tr> tag, there are no hooks to that event inside PROC REPORT.

You can probably modify or create your own HTML tagset using PROC TEMPLATE for tagset templates, in order to put extra text into the <tr> -- because it is the TAGSET template that handles the row event. And, also, if you want to create a counter to put into the rows, then you'd need to get into the details of TAGSET template and event processing.

If you do not have experience with Proc Template for TAGSET templates, you may with to contact Tech Support for more help with this question.

cynthia
BrunoSilva
Quartz | Level 8
Thanks 😄

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