Programming the statistical procedures from SAS

What is the usage of ENDSAS statement?

Reply
Frequent Contributor
Posts: 86

What is the usage of ENDSAS statement?


Dear all,

Would you please clarify to me the usage of the ENDSAS statement? I searched in our community but found no the very clear one.

Best regards and many thanks.

Super Contributor
Posts: 276

Re: What is the usage of ENDSAS statement?

Hi..

Please Go through this link..It may be use full to you...

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289392.htm

Regards..

Sanjeev.K

Super Contributor
Posts: 276

Re: What is the usage of ENDSAS statement?

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

Ask a Question
Discussion stats
  • 2 replies
  • 553 views
  • 0 likes
  • 2 in conversation