Chapter Contents |
Previous |
Next |
abend |
Portability: | SAS/C extension |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUE | |
CAUTION | |
EXAMPLE | |
RELATED FUNCTIONS | |
SEE ALSO |
SYNOPSIS |
#include <lclib.h> void abend(int code);
DESCRIPTION |
abend
terminates program execution using the ABEND macro. The
code
argument is used as a user ABEND code. If
code
is not between 0 and 4095, the actual ABEND code is unpredictable.
Open files are not closed, and
atexit
routines are not called before termination.
The SIGABRT signal is raised before termination occurs.
Program execution continues if the signal handler exits using
longjmp
. If SIGABRT is managed by UNIX System Servces (USS) software
rather than by SAS/C software, the program's final termination status is "terminated
by SIGABRT." Also, the ABEND code is not directly accessible to a program
running under the shell.
RETURN VALUE |
Control is never returned to the caller
of
abend
.
CAUTION |
If you call
abend
without closing files, data in the files may be lost. In addition,
an open UNIX style output file that requires copying is unchanged if you call
abend
. (See I/O Functions for more information on UNIX style
files.)
EXAMPLE |
#include <lclib.h> #include <stdio.h> void fatal(int errcode) { /* Terminate execution after fatal error. */ fprintf(stderr, "Fatal error %d, terminating.\n", errcode); fclose(stderr); fclose(stdout); /* Close standard files before ABEND. */ abend(errcode); }
RELATED FUNCTIONS |
SEE ALSO |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.