I've been trying to get an else if function to work but I'm having no luck.
If I run the program "shark" test2 will be replaced with "T" unconditionally ie. even if test is not equal to "T". What is going wrong?
The intention is that if test is equal to T then test 2 in the same row will be set to T. Otherwise test 2 on the same row will be set to NOT T
program shark
if test == "T" {
replace test2 = "T"
}
else {
replace test2 = "NOT T"
}
end
if test == "T" {
replace test2 = "T"
}
else {
replace test2 = "NOT T"
}
end
The intention is that if test is equal to T then test 2 in the same row will be set to T. Otherwise test 2 on the same row will be set to NOT T
Comment