Subscribe Bookmark RSS Feed

recoding & conditional function

I am a recent convert to JMP and SAS from SPSS and am trying to recode data entry errors in script in order to document the decisions and changes made to the data file. I am trying to use conditional functions to do so but am not seeing the anticipated results.

For example, I want to change 888 values to 0 (but keep all other values the same) for a numeric variable 'detainer' and use the following script:

detainer = If(detainer==888,0, detainer);

When I run the script and check the data file for changes, I don't see the change and I don't get an error message.

What am I missing?

Thanks!
3 REPLIES
audrey_shull

Staff

Joined:

Jun 23, 2011

Try this instead:

for each row(
If(detainer==888,detainer=0);
)

In JMP, the "else" case can be omitted if you don't want to do anything.
brilliant -- thank you so much!

is there a guide that would have shown me this? i am trying to get a handle on the scripting language and am at a loss of which reference might be the most help?

thanks again!
audrey_shull

Staff

Joined:

Jun 23, 2011

The JMP Scripting Guide is invaluable if you're trying to get a handle on scripting. If you don't have a hardcopy of it, you can find it under Help->Books->Scripting Guide.