LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 9 Jun 2010 21:19:29 -0700
Reply-To:   "DUELL, BOB (ATTCINW)" <BD9439@ATT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "DUELL, BOB (ATTCINW)" <BD9439@ATT.COM>
Subject:   Re: How do I get specific abend or return code from SAS under UNIX
Comments:   To: Scott Bennett <scott.bennett@HEWITT.COM>
In-Reply-To:   <201006091729.o59Anxih016963@willow.cc.uga.edu>
Content-Type:   text/plain; charset="us-ascii"

See the documentation in the SAS Companion for UNIX. The process exit status code is returned as an environment variable ($status for the C-shell, $? for others). Your script can inspect that variable to see what happened and deal with it appropriately.

On UNIX a status code of 1 means there were warnings and a 2 means there were errors. ABORT by itself sets the status code to 3, ABORT RETURN sets it to 4, ABORT ABEND sets it to 5, and both ABORT RETURN nn and ABORT ABEND nn sets the status code to the value specified. Note that ABORT, ABORT RETURN and ABORT ABEND have the same effect: each causes SAS to stop gracefully.

Also, on UNIX the return code should only be between 0 and 255. The reason is explained in the documentation.

Good luck on you migration! Brings back many fond memories.

Bob -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Scott Bennett Sent: Wednesday, June 09, 2010 10:29 AM To: SAS-L@LISTSERV.UGA.EDU Subject: How do I get specific abend or return code from SAS under UNIX

When running SAS from UNIX command line, I need to capture the exact value SAS has returned or abended with.

If in SAS we have the following:

DATA _NULL_; ABORT ABEND 2000; RUN;

I need the UNIX script that started the SAS session to know SAS abended with the 2000 code.

Also if SAS had the following:

DATA _NULL_; ABORT RETURN 1; RUN;

I need to know the SAS returned a 1 because of the code, and not because of a SAS warning.

The reason for this is I need to have SAS previously running on MVS produce the same results on UNIX. On MVS a SAS warning would result in a job step RC of 4, so a value of 1 from the developer is meaningful.

Thanks!!


Back to: Top of message | Previous page | Main SAS-L page