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

Runs a DC service the way a test needs it run. More...

Go to the source code of this file.

Detailed Description

Wraps mx_execute so that every call is measurable, using only documented mx_execute outputs:

  • the child's log is kept when mdebug is on, through outlogds, and printed as CHILD: lines. A normal run asks for no log, so it stays quiet - flip sasjs_mdebug for an investigation run instead of editing tests;
  • the child's outcome is written to outstatus (STATE, URI, ERRMSG, PLATFORM). state=canceled means the child aborted, so a test can assert what happened rather than inferring it from an outlib that may still hold the previous call's tables;
  • failfast aborts the caller as soon as the child is not completed, so the first failure is the real one and the log names it. Tests that expect an abort pass failfast=0 and check the status row. SAS 9 reports no job state at all (PROC STP), which core records as state=unknown; that is treated as unmeasured rather than failed, and noted in the log.

Usage:

%mpe_execute(&appLoc/services/editors/getdata,
  viyacontext=&defaultcontext,
  inputfiles=&f1:sascontroltable,
  outlib=web1
)
%put reaching here means the child completed;
data _null_;
  set work.dc_childstatus;
  putlog "child said: " state= errmsg=;
run;
Parameters
[in]programThe _PROGRAM endpoint to run
[in]inputfiles=(0)fileref:filename pairs, as mx_execute
[in]inputdatasets=(0)datasets to send as CSV, as mx_execute
[in]inputparams=(0)name/value dataset, as mx_execute
[out]outlib=(0)Output libref for the response JSON
[out]outref=(0)Output fileref for the raw response text
[in]debug=(131) The _debug value sent to the child. Numeric, as the server requires; 131 asks for the log.
[in]mdebug=(&sasjs_mdebug) 1 keeps the child's log and prints it
[in]viyacontext=(&defaultcontext) Viya compute context
[out]outstatus=(work.dc_childstatus)One row per child run
[in]failfast=(1) Abort the caller when the child did not complete

SAS Macros

@sasjslint {"maxLineLength": 101}

Definition in file mpe_execute.sas.