Joined: 31 Oct 2006 Posts: 968 Location: Richmond, Virginia
IF COL1 EQ 'ABC';
is called a subsetting IF. Only obs for which it is true continue with the next line; others resume at the top with the next obs.
IF COL1 EQ 'ABC'
THEN COL2 = '345';
This line runs for all obs, and only the ones passing the test have COL2 changed. Alll then continue to be written to the output.
This is a nice feature of SAS, but also an excellent example of the dangers lurking in SAS. What would be a syntax error in other languages (the ";" after the condition) is good SAS syntax, with the meaning I described.