The following instructions enable you to create dynamic parameter values for a SAS® Stored Process.
When defining a SAS Stored Process in SAS® Management Console, you can define parameters for the SAS Stored Process, but any parameter values must be static values.
The example in this SAS Note illustrates an approach for creating dynamically–generated parameter values for a SAS Stored Process. This approach can also be used to dynamically create essentially any HTML page as a front end for submitting a request to a SAS Stored Process.
Another related example is available at Chaining Stored Processes.
Here are some notes:
However, you can execute this SAS Stored Process using SAS® Enterprise Guide® or the SAS® Add–In for Microsoft Office (for example) if you do the following:
/************************************************** This SAS Stored Process provides an example of creating an HTML page with dynamically-generated parameter values. This HTML page is then used to submit a request to the stored process using the parameter value that was selected. **************************************************/ %macro main; %global reqtype; %macro first_request; /* Initial request for user */ /* 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 '<br>'; put '<h2>Example of dynamicaly-generated parameter values</h2>'; put '<FORM ACTION="' thissrv +(-1) '" method=get>'; put '<input type="hidden" name="_program" value="' thispgm +(-1) '">'; put '<input type="hidden" name=reqtype value="report">'; put '<br>'; 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 Request">'; put '</form>'; put '</html>'; end; run; %mend first_request; %macro report; /* Produce report for user */ %stpbegin; Title "Students who are age &age"; proc print data = sashelp.class noobs; where age = &age; var name age sex; run; %stpend; %mend report; %if "&reqtype" = "report" %then %do; %report; /* Produce a report */ %end; %else %do; /* Produce HTML page with parameter values for selection */ %first_request; %end; %mend main; %main;
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS Integration Technologies | Microsoft Windows XP Professional | 9.1 TS1M3 SP1 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP1 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP1 | |||
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP1 | |||
Microsoft Windows NT Workstation | 9.1 TS1M3 SP1 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP1 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP1 | |||
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP1 | |||
Microsoft Windows 2000 Server | 9.1 TS1M3 SP1 | |||
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP1 | |||
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP1 | |||
64-bit Enabled Solaris | 9.1 TS1M3 SP1 | |||
64-bit Enabled HP-UX | 9.1 TS1M3 SP1 | |||
z/OS | 9.1 TS1M3 SP1 | |||
HP-UX IPF | 9.1 TS1M3 SP1 | |||
Linux | 9.1 TS1M3 SP1 | |||
Linux on Itanium | 9.1 TS1M3 SP1 | |||
OpenVMS Alpha | 9.1 TS1M3 SP1 | |||
64-bit Enabled AIX | 9.1 TS1M3 SP1 | |||
Tru64 UNIX | 9.1 TS1M3 SP1 |
Type: | Usage Note |
Priority: | |
Topic: | System Administration ==> Servers ==> Integration Technologies |
Date Modified: | 2009-11-11 17:06:10 |
Date Created: | 2007-02-01 15:42:27 |