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.
Notes:
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.
/*********************************************************************/
/* */
/* 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.
Type: | Sample |
Date Modified: | 2011-07-18 10:30:59 |
Date Created: | 2011-07-12 16:03:48 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
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 |