Using the SAS Stored Process Manager
Recommended by 0 users
Stored Process Manager
SAS Enterprise Guide provides a wizard named the Stored Process Manager that guides the user through the steps of creating a stored process.
The wizard automatically
- adds the %STPBEGIN and %STPEND statements
- saves the code in the stored process code repository
- registers the stored process in the metadata repository.
SAS Enterprise Guide is the preferred way to develop and test stored processes in SAS®9 because, you can create and test the program in one application.
Stored processes can be created from a variety of sources, including
- tasks that have been added to the project
- existing SAS programs.
SAS Enterprise Guide uses the Create New Stored Process Wizard.
Using the Stored Process Manager
This demonstration shows how to create, register and run stored processes using SAS Enterprise Guide.
- Right-click on One-Way Frequencies task in the Process Flow window and select Create Stored Process….
- In Step 1 of the wizard, accept the default name and enter a description and keywords (if desired).
3. In Step 2, select to select the repository on the metadata server to store the stored process metadata item.
4. Expand the Foundation repository, and select the Training group:
5. In Step 3, set the Execution server to SASMain – Logical Stored Process Server – SAS Stored Process Server – 9.1.
6. Select the Source file path of C:\Workshop\winsas\sbiovr\StoredProcesses.
7. Accept the default source filename (this is the file that is being created for you by the SAS Enterprise Guide Stored Process Wizard).
8. Accept the defaults in Step 4.
This window shows the LIBNAME statement that will be added to the new program in order to access the source table. By default, these are set up using the Metadata Libname Engine.
9. Accept the defaults in Step 5 since this stored process has no parameters.
If parameters were needed to run this stored process, they would be added in this step. Select
10. Step 6 allows you to choose how the output will be packaged. Select Streaming output, since the results of this stored process will be streamed back to the application that is was called from.
11. In Step 7, verify that the information is correct:
12. A message window displays indicating the stored process was successfully saved:
13. The stored process is now part of the project:
14. Open the Stored Process List window to see this new stored process by selecting View ÐStored Process List.
Create a Stored Process from an Existing Program
The Stored Process Manager in SAS Enterprise Guide can be used to create a stored processes from existing SAS code. The wizard will scan the code for macro variables and lead you through a process of creating parameters from them. This greatly simplifies the process of creating stored processes from legacy code. To begin, add the existing program to the project.
15. Select File Ð Open Ð From My Computer….
16. Navigate to C:\Workshop\winsas\sbiovr and select customerlist.sas:
Select . The code is displayed and added to the
17. Remove %let num=20; from the code.
18. Right-click on this new code node and select Create Stored Process. The Stored Process Wizard opens.
19. In Step 1, accept the default Name and specify a Description of Generated by Enterprise Guide.
20. In Step 2, verify that the location is //Foundation/Training and select
21. In Step 3, verify that the execution server is SASMain – Logical Stored Process Server – SAS Stored Process Server – 1, the source file path is C:\Workshop\winsas\sbiovr\StoredProcesses, accept the default source filename and select
22. In step 4, the wizard can help build parameters based on macro variables in the code.
a. Selectthen Parameters from SAS Code.
b. Change the text of User prompt to Number of Records.
c. Select Integer as the Data type.
d. Enter a Default Value of 10.
e. Select the Required Option.
f. Select the Constraints tab to limit the possible choices for this parameter.
- Select Integer range as the type of constraint.
- Click the boxes to provide values for the Minimum, Maximum, and Increment options.
- Set the value of Minimum to 1.
- Set the value of Maximum to 10000.
- Set the value of Increment to 5.
g. This parameter is saved and a message window opens, notifying you that no additional macro variables have been located in the code:
The information about the num parameter is displayed:
23. For Step 5, verify that Streaming output is selected, then choose
24. For Step 6, review the settings and select
25. A confirmation window appears:
26. A message may appear:
Select to update the code task.
27. The new stored process has been added to the project and the Stored Process List window.
28. In the Process Flow window, right-click on the new stored process and select Run this Stored Process.
29. A dialog window opens requesting a value for the parameter num. Enter 8 then select
30. The HTML report appears: