BookmarkSubscribeRSS Feed
Jack2012
Obsidian | Level 7


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.

2 REPLIES 2
kuridisanjeev
Quartz | Level 8

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

kuridisanjeev
Quartz | Level 8

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 5604 views
  • 0 likes
  • 2 in conversation