Thank you Tom, KSharp, and Kiwi for your thoughts and effort. People like yourselves should not be taken for granted as you are the very reason why these discussion forums function, and function well at that. Tom, I think your solution is the best way to emulate the behavior of the ERROR statement, as we've presented it in this context; a very clever solution, and uniquely useful. However, the SAS 'intended' functionality, within PROC SQL, that I've found that most closely approaches the ERROR statement is an INTEGRITY CONSTRAINT. Below is an approximation of what you accomplished in your reply, in that it raises an alarm for a 'Sex' value not equal to 'F'. The difference here is: 1) The step stops at the first occurance. Failing the step entirely. 2) How many times the violation occurs is not recorded. proc sql; /*Create an empty copy of the table to read in.*/ create table x like sashelp.class; /*Add integrity constraint and corresponding error message.*/ alter table x add constraint Check_Sex check(Sex eq 'F') message="The field 'Sex' had value other than 'F'." msgtype=NEWLINE; /*Fill the empty dataset with data. Watch the step fail as the integrity constraint is violated.*/ insert into x select * from sashelp.class; quit; As for Kiwi's initial response, I maintain this is ultimately the right way of looking at my 'problem'. That is, find the right tool for the job instead of complaining about the tool initially chosen. This post is just a manifestation of my stubborness. Thanks, Huey
... View more