Mindmajix

Using the SAS Stored Process Manager

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.

Screenshot_1504

Using the Stored Process Manager

This demonstration shows how to create, register and run stored processes using SAS Enterprise Guide.

Screenshot_1505

  1. Right-click on One-Way Frequencies task in the Process Flow window and select Create Stored Process….
  2. In Step 1 of the wizard, accept the default name and enter a description and keywords (if desired).

Screenshot_1506

SelectScreenshot_1212

      3. In Step 2, select Screenshot_1507 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:

Screenshot_1508

Select Screenshot_1207

Screenshot_1509

SelectScreenshot_1212

      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).

Screenshot_1510

SelectScreenshot_1212

      8. Accept the defaults in Step 4.

Screenshot_1511

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.

SelectScreenshot_1212

      9. Accept the defaults in Step 5 since this stored process has no parameters.

Screenshot_1512

If parameters were needed to run this stored process, they would be added in this step. SelectScreenshot_1212

      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.

Screenshot_1513

SelectScreenshot_1212

      11. In Step 7, verify that the information is correct:

Screenshot_1514

SelectScreenshot_1252

      12. A message window displays indicating the stored process was successfully saved:

Screenshot_1515

SelectScreenshot_1483

      13. The stored process is now part of the project:

Screenshot_1516

      14. Open the Stored Process List window to see this new stored process by selecting View ÐStored Process List.

Screenshot_1517

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 Screenshot_1518. The code is displayed and added to the

Screenshot_1519

      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.

Screenshot_1520

SelectScreenshot_1212

      20. In Step 2, verify that the location is //Foundation/Training and selectScreenshot_1212

Screenshot_1521

      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 selectScreenshot_1212

Screenshot_1522

      22. In step 4, the wizard can help build parameters based on macro variables in the code.

          a. SelectScreenshot_1523then 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.

Screenshot_1524

          f. Select the Constraints tab to limit the possible choices for this parameter.

  1. Select Integer range as the type of constraint.
  2. Click the boxes to provide values for the Minimum, Maximum, and Increment options.
  3. Set the value of Minimum to 1.
  4. Set the value of Maximum to 10000.
  5. Set the value of Increment to 5.

Screenshot_1525

SelectScreenshot_1388

        g. This parameter is saved and a message window opens, notifying you that no additional macro variables have been located in the code:

 
   

Screenshot_1526

Select Screenshot_1483

The information about the num parameter is displayed:

Screenshot_1527

SelectScreenshot_1212

       23. For Step 5, verify that Streaming output is selected, then chooseScreenshot_1212

Screenshot_1528

      24. For Step 6, review the settings and select Screenshot_1223

Screenshot_1529

      25. A confirmation window appears:

Screenshot_1530

SelectScreenshot_1483

      26. A message may appear:

Screenshot_1531

Select Screenshot_1532 to update the code task.

      27. The new stored process has been added to the project and the Stored Process List window.

Screenshot_1533

      28. In the Process Flow window, right-click on the new stored process and select Run this Stored Process.

Screenshot_1534

      29. A dialog window opens requesting a value for the parameter num. Enter 8 then select Screenshot_1502

Screenshot_1535

      30. The HTML report appears:

 
   

Screenshot_1536

 

 

 

 

 

 

 

 


 

0 Responses on Using the SAS Stored Process Manager"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.