Chapter Contents |
Previous |
Next |
ABORT |
Valid: | in a DATA step |
OS/390 specifics: | action of ABEND and RETURN, maximum value of n |
Syntax | |
Details | |
See Also |
Syntax |
ABORT <ABEND | RETURN> <n>; |
Details |
You can use the ABORT statement to control the conditional execution of OS/390 job steps. For example, depending on the result of the OS/390 job step that executes your SAS program, you may need to either bypass or execute later steps. To do this you can establish a variable in your SAS DATA step program that is set to a particular value whenever an error occurs; in the following example, we use a variable named ERRCODE that is set to 16 if an error occurs in the DATA step. You can choose any variable name and value that are required by your program. Then, use the following ABORT statement, coded in the THEN clause of an IF statement, to cause the OS/390 job step to ABEND if ERRCODE=16:
if errcode=16 then abort abend;
When the OS/390 job step that is used to execute your SAS job ends (either normally or abnormally), the next OS/390 job step is processed. You could then use the following EXEC statement to conditionally execute that job step if an ABEND occurs. If ERRCODE is not set to 16, then the ABORT statement is not executed, and because an ABEND did not occur the job step is bypassed.
//stepname EXEC PGM=your-program,COND=ONLY
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.