Developing Stored Processes with Package Results

Overview

Before SAS 9.2, when the user created a stored process by using SAS Management Console and chose to create permanent package results, there was a Permanent Package Details dialog box for providing the required information.
Starting with SAS 9.2, the Permanent Package Details dialog box has been removed and the user is now responsible for providing this information by using the new prompt framework instead. A set of shared prompt groups that contain this information has been created for convenience.
If you have stored processes that were created in SAS 9.1.3 with package results, you can migrate or promote these to SAS 9.3. Any necessary hidden prompts are created automatically by the import process.

Create Permanent Package Results

To create a stored process with a permanent result package, perform the following steps:
  1. In the New Stored Process wizard, when you are defining the stored process, select the Package check box to specify result capabilities for the stored process.
    Execution page
  2. On the Parameters page of the New Stored Process wizard, click Add Shared to load one of the predefined shared prompt groups for package result parameters.
  3. In the Select a Shared Group or Prompt dialog box, navigate to the Products/SAS Intelligence Platform/Samples/ folder. Select the appropriate shared prompt group. The names of these all begin with Package. Some of these are SAS server specific (that is, stored process server versus workspace server). So if you chose a stored process server as the SAS server, you should choose a prompt group ending in (STP Servers).
    In the Add Prompt dialog box, click OK to accept the prompt group displayed text. You have included a reference to the shared prompt group in your stored process. You are not currently allowed to edit the shared prompts.
  4. The prompts must be unshared to make them editable. To unshare the prompts, select the prompt group (for example, Package — File System with Archive Name), and click Unshare.
    Parameters page
    Click Yes to continue. This operation gives you your own copy of the data from the shared prompt group, so you can modify it.
  5. If you have not already done so, expand the prompt group to display its members. Double-click the first prompt to open it.
    General tab for _RESULT prompt
    In this example, for the _RESULT prompt, the comment in the Description field tells you Do not modify. Close the Edit Prompt dialog box without modifying the prompt.
  6. Open the remaining prompts in the group. In this example, _ARCHIVE_PATH is next.
    General tab for _ARCHIVE_PATH prompt
    No changes are needed for the General tab. The description text tells you what type of value needs to be supplied for this prompt.
    Click the Prompt Type and Values tab.
    Prompt Type and Values tab
    Notice that the Default value needs to be supplied (as indicated by the text Supply_Valid_Value). Set it to a valid value (for example, a physical path on the file system such as C:\temp). Click OK to accept changes and close the prompt.
  7. Repeat this process for the remaining prompts in the group, examining prompt properties, and making necessary changes.
  8. Click Next in the New Stored Process wizard if you have data sources or data targets to define. Otherwise, click Finish.
  9. Create the SAS program and save it. Use the source filename and source code repository path that you specified in the New Stored Process wizard.
  10. When the stored process is executed, the prompts in the prompt group remain hidden, and the user does not see them. The default values that you specified when you edited them are supplied to the server. If you want to show the prompts at run time, then you need to make the prompt group visible. Make any or all of the prompts visible by deselecting the Hide from user check box for each prompt and prompt group.
The SAS code in the previous step writes a SAS package file under the C:\temp folder. This package can be opened with WinZip. This content is also returned back to the calling client as HTML.

Creating Transient Package Results

If transient package results are desired, select Package as the result capability in the New Stored Process wizard. None of the special shared prompt groups needs to be added to the stored process. The SAS code returns the package content to the caller when the stored process is executed, but it is not to be written or published to any of the permanent destinations.