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

Create a Web Ready Stored Process. More...

Go to the source code of this file.

Detailed Description

This macro creates a Type 2 Stored Process with the mm_webout macro included as pre-code. Usage:

%* compile macros ;
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

%* parmcards lets us write to a text file from open code ;
filename ft15f001 temp;
parmcards4;
    %* do some sas, any inputs are now already WORK tables;
    data example1 example2;
      set sashelp.class;
    run;
    %* send data back;
    %webout(OPEN)
    %webout(ARR,example1) * Array format, fast, suitable for large tables ;
    %webout(OBJ,example2) * Object format, easier to work with ;
    %webout(CLOSE)
;;;;
%mm_createwebservice(path=/Public/app/common,name=appInit,code=ft15f001,replace=YES)

Dependencies

Parameters
path=The full path (in SAS Metadata) where the service will be created
name=Stored Process name. Avoid spaces - testing has shown that the check to avoid creating multiple STPs in the same folder with the same name does not work when the name contains spaces.
desc=The description of the service (optional)
precode=Space separated list of filerefs, pointing to the code that needs to be attached to the beginning of the service (optional)
code=Space seperated fileref(s) of the actual code to be added
server=The server which will run the STP. Server name or uri is fine.
mDebug=set to 1 to show debug messages in the log
replace=select YES to replace any existing service in that location
adapter=the macro uses the sasjs adapter by default. To use another adapter, add a (different) fileref here.
Version
9.2
Author
Allan Bowe

Definition in file mm_createwebservice.sas.