BookmarkSubscribeRSS Feed
chris_lampron
Fluorite | Level 6

I am currently working on developing a stored process in SAS Enterprise Guide 5.1 on Windows 7 Operating System that allows users to select multiple items from a listbox.  Once the values are selected I would like the form to chain to another stored process that will use the values that were selected in the listbox.

 

I am having difficulty creating a variable that contains the values selected by the user.

 

I have used the following code and can get the multiple select to work, but when I print the results, only the first value selected is printed.

 

The code is written in HTML and I am wondering if there is some Javascript that I would need to add in order for the selected values to be brought together into a single variable.

 

<select size=3 id=multilistbox multiple="multiple">
	<option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
</select>

Any help would be appreciated.

 

Thank you.

1 REPLY 1
boemskats
Lapis Lazuli | Level 10

Hi Chris,

 

There are a couple of things - I think you need to make sure that your HTML is a form element that you submit, that you are executing your STP via the STP Web App, and that the STP itself is configured to run on a Stored Process server rather than a Workspace Server. If that's the case, if you add &_debug=131 to the end of your URL, you should see the selected values being passed to sas as multiple called &multilistbox1, &multilistbox2, etc. 

 

More info in the Multiple Values section of the SAS docs here, it explains it a lot better. It's quite straightforward. You will also be able to debug the parameters sent to the STP Web App via your browser's debug console, if you're familiar with that.

 

Nik

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 847 views
  • 0 likes
  • 2 in conversation