Currently when running sasjs request and the SAS program does not return a valid JSON response, the following appears in the console:
ERROR An error occurred while executing the request.
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
Without a log, the above can be very difficult to debug. We should therefore enable a --log (or -l) flag (and print the location of the log in the console output).
The same logic can also be applied to the response json (with a -o or --output flag, same as sasjs job execute.
Functional Testing
The following should work:
create two test services using SAS Studio, eg:
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;
filename ft15f001 temp;
parmcards4;
%webout(OPEN)
data fish;
set sashelp.fish;
run;
%webout(OBJ,fish)
%webout(CLOSE)
;;;;
%mp_createwebservice(path=/Public/app/adapter/test,name=fish)
parmcards4;
%abort;
;;;;
%mp_createwebservice(path=/Public/app/adapter/test,name=err)
Currently when running
sasjs request
and the SAS program does not return a valid JSON response, the following appears in the console:Without a log, the above can be very difficult to debug. We should therefore enable a
--log
(or-l
) flag (and print the location of the log in the console output).The same logic can also be applied to the response json (with a
-o
or--output
flag, same as sasjs job execute.Functional Testing
The following should work:
Expected:
Expected:
Expected:
Expected:
No errors in console
./data.json contains data
sasjsbuild/output.log contains log
[x] The
-l
flag works on both SAS 9 and Viya[x] The
-o
flag works on both SAS 9 and Viya[x] Tests are added
[x] The CLI docs are updated (both cli.sasjs.io and the terminal help)
[ ] The
sasjs request
video is re-recorded (Task for Allan)