The answer to this question is B but I do not see where B is wrong. Also, I do not understand why A is not wrong since difference is not defined after the first if statement.
Please help!
I chose A but the answer is B
It is important to read the question carefully so you can answer the question that is actually being asked.
The first data step will NOT cause SAS to write an ERROR message. The syntax is valid. That does not mean the program is doing the right thing, but that is not what is being asked. Also the question does not provide enough information to determine if the logic is correct.
The second data step will generate an error because BETWEEN is not valid in a data step outside of a WHERE statement or a WHERE= dataset option.