You can use filerefs
and macro variables as output just like you can with input. Output
filerefs are automatically assigned by the stored process engine if
the SAS code writes to the fileref. Expanding on the previous example,
the following SAS program snippet copies from an input fileref to
an output fileref:
data _null_;
infile instream;
file otstream;
INPUT;
PUT _INFILE_;
run;
Define the input data
source instream and the output data target outstream in the stored
process metadata.
See Using Attachments with Web Services for more information
about how to define your stored processes so that you can retrieve
output data from your SAS programs.
In the following example,
the value of the Sum macro variable is automatically retrieved by
the stored process engine when you define an output parameter in the
stored process metadata:
%let sum = %sysevalf(&num1 + &num2);
Output parameters are
similar to prompts, but there are fewer types of output parameters.
Note: When using the JSON message
format, you are limited to prompts that have a simple string representation
for input and you can retrieve values only from stored process output
parameters. You cannot supply any stored process data sources when
invoking SAS BI Web Services using JSON. If your stored process outputs
data targets, packages, or streams to _WEBOUT, you cannot access these
resources when using JSON. Remember this when you author SAS programs
that you intend to use with JSON.