Date: Wed, 9 Jun 2010 14:27:18 -0700
Reply-To: Paul Dorfman <sashole@BELLSOUTH.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Dorfman <sashole@BELLSOUTH.NET>
Subject: Re: How do I get specific abend or return code from SAS under UNIX
Content-Type: text/plain; charset=iso-8859-1
At the very least, you could write the value to a 1-record file which the script will read after SAS is kaput.
filename kaput '<path>' ;
data _null_ ;
file kaput ;
put '1' ;
abort abend 1 ;
Then let the script read file '<path'> and do whatever with the value.
--- On Wed, 6/9/10, Scott Bennett <scott.bennett@HEWITT.COM> wrote:
> From: Scott Bennett <scott.bennett@HEWITT.COM>
> Subject: How do I get specific abend or return code from SAS under UNIX
> To: SAS-L@LISTSERV.UGA.EDU
> Date: Wednesday, June 9, 2010, 1:29 PM
> 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;
> 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;
> 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.