Previous Page | Next Page

SAS Component Language Dictionary

SYSRC



Returns a system error number or the exit status of the most recently called entry
Category: Message

Syntax
Details
Example
See Also

Syntax

rc=SYSRC(<display-stat>);

rc

contains the return code for the most recent error or warning condition, if display-stat is omitted. Otherwise, returns the exit status of CALL DISPLAY:

0

A user used an END command.

-1

A user used a CANCEL command.

Type: Numeric

display-stat

causes the SYSRC function to return the most recent exit status of CALL DISPLAY. The value of the argument does not matter, only whether any value is specified.

Type: Numeric


Details

If you pass an argument to SYSRC, the function returns the exit status of the most recently called execution of CALL DISPLAY rather than the SAS system return code for the most recent error or warning condition. Thus, you can use SYSRC to determine how a user terminated an entry that was called with CALL DISPLAY.

To return the SAS system return code, do not specify any value for display-stat. See SAS System Return Codes for more information about how to use return code values.


Example

Determine how a user exited from another entry that was called within the current application:

call display('test.scl');
if sysrc(1)=-1 then
 _msg_=
    'User exited TEST.SCL with a CANCEL command';
else
 _msg_=
    'User exited TEST.SCL with an END command';


See Also

SYSMSG

Previous Page | Next Page | Top of Page