我正在寻找SPSS中的IF条件语法。我有2个变量,一个是IND,另一个是代码:
IND (String) Code (String) i want final var as below
retail retail
finance 5411 5411
education - education
transportation 4491 4491
consulting 8711 8711
insurance - insurance
finance - finance
other 4813 4813
两者都是字符串变量。代码为空的地方,我想要IND变量的数据。我怎么能这样做?
答案 0 :(得分:3)
您正在寻找do if
结构。请参阅添加的示例代码:
string final_var (a50).
do if code = "0000" or code = "".
comp final_var = ind.
else.
comp final_var = code.
end if.
exe.