I think it's also worth to mention the dataset option (where=(...)).
It can be used on the "set" dataset as well as on the created dataset.

It can be used in proc sql and a lot of other procs as well. (like all dataset options)