Usage Note 24302: Can I remove the equal sign from the BY value in the table of contents for ODS output?
The equal sign can be removed from the BY value in the table of contents by using the ODS MARKUP destination. The MARKUP destination gives you access to each piece of output. Therefore you can substring this value from the BY value using DATA step functions in SAS 9.1. This can also be done with the ODS DOCUMENT destination, which you can use together with all destinations and not just with the HTML destination. PROC REPORT is not supported by the DOCUMENT destination in 9.1 and PROC PRINT minimally supported. The below example removes the equal sign from the values of the procedure. View output.
proc template;
define tagset tagsets.noequal;
parent=tagsets.html4;
define event list_entry;
start:
/* Comment out the below statement so byval is a link */
/*break / if cmp(HTMLCLASS,"bycontentfolder"); */
put "<li";
putq " class=" HTMLCLASS;
put ">";
trigger do_link /if listentryanchor;
trigger do_list_value /if ^listentryanchor;
trigger hyperlink finish / if !cmp(htmlclass,"ContentProcName");
finish:
/* Add a space only for a new PROC */
put split NL / if cmp(htmlclass,"ContentProcName");
put "</li>" NL;
end;
define event hyperlink;
start:
put "<a href=""" URL;
put """";
putq " target=" HREFTARGET;
put ">";
put VALUE / if !cmp(htmlclass,"bycontentfolder");
finish:
put "</a>" NL;
end;
/* Check value of BY variable. Locate and remove "=" */
/* using DATA step functions. */
define event do_list_value;
eval $list index(reverse(value),"=")-1;
eval $byval reverse(substr(reverse(value),1,$list));
trigger hyperlink / if cmp(htmlclass,"bycontentfolder");
put $byval;
end;
end;
run;
ods tagsets.noequal file='temp.html' contents="temp1.html";
ods proclabel "First output";
proc print data=sashelp.class contents='';
by age;
run;
ods proclabel "Second output";
proc report data=sashelp.class nowd contents='';
by age;
run;
ods proclabel "final output";
proc print data=sashelp.class;
run;
proc univariate data=sashelp.class;
run;
ods tagsets.noequal close;
See also the full PROC TEMPLATE FAQ and Concepts.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | low |
| Topic: | Third Party ==> Output ==> HTML SAS Reference ==> ODS (Output Delivery System)
|
| Date Modified: | 2005-07-01 17:14:43 |
| Date Created: | 2005-06-17 16:11:00 |