Your SAS programs, embedded in web apps and elsewhere

SAS Stored Process "Please Wait" Message

Reply
Contributor
Posts: 53

SAS Stored Process "Please Wait" Message

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;

Frequent Contributor
Posts: 148

Re: SAS Stored Process "Please Wait" Message

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.

Contributor
Posts: 53

Re: SAS Stored Process "Please Wait" Message

Thanks for the reply Don -- yes I am using SAS 9.4 I'll try and look up the note.

Contributor
Posts: 53

Re: SAS Stored Process "Please Wait" Message

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 :/

Frequent Contributor
Posts: 148

Re: SAS Stored Process "Please Wait" Message

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.

PROC Star
Posts: 1,232

Re: SAS Stored Process "Please Wait" Message

[ Edited ]

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.

Frequent Contributor
Posts: 148

Re: SAS Stored Process "Please Wait" Message

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;

Ask a Question
Discussion stats
  • 6 replies
  • 420 views
  • 1 like
  • 3 in conversation