This technique to add a button to ODS HTML output is a technique that generally works in SAS/ODS outside the context of the Enterprise Intelligence Platform.
This technique might work if you were going to use the SAS Information Delivery Portal or the Stored Process Web Application or a custom front end to deliver HTML results from a stored process. However, in addition to needing answers to the above questions, someone needs to actually see the place in your code where the error message is getting issued.
The people best suited to help you with this error message and with the development of this stored process are the people in SAS Tech Support.
I expected this to work using the Stored Process Web Application. But, when I tried your stored process using the Stored Process Web Application, I got this error message in the log:
14 + style table from output / WARNING: Truncated record.
which indicates to me that your posthtml string is too long. And your style template never got put into the WORK location because of the error.
One trick I frequently use with long text strings is to let the macro processor assemble them (even if I can't send the whole long string to the compiler in open code, the macro processor can pass quite long "assembled" strings to the SAS compiler):
This stored process worked for me using the Stored Process Web Application. Note how I changed all the double quotes in the strings to single quotes. Most versions of HTML will accept single quotes for tag attributes, even though the W3C recommends double quotes. This simplifies the code for me and means that I don't have to use macro quoting functions to protect the double quotes in the POSTHTML attribute. Note also that I did NOT put the proc template inside the %STPBEGIN/%STPEND "sandwich" -- since the proc template is not producing any streaming results, it can be before %STPBEGIN.