Hi all,
I am comparing App_address, Sup_address, Original_address and Current_address. I want to find if the title in all the four dataset is blank then 0 and if any one of the dataset have a title then flag it as 1. I am trying the below code but it is showing error. Can you please suggest?
data Title_comparison;
set App_address Sup_address Original_address Current_address;
if App_address: title ne "" or Sup_address: title ne "" or Original_address: title ne "" or Current_address: title ne "" then do;
flag = 1;
end;
else flag = 0;
run;
Error log:
29 data Title_comparison;
30 set App_address Sup_address Original_address Current_address;
31
32 if App_address: title ne "" or Sup_address: title ne "" or Original_address: title ne "" or Current_address: title ne ""
_
22
76
32 ! then do;
ERROR 22-322: Syntax error, expecting one of the following: <, <=, =, >, >=, EQ, GE, GT, IN, LE, LT, NE, NG, NL, NOTIN, ^=, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
33 flag = 1;
34 end;
___
161
ERROR 161-185: No matching DO/SELECT statement.
35 else flag = 0;
36 run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TITLE_COMPARISON may be incomplete. When this step was stopped there were 0 observations and 32
variables.