user10265653
user10265653

Reputation:

SPSS - calculate new variable from two string using if-then

I need to develop a statement that will pull string values from two col based on their values and missing values. For example.

I know this is a simple statement, but I can't seem to figure it out today.

Upvotes: 1

Views: 175

Answers (1)

eli-k
eli-k

Reputation: 11310

This should do it:

string new_var(a20).
if (COL_A<>"" and COL_B<>"") or COL_B="" new_var=COL_A.
if new_var="" and COL_B<>"" new_var=COL_B.

Upvotes: 0

Related Questions