I've been using Don Henderson's "please wait" example macro (http://www.sascommunity.org/wiki/Generating_Descriptive_Please_Wait_Messages_for_Long_Running_Stored...)
One issue I'm having is that the "Step 1, 2, 3 Completed.." message is not overwriting the previous message. So in other words when the stored process is completed I still see all of the previous "please wait" messages.
I'm wanting to overwite each one of those messages and just display the final result when the stored process is completed. I've tried to wrap the output in %stpbegin and %stpend, but so far no luck.
For example:
Did not work:
%stpbegin;
%PleaseWaitExample;
%stpend;
A couple of questions.
Are you trying to run the example from the link? If so, is that what is not working?
What release of SAS are you using? The html/javascript that hides the previous messages is written using ODS HTML text= and I have seen issues with how such messages are being written by ODS in 9.4. If that is the issue, I believe there is a tech note about that. I can try to find that. I also have the proc template code that Technical Support provide that might help.
Thanks for the reply Don -- yes I am using SAS 9.4 I'll try and look up the note.
I found the thread -- https://communities.sas.com/t5/SAS-Stored-Processes/STP-javascript-generation-9-3-vs-9-4/td-p/261573
Not as elegant as your original design but it works 😕
Quentin's solution works. But i was thinking of another thread that was not specific to the "Please Wait" example.
I worked with TS on a related issue where JavaScript written by ODS HTML TEXT= was not working. TS provided some template code so the generated tags did not include table tags. That restored the JavaScript functionality.
I don't have access to that code right now as it is at a client site. But I will check with TS about it and hopefully he can post it here.
By running that code and using the template it creates, I suspect the Please Wait routine will work as is.
I ended up switching to use PROC ODSTEXT in 9.4, which does not get put inside a <TA BLE> tag, something like:
proc odstext; p "<span id=""pleaseWait""> &message <p> <img src=""/SASStoredProcess/images/progress.gif""> </span> " ; run;
But I like Don's idea of modifying the template to allow continued use of ODS HTML text. That would be helpful to avoid rewriting some of my legacy code.
I found the proc template code that allows this to work. Note however that the macro source needs to be updated to replace:
ods html text = ' ';
with
ods tagsets.html4 text = ' ';
That is the only needed change.
Here is the proc template code that I got to work. Note that I freely acknowledge that I am not at all at expert in PROC TEMPLATE. This code was originally provided to me by Tech Support for a related issue. And I was able to tweak it for this example.
ods path work.tmplmst(update) sashelp.tmplmst(read);
proc template;
edit tagsets.html4;
define event text;
start:
trigger rowcol;
trigger cell_value;
finish:
trigger cell_value;
end;
end;
run;
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 25. 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.