Your SAS programs, embedded in web apps and elsewhere

File is in use _webout

Reply
Contributor
Posts: 38

File is in use _webout

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.
SAS Super FREQ
Posts: 304

Re: File is in use _webout

Posted in reply to MaheshPeesari
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
SAS Employee
Posts: 11

Re: File is in use _webout

Posted in reply to MaheshPeesari
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.
Ask a Question
Discussion stats
  • 2 replies
  • 2770 views
  • 1 like
  • 3 in conversation