SAS procedures that generate ODS output use a standard
set of events and variables. To generate customized output, create
a customized tagset with customized events. However, in order to customize
the events, you need to know the names of the events that ODS uses.
A good way to start
defining the customized tagset is to use the Event_Map tagset that
SAS supplies. This enables you to determine which events are triggered
and which variables are used by an event to send output from a SAS
process to an output file. When you run a SAS process with Tagsets.Event_Map,
ODS writes XML markup to an output file that shows all event names
and variable names as tags. In the output, tag names are the event
names. Tag attributes are the variables that have values for those
events.
For example, the following
statements run ODS MARKUP with TYPE=Event_Map to see which events
and variables ODS uses for various parts of the PROC PRINT output:
ods listing;
ods markup type=event_map file='custom-tagset-filename.xml';
proc print data=sashelp.class;
where Height gt 60;
run;
ods markup close;
ods listing close;
Here is the listing
output and resulting XML file:
In the XML output that
is generated by Event_Map, PROC PRINT uses events named DOC_HEAD,
PROC, TABLE, and so on. The TABLE event uses data from event variables
such as STATE, CLASS, and TYPE. After you know the events and variables
that generate the output, define the tagset and customize your events.
For example, you could redefine the TABLE event to produce customized
output.
To define a tagset with
which to customize your output, start by specifying Tagsets.Event_Map
as the parent tagset. As you redefine events to customize output,
these events replace the default events that are defined in the Event_Map
tagset. In addition, you can remove the operation of a default event
by redefining it as an empty event in the tagset. When you are satisfied
with the customized output, remove the Event_Map inheritance and the
empty events. Then the output will reflect only the events that you
defined.
Note: When you first run a SAS
process and specify TYPE=Event_Map, you can also generate a style
sheet along with the body file. The style sheet shows which style
attributes you are using.