Loading...
Searching...
No Matches
mpe_assert_abort.sas File Reference

Asserts that a service returned a sasjsAbort object. More...

Go to the source code of this file.

Detailed Description

Reads the child's status row and records a PASS when the child was canceled, which is what happens when a service rejects its input and calls mp_abort. When msg is supplied the ERRMSG value must match it, so the assertion proves the service aborted for the expected reason rather than for any reason at all.

The message comes from the status row rather than from the response text: core publishes STATE and ERRMSG per call, ERRMSG holds the whole message including quotes and anything longer than a single record, and reading it needs no parsing of the response.

Two things are handled here rather than in core:

  • mp_abort appends cats(msg,'
    \nLog Extract:
    ',logmsg) to the message, so the tail is cut at the two newlines that precede the marker. A message that merely mentions "Log Extract:" is not preceded by them and survives.
  • a platform that reports no job state at all (SAS 9 PROC STP) cannot show the abort this way; the row reads 'unknown' and the assertion fails rather than guessing.

Usage:

%mpe_execute(&_program,
  inputfiles=&f1:sascontroltable,
  outstatus=work.ab1,
  failfast=0
)
%mpe_assert_abort(
  desc=An invalid libds aborts the service,
  outstatus=work.ab1,
  msg=Invalid libds
)
Parameters
[in]descThe description recorded in the test results
[in]outstatusThe dataset given to mpe_execute, holding STATE and ERRMSG for the child call
[in]msg=(0) Expected ERRMSG value. 0 accepts any abort message.
[out]outds=(work.test_results) Results dataset

SAS Macros

@sasjslint {"maxLineLength": 94}

Definition in file mpe_assert_abort.sas.