Hi... The ENDSAS statement immediately terminates the SAS job or session. An interactive program that writes output to the OUTPUT window should not use this statement because the contents of the OUTPUT window (as well as the LOG & Program Editor windows) will be lost. However when output is directed to files (as in a batch program or when using PROC PRINTTO) or when just data sets are being created, the ENDSAS statement can be used to control job or session termination. The entire job is terminated in the following data step if the variable X is ever less than or equal to zero. data new; set old; lnx=log(x); if _error_ then endsas; run; The ENDSAS statement can also be used between steps when execution of only a portion of a program is desired. …some SAS statements… run; endsas; …unexecuted SAS statements… Source:https://docs.google.com/viewer?url=http%3A%2F%2Fwww2.sas.com%2Fproceedings%2Fsugi26%2Fp074-26.pdf Regards.. Sanjeev.K
... View more