Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- JMP analog to the SAS IN function

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Oct 31, 2019 11:33 AM
(595 views)

All,

Instead of doing a bunch of IF THEN ELSE statements in SAS, I can query whether a value is in a list:

If Color IN ("red", "blue", "green") Then State=1; else State=0;

In JMP formulas, what is the equivalent to the SAS IN() function?

Thanks, Al

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Contains Item() may be the function you want

```
color="red";
contains item(color, {"red", "green", "blue"});
```

returns the value 1.

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP analog to the SAS IN function

While not exactly the same, take a look at the Match function, or possibly, depending on the data and application, the Contains function.

Dan Obermiller

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Contains Item() may be the function you want

```
color="red";
contains item(color, {"red", "green", "blue"});
```

returns the value 1.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP analog to the SAS IN function

Yes, that is the one I meant, not just contains!

Dan Obermiller