BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BobHope
Quartz | Level 8

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

View solution in original post

8 REPLIES 8
Reeza
Super User

Not sure if there's an automated way but for ODS TEXT it's the UserText event. 

See docs, under Details section. 

 

http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p14gx25pepks6dn1q9m7...

BobHope
Quartz | Level 8

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.

ballardw
Super User

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.

 

 

Cynthia_sas
SAS Super FREQ

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

BobHope
Quartz | Level 8

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 🙂

Cynthia_sas
SAS Super FREQ

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

event_map_text.png

 

for the Row headers in PROC FREQ

event_map_output.png

Cynthia_sas
SAS Super 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:

use_data_step.png

 

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

post_process.png

BobHope
Quartz | Level 8

Thank you very much Cynthia! Really useful and clear presentation. I will dig in to these and see what suits the best for me.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 8 replies
  • 1513 views
  • 1 like
  • 4 in conversation