I dont have hard evidence for this and it might also fall under the category of "your mileage might vary", but given the gains in processing power and memory, SAS is almost always bottle necked at I/O (ie writing info to disk, temporary or permanently). Given this the less writing to disk you do the better, so sub queries should reduce some of the I/O. I have seen this in my case (complex queries from relational databases) but as mention by it probably depends on what the task is. Some of our more complex queries are made because we are writing / verify queries for a SQL Server Application our Developers are making, which means the query needs to be as platform independent as possible (ie no data steps or procs). I would say even after 10 years of writing SQL code in SAS, I rarely start off building a complex query directly but build the pieces and see if it makes sense to combine, just because I find it easier to track down where I have gone wrong that way. I do believe there is a trade off between readablilty of the code and using highly complex SQL queries (4 or more levels deep). I would be interested in hearing others comments. EJ
... View more