Recoding a variable based on a list or set of values?

Viewed 543

Is there syntax in SPSS that looks in a list or set of values? I have been unable to find a syntax that will use a list/set as reference.

One use example is recode;

DATASET ACTIVATE DataSet1.
STRING V2 (A8).
RECODE V1 ('a' = 'group1') ('b' = 'group1') ('c' = 'group1') INTO V2.
EXECUTE.

Instead of typing each value like above, I would to use an function like the SQL IN, if it exists.

Logic:

if V1 IN (a,b,c,e...) then V = "group1"...

Thank you!

1 Answers
Related