Sample 43723: Submitting a SAS® Stored Process request in an HTML Frame and displaying the output in another HTML Frame
This sample SAS Stored Process illustrates an approach to submit
a request in one HTML frame and display the output in another
HTML frame. The sample code on the Full Code tab produces output that is similar to the following:
Here is a summary of the functionality.
- When you execute the Frame_Example.sas SAS Stored Process code,
it creates an HTML page that contains two HTML frames.
- The first HTML frame automatically submits a second SAS Stored
Process request that creates the selection list (in the left frame
above) that is used to submit a request.
- When you submit a request, a SAS Stored Process is executed
and the output is displayed in the second frame (the right
frame above).
Notes:
- This SAS Stored Process must be executed using the SAS Stored Process Web Application or the SAS® Information Delivery Portal.
- When you define the SAS Stored Process, it must produce Stream
output (and not Package output).
- If you execute this stored process using the SAS Information Delivery Portal, then you must use a URL Display Portlet.
- You should be able to run this SAS Stored Process code without making
any modifications.
- Another approach that can be used to display SAS Stored Process output
in an HTML frame is to create an HTML or JSP file and store it on
your Application Web Server. The HTML code (that contains the frames)
would be similar to the HTML code that is created by this example SAS Stored Process.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample SAS
®
Stored Process illustrates an approach to submit
a request in one HTML frame and display the output in another
HTML frame.
/*********************************************************************/
/* */
/* Name: Frame_Example.sas */
/* */
/* Purpose: Submit a stored process request in one HTML Frame and */
/* display the output in another HTML Frame. */
/* It also creates a dynamic selection list. */
/* */
/* Note: You should not need to modify this code. */
/* */
/*********************************************************************/
*ProcessBody;
%macro main;
%global reqtype _odsstyle;
%macro first_request;
/* This is the first request. Create an HTML page with Frames. */
data _null_;
file _webout;
thissrv = symget('_url');
thispgm = urlencode(symget('_program'));
put '<html>';
put '<table>';
put '<tr>';
put '<td width="20%">';
put '<iframe name="frame1" scrolling="no" width="100%" height="600" src="'
thissrv +(-1) '?_program=' thispgm +(-1)
'&reqtype=create_selection&_debug=0">';
put '</iframe>';
put '</td>';
put '<td width="80%">';
put '<iframe name="frame2" width="100%" height="600" >';
put '</iframe>';
put '</td></tr>';
put '</table>';
put '</html>';
run;
%mend first_request;
%macro create_selection;
/* This is the Second Request. Create the Selection Memu. */
/* Get age groups */
proc summary data=sashelp.class;
class age;
output out=summary;
run;
data _null_;
set summary end=alldone;
file _webout;
if _n_ = 1 then do;
thissrv = symget('_url');
thispgm = symget('_program');
put '<html>';
put '<h3>Student Report</h3>';
put '<FORM ACTION="' thissrv +(-1) '" method=get target="frame2">';
put '<input type="hidden" name="_program" value="'
thispgm +(-1) '">';
put '<input type="hidden" name=reqtype value="report">';
put '<b>Select Age: </b>';
put '<select name="age">';
end;
if age ne . then do;
put '<OPTION VALUE="' age '">' age;
end;
if alldone then do;
put '</select>';
put '<br><br>';
put '<input type="submit" value="Submit">';
put '</form>';
put '</html>';
end;
run;
%mend create_selection;
%macro create_report; /* Produce the report */
%let _odsstyle=BarrettsBlue;
%stpbegin;
Title "Students who are age &age";
proc print data = sashelp.class noobs;
where age = &age;
run;
%stpend;
%mend create_report;
%if "&reqtype" = "create_selection" %then %do;
/* Produce the Selection Menu */
%create_selection;
%end;
%else %if "&reqtype" = "report" %then %do;
/* Produce the Report */
%create_report;
%end;
%else %do;
/* Produce the HTML page that contains Frames */
%first_request;
%end;
%mend main;
%main;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample SAS Stored Process illustrates an approach to submit a request in one HTML frame and display the output in another HTML frame.
Date Modified: | 2011-07-18 10:30:59 |
Date Created: | 2011-07-12 16:03:48 |
Operating System and Release Information
SAS System | SAS Integration Technologies | z/OS | 9.2 TS2M3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M3 | |
Microsoft® Windows® for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | |
Microsoft Windows XP Professional | 9.2 TS2M3 | |
Windows 7 Enterprise 32 bit | 9.2 TS2M3 | |
Windows 7 Enterprise x64 | 9.2 TS2M3 | |
Windows 7 Home Premium 32 bit | 9.2 TS2M3 | |
Windows 7 Home Premium x64 | 9.2 TS2M3 | |
Windows 7 Professional 32 bit | 9.2 TS2M3 | |
Windows 7 Professional x64 | 9.2 TS2M3 | |
Windows 7 Ultimate 32 bit | 9.2 TS2M3 | |
Windows 7 Ultimate x64 | 9.2 TS2M3 | |
Windows Vista | 9.2 TS2M3 | |
Windows Vista for x64 | 9.2 TS2M3 | |
64-bit Enabled AIX | 9.2 TS2M3 | |
64-bit Enabled HP-UX | 9.2 TS2M3 | |
64-bit Enabled Solaris | 9.2 TS2M3 | |
HP-UX IPF | 9.2 TS2M3 | |
Linux | 9.2 TS2M3 | |
Linux for x64 | 9.2 TS2M3 | |
Solaris for x64 | 9.2 TS2M3 | |