Hi:
Normally, to do what you want, you would use the ODS TEXT= statement, as described in these previous forum postings:
http://support.sas.com/forums/thread.jspa?messageID=6151᠇
http://support.sas.com/forums/thread.jspa?messageID=848͐
The way that ODS TEXT= works needs to change a bit for your stored process. In "regular" SAS, you would do this:
[pre]
ods html file='somefile.html' style=sasweb;
ods html text='before proc 1';
proc print data=sashelp.class;
run;
ods html text='before proc 2';
proc freq data=sashelp.shoes;
tables region;
run;
ods html close;
[/pre]
However, when you turn that program into a stored process, each client application could possibly set %stpbegin for a different destination for returning results. For example, in Microsoft Word, the user could change the result type from a stored process to be: SASReport, HTML or RTF -- you need your ODS TEXT= statement to work for ANY destination the users pick. So, when you convert the above program to be a stored process, you would have to use &_ODSDEST instead of HTML for the TEXT= statement:
[pre]
%stpbegin;
ods &_odsdest text='before proc 1';
proc print data=sashelp.class;
run;
ods &_odsdest text='before proc 2';
proc freq data=sashelp.shoes;
tables region;
run;
%stpend;
[/pre]
Also, keep in mind that some client applications may not make use of the ODS TEXT= string -- so a good idea would be to test your stored process on all client applications from which it might be submitted. In order to add the ODS &_ODSDEST TEXT= statement, you will have to edit the stored process code by selecting OPEN from the SAS Folder list and then editing the code. If you do not have sufficient authorization to edit or change stored process code, then you will have to get an administrator help you make the change.
cynthia
PS -- an afterthought -- have you tried just adding a second title statement before your second proc sql???
[pre]
%stpbegin;
title 'first proc sql';
proc sql;
select *
from sashelp.class
where age gt 15;
quit;
title 'second sql';
proc sql;
select *
from sashelp.shoes
where region = 'Asia' and
subsidiary = 'Bangkok';
quit;
%stpend;
[/pre]