Passing a range to a SAS stored process via URL

Stored processes can be called via the SAS Stored Process Web Application using a URL. Though powerful and useful, the advanced usage concerning ranges requires explanation.


Say you have a program called /path/myprogram on server sasserver, then in your web browser the following URL executes the stored process with the default parameters.


These URLs are handy for a variety of reasons:

  • Linking on static intranet HTML pages, emails, spreadsheets, etc.
  • Bookmarking in a web browser
  • Linking in the results of other, dynamic SAS stored processes
  • Creating custom input forms in HTML

Single parameter

Passing a single parameter is easy using standard web GET parameters. Say in the prompt manager you have a prompt prompt_color and want to pass the value blue, then open


To pre-populate the value blue and let the user change it (or other parameters) in an input form, add &_action=properties.


Range: what does not work

Now what SAS has not documented well is how to pass a range. Say prompt_range accepts an integer range, so you want to pass 0 through 1. This URL


Produces this error

Error setting stored process parameters.
prompt_range: The value “0:1” is not valid.
Specify a valid integer range.

And this URL is derived from the macro variables a range produces (min and max)


Unable to execute stored process.
There is more than one parameter named “prompt_range_min” (possibly in a different case) present.

After guessing led me nowhere, I used the Live HTTP Headers Firefox add-on to analyze how SAS itself communicates the parameters when a user fills out the parameters in the SAS web form. Unfortunately, the web form communicates the values to the server using complicated AJAX, and nothing from this can be learned or used for normal URLs.

Range: the solution

The SAS Stored Processes: Developer’s Guide: Input Parameters gives a veiled hint leading to the proper solution in the section on multiple values. To pass values for a parameter which is a range in a URL, simply repeat the variable: the first instance gives the minimum, and the second the maximum.



One thought on “Passing a range to a SAS stored process via URL

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s