Macros for SAS Application Developers
https://github.com/sasjs/core
mm_webout.sas File Reference

Send data to/from SAS Stored Processes. More...

Go to the source code of this file.

Detailed Description

This macro should be added to the start of each Stored Process, immediately** followed by a call to:

%mm_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;

%mm_webout(OPEN)
%mm_webout(ARR,some)  * Array format, fast, suitable for large tables ;
%mm_webout(OBJ,datasets) * Object format, easier to work with ;

Finally, wrap everything up send some helpful system variables too

%mm_webout(CLOSE)
Parameters
[in]actionEither FETCH, OPEN, ARR, OBJ or CLOSE
[in]dsThe dataset to send back to the frontend
[out]dslabel=Value to use instead of table name for sending to JSON
[in]fmt=(Y)Set to N to send back unformatted values
[out]fref=(_webout) The fileref to which to write the JSON
[in]missing=(NULL) Special numeric missing values can be sent as NULL (eg null) or as STRING values (eg ".a" or ".b")
[in]showmeta=(NO) Set to YES 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"}}
Version
9.3
Author
Allan Bowe

Definition in file mm_webout.sas.