Choose Language Hide Translation Bar
Highlighted
albest3
Community Trekker

JMP analog to the SAS IN function

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

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
MathStatChem
Community Trekker

Re: JMP analog to the SAS IN function

Contains Item() may be the function you want

 

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

returns the value 1.  

View solution in original post

3 REPLIES 3

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
MathStatChem
Community Trekker

Re: JMP analog to the SAS IN function

Contains Item() may be the function you want

 

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

returns the value 1.  

View solution in original post

Re: JMP analog to the SAS IN function

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

Dan Obermiller
0 Kudos