You can either use a one line conditional of the form IF (condition) d = 12.
or a multiple line DO IF
. Below I provide an example of DO IF
adapted to your syntax.
data list free / id MODC Modc_initial.
begin data
1 3 3
2 3 5
12 1 1
end data.
LOOP if (id LT 10).
DO IF (Modc_initial EQ MODC).
COMPUTE d = 12.
END IF.
END LOOP IF (d = 12).
EXECUTE.
Note you had a period missing in your original syntax on the initial LOOP
. I also added an end loop condition, otherwise the code as written would just go until the maximum set number of loops per your system.