Select using is not null

This was an issue noted by my colleague Tim Chevalier: Teradata does not like the "!= NULL" and "=NULL" style syntax, and so he added a gsub statement here, which replaces that with "IS NOT NULL" or "IS NULL", as appropriate.