Hello,
I have a problem with writing a new tagset. It is extremely hard to follow how different procedures/statements trigger events.
Is there any way to get a list of the triggered events after specific procedure is run?
For example I would need to find which event is linked to ODS TEXT statement.
Thank you!
Hi, in fact, there is a way to see which events are triggered by which procedures, if you are writing your own tagset template. This rather old paper https://support.sas.com/resources/papers/proceedings09/227-2009.pdf outlines the major difference between the various template types and talks about how you can use the EVENT_MAP tagset to create output that shows exactly which events are triggered by which procedure.
But you REALLY, REALLY, REALLY have to need to write your own TAGSET template. To change the style of ODS TEXT, though, would be a style template change, not a TAGSET template change. So I am sort of confused why you are asking about ODS TEXT and how to trace events. Do you want to trace the events or do you need to change the style?
cynthia
Not sure if there's an automated way but for ODS TEXT it's the UserText event.
See docs, under Details section.
Thank you Reeza, this documentation certainly will help me. However I would need to control several different PROC output and I am looking for a method similar to ods trace but for the events. But maybe there is no such thing.
If you are looking to control appearance of output for specific procedures then perhaps what you want to do is to modify the templates used by the reports and do not need a tagset.
Hi, in fact, there is a way to see which events are triggered by which procedures, if you are writing your own tagset template. This rather old paper https://support.sas.com/resources/papers/proceedings09/227-2009.pdf outlines the major difference between the various template types and talks about how you can use the EVENT_MAP tagset to create output that shows exactly which events are triggered by which procedure.
But you REALLY, REALLY, REALLY have to need to write your own TAGSET template. To change the style of ODS TEXT, though, would be a style template change, not a TAGSET template change. So I am sort of confused why you are asking about ODS TEXT and how to trace events. Do you want to trace the events or do you need to change the style?
cynthia
Yes I think I really have to do my own tagset. I am writing a customized HTML tagset and for example for the ODS TEXT I would like to give some base properties written in HTML. I use html4 as a parent. Thank you all for the answers, I guess I can now proceed with my code 🙂
Hi, here are 2 screen shots of using the event_map tagset to help you figure out what's been triggered. Hope this helps you get started.
cynthia
with ODS TEXT
for the Row headers in PROC FREQ
Hi:
An addendum:
If all I needed to do was change something about ODS TEXT output that was written, I would be tempted to alter the HTML with a program. For example, I can do this:
In the original runfreq.html file, the line written by ODS TEXT is: "This is ODS TEXT" - if I want to change the HTML written for just that line, the HTML elements that are written are:
<table width="100%" style=" border: 0px solid #000000; border-spacing: 0px;" cellspacing="0" cellpadding="0" rules="none" frame="void">
<tr>
<td class="l usertext">This is ODS TEXT</td>
</tr>
</table>
And in particular, the one line with the ODS TEXT string is <td class="l usertext">This is ODS TEXT</td> -- which can be read with a DATA step program and altered, possibly easier than writing your own TAGSET template (which you will then have to get put into a production library and remember to use everytime you want the custom ODS TEXT written).
My program created the changed HTML file called change_new.html by this program -- I just write out most of the original file unchanged, until I run into the line with "l usertext" and then I change it by inserting my own HTML and even some extra text. Here's that program.
cynthia
Thank you very much Cynthia! Really useful and clear presentation. I will dig in to these and see what suits the best for me.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: