BookmarkSubscribeRSS Feed
MaheshPeesari
Calcite | Level 5
Dear all,
Thanks for u r help in my previous post.when stored process is executing for lomg time i am trying to write a statement to webout like "please wait" using proc template.
[pre]
proc template;
define style styles.oag2;
parent = styles.default;
style StartUpFunction from StartUpFunction /
tagattr = "PleaseWait()";
style Body from Body / prehtml = '<div id="hidepage"
style="position:absolute; height:100%;width:100%;">
<br /><br /><br /><br /><br /> <center>
<b><font face="Arial" color="#000099" size="3">
Your Request is Being Processed, Please Wait . . .
</font></b> <br /><br />
</center> </div>';
end;
run;
ods html body = _webout
style = oag2
headtext = "<script> function PleaseWait()
{if (document.getElementById)
{document.getElementById('hidepage').style.visibility='hidden' } } </script>";
[/pre]

I am trying to generate output in excel format,so when i combine both the code ,its giving me an error as FILE IS IN USE _WEBOUT....
i even checked on support.sas.com ,but still i am unable to resolve ,can you please run the below code and guide me where i am doing wrong....

[pre]
/* %* Set a macro variable that will be used in the title;*/
proc template;
define style styles.oag2;
parent = styles.default;
style StartUpFunction from StartUpFunction /
tagattr = "PleaseWait()";
style Body from Body / prehtml = '<div id="hidepage"
style="position:absolute; height:100%;width:100%;">
<br /><br /><br /><br /><br /> <center>
<b><font face="Arial" color="#000099" size="3">
Your Request is Being Processed, Please Wait . . .
</font></b> <br /><br />
</center> </div>';
end;
run;
ods html body = _webout
style = oag2
headtext = "<script> function PleaseWait()
{if (document.getElementById)
{document.getElementById('hidepage').style.visibility='hidden' } } </script>";
%macro test;
%* Special processing for downloading to Microsoft Excel or Word;
%let OUTPUT_FORMAT = &_ODSDEST;
%if (%upcase(&_ODSDEST) eq HTML2EXCEL) %then %do;
%let _ODSDEST = tagsets.MSOffice2K;
%let OUTPUT_FORMAT = HTML;
%let OLD_HEADER =
%sysfunc(stpsrv_header(Content-type,application/vnd.ms-excel));
%end;
%else %if (%upcase(&_ODSDEST) eq HTML2WORD) %then %do;
%let _ODSDEST = tagsets.MSOffice2K;
%let OUTPUT_FORMAT = HTML;
%let OLD_HEADER =
%sysfunc(stpsrv_header(Content-type,application/msword));
%end;
%else %if (%upcase(&_ODSDEST) eq CHTML) %then
%let OUTPUT_FORMAT = Compact HTML;
%else %if (%upcase(&_ODSDEST) eq PHTML) %then
%let OUTPUT_FORMAT = Plain HTML;

%if (%qcmpres(&OUTPUT_FORMAT) eq )
%then %let OUTPUT_FORMAT=&_ODSDEST;
%stpbegin;
DATA TEST;
X=5;
DO I= 1 TO 10000;
Z=X*I;
OUTPUT;
END;
RUN;
PROC PRINT;
RUN;
%stpend;
%mend test;
%test;
[/pre]
Please help out.
2 REPLIES 2
Vince_SAS
Rhodochrosite | Level 12
Take a look at these documents to see if they simplify things for you:

Usage Note 30889: Displaying the "Please Wait" message for a long-running stored process
http://support.sas.com/kb/30/889.html

Sample 26181: Generating a Please Wait Message
http://support.sas.com/kb/26/181.html

Vince DelGobbo
SAS R&D
mgst170
SAS Employee
Hi,

Solution is to modify the stored process.

From the "SAS Code" window when editing a STP, click the "Include Code For" button. Deselect the option "Stored process macros".

Should work fine after that, and yes, it will still run as a stored proc without these macros.

Cheers.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 8015 views
  • 1 like
  • 3 in conversation