BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wsdabreu
Obsidian | Level 7

I'm trying to execute the following sample in VA, but i'm receiving the error: ERROR: File is in use, _WEBOUT . I've tried SAS suggestions but it didn't work, someone has another tip?

 

The Code:

 

/* **************************************************************************************
*  Description:  This stored process creates an html form that then calls a Target stored process
*
*  Inputs:   Two parameters are created from the sashelp.class table: Make and Type
*
*  Outputs:  The submist button call the stored process defined in _program
*
*  NOTE:  You must change the path of the target stored process if the target stored 
*         process is located in a different location in the SAS Management Console
*
**************************************************************************************** */


data _null_;
file _webout;
put '<HEAD><TITLE>HTML Form Example Using Streaming Output</TITLE></HEAD>';
put '<FONT face=Arial size=2 COLOR="#000000">&nbsp;<B>HTML Form Example Using Streaming Output</B></FONT>';
put '<BR><BR>';
put '<FORM action="/SASStoredProcess/do">';
put '<INPUT name="_program" type=hidden value="/Shared Data/Stored Processes/Target(StoredProcess)">';
put '<INPUT name=_debug type=hidden value=0>';
run;

/* ************************************************* */
/* Get a list of car MAKES to populate the list with */
/* ************************************************* */
data _null_;
file _webout;
put '<font face=verdana size=-2>&nbsp;Select Car Make:</FONT>';
put '<SELECT NAME=Make SIZE=1 style="font:10pt arial">';
run;

/* create a unique list of car makes */
proc sort data = sashelp.cars out=work.cars (keep=make) nodupkey;
by make;
run;


data _null_; 
file _webout;
length str $200;
set work.cars;
if _n_=1 then str='<OPTION selected value='||strip(make)||'>'||strip(make)||'</OPTION>';
else str='<OPTION value='||strip(make)||'>'||strip(make)||'</OPTION>';
put str;
run;


/* ************************************************* */
/* Get a list of car TYPES to populate the list with */
/* ************************************************* */
data _null_;
file _webout;
put '</Select><br><br>';
put '<font face=verdana size=-2>&nbsp;Select Car Type:</FONT>';
put '<SELECT NAME=type SIZE=1 style="font:10pt arial">';
run;

/* create a unique list of car makes */
proc sort data = sashelp.cars out=work.cars (keep=type) nodupkey;
by type;
run;


data _null_; 
file _webout;
length str $200;
set work.cars;
if _n_=1 then str='<OPTION selected value='||strip(type)||'>'||strip(type)||'</OPTION>';
else str='<OPTION value='||strip(type)||'>'||strip(type)||'</OPTION>';
put str;
run;

data _null_;
file _webout;
put '</select><br><br>';
 put '&nbsp;&nbsp;<INPUT name=B1 type=submit value=Submit>&nbsp;&nbsp;';
put '<INPUT name=B2 type=reset value=Reset>';

put '</FORM>';
put '<BR><BR>';
run;
1 ACCEPTED SOLUTION

Accepted Solutions
FredrikE
Rhodochrosite | Level 12

Hi!

You need to disable the automatic macros "%STPBEGIN" and "%STPEND" when you use file _webout.

//Fredrik

View solution in original post

2 REPLIES 2
FredrikE
Rhodochrosite | Level 12

Hi!

You need to disable the automatic macros "%STPBEGIN" and "%STPEND" when you use file _webout.

//Fredrik

wsdabreu
Obsidian | Level 7

Do you know where is the option to perform this operation? in the "summary" tab when I select "show full sas code" option, there is no way to edit the prompt.

Edit: I found the option it is in the "SAS Code" tab, then press the button "Include code for" and disable the "Stored process macros".

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1427 views
  • 3 likes
  • 2 in conversation