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 (February 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 8 Feb 2008 10:23:18 -0500
Reply-To:   "data _null_," <datanull@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "data _null_," <datanull@GMAIL.COM>
Subject:   Re: Error message to macro
Comments:   To: Amy Sun <tonyliang20032@gmail.com>
In-Reply-To:   <c5c99eb0802080710l76a88285p4580762ed9efcf66@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

I think you want to look at SYSERR. The following is from V9 doc but it should be about the same for V8. Experiment with the values return from your program when it breaks and write code to process accordingly.

SYSERR Automatic Macro Variable

--------------------------------------------------------------------------------

Contains a return code status set by some SAS procedures and the DATA step Type: Automatic macro variable (read only)

-------------------------------------------------------------------------------- Details

--------------------------------------------------------------------------------

Details

You can use the value of SYSERR as a condition to determine further action to take or to decide which parts of a SAS program to execute.

SYSERR can contain the following values:

Value Description 0 Execution completed successfully and without warning messages. 1 Execution was canceled by a user with a RUN CANCEL statement. 2 Execution was canceled by a user with an ATTN or BREAK command. 3 An error in a program run in batch or non-interactive mode caused SAS to enter syntax-check mode. 4 Execution completed successfully but with warning messages. >4 An error occurred. The value returned is procedure dependent.

On Feb 8, 2008 10:10 AM, Amy Sun <tonyliang20032@gmail.com> wrote: > Hi, All; > > During the execution of SAS program, if I want to assign an error message to > a macro (I am only interested in if there is an error during the execution, > and not the text itself), then how can I do that? Especially in the > situation of looping. I am using SAS8.2. > > Thanks in advance for your suggestions. > > Best regards, > Amy >


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