"trash it" is not very well defined. There are lots of ways to write technically correct code that will cause a database server to have problems. Chris mentioned one (writing the query so all the data must be passed to the SAS server from the Teradata server). Another one is to write a JOIN that is a Cartesian product (in database terms a "full outer join"). I don't think that SAS will give any sort of warning on that, as it is a legitimate query in certain situations. In addition to I/O time, that one can fill up a disk drive in a hurry. Yet another is to do a join using a field that is not indexed. The database typically has to build the index, do the join, and then delete the index. It can take a lot of time for big tables. I'm not sure how Teradata handles that, but it can really slow down an Oracle query. Sometimes the database can't even build an index and has to slog through multiple tables over and over again to deliver the results (">" or "<" in a join can cause this). SAS provides us with lots of power and EGuide can help by writing technically correct code, but the user still has to think about what he or she is doing. Doc Muhlbaier
... View more