When running the SAS® Stored Process Server and executing a Stored Process using the %STPBEGIN macro or ODS statements and also attempting to explicitly write to "_webout", you will receive the following error message in your SAS log file:
ERROR: File is in use, .
If you have a SAS DATA step that explicitly writes to "_webout", you can eliminate this problem by not enclosing the DATA step with %STPBEGIN and %STPEND statements or ODS statements.
The example below illustrates a scenario that would cause the problem.
%stpbegin;
data _null_;
file _webout;
put '<HTML>';
put '<H1>Hello World</H1>';
put '</HTML>';
run;
%stpend;
You can eliminate the problem by removing the "%STPBEGIN;" and "%STPEND;" statements.
The same error message will occur if you use ODS rather than the %stpbegin macro. For example, the below code will cause the same error message.
ods html body=_webout;
data _null_;
file _webout;
put '<HTML>';
put '<H1>Hello World</H1>';
put '</HTML>';
run;
ods html close;
If you are using SAS® Enterprise Guide® 3, then you need to deselect "Include macros" for your stored process by following these steps.
1.) In SAS Enterprise Guide, click the Stored Process to be executed.
2.) On the "Stored Process Manager" screen, select "Execution Environment."
3.) On the "Execution Environment" screen, click the "Preview code" selection in the lower left corner of the screen. This will cause the "SAS Code Editor" to pop up.
4.) On the "SAS Code Editor" screen, select "Edit Mode" (rather than "View mode"). Then, deselect the "Include Macros" item at the top of the screen.
5.) Then, click "Save and Run"
If you are using SAS Enterprise Guide 4, then you need to deselect "Include macros" for your stored process by following these steps.
1.) Click the icon for your Stored Process to bring up the Stored Process Manager.
2.) On the Stored Process Manager page, click "SAS Code"
3.) On the "SAS Code" window, click the "Include code for" button at the bottom of the window. Uncheck the box for "Stored process macros". Save the code.
4.) Submit the stored process. If SAS Enterprise Guide asks, "Would you like to turn on the append macros settting", then click "NO".