Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mv_webout.sas File Reference

Send data to/from the SAS Viya Job Execution Service. More...

Go to the source code of this file.

Detailed Description

This macro should be added to the start of each Job Execution Service, immediately followed by a call to:

  %mv_webout(FETCH)

This will read all the input data and create same-named SAS datasets in the WORK library. You can then insert your code, and send data back using the following syntax:

data some datasets; * make some data ;
  retain some columns;
run;

%mv_webout(OPEN)
%mv_webout(ARR,some)  * Array format, fast, suitable for large tables ;
%mv_webout(OBJ,datasets) * Object format, easier to work with ;
%mv_webout(CLOSE)
Parameters
[in]actionEither OPEN, ARR, OBJ or CLOSE
[in]dsThe dataset to send back to the frontend
[in]_webout=fileref for returning the json
[out]fref=(_mvwtemp)Temp fileref to which to write the output
[out]dslabel=value to use instead of table name for sending to JSON
[in]fmt=(N) Setting Y converts all vars to their formatted values
[in]stream=(Y)Change to N if not streaming to _webout
[in]missing=(NULL) Special numeric missing values can be sent as NULL (eg null) or as STRING values (eg ".a" or ".b")
[in]showmeta=(N) Set to Y to output metadata alongside each table, such as the column formats and types. The metadata is contained inside an object with the same name as the table but prefixed with a dollar sign - ie, ,"$tablename":{"formats":{"col1":"$CHAR1"},"types":{"COL1":"C"}}
[in]maxobs=(MAX) Provide an integer to limit the number of input rows that should be converted to output JSON
[in]workobs=(0) When set to a positive integer, will create a new output object (WORK) which contains this number of observations from all tables in the WORK library.

SAS Macros

Related Macros

Version
Viya 3.3
Author
Allan Bowe, source: https://github.com/sasjs/core

Definition in file mv_webout.sas.