The methods that are
published to SAS Micro Analytic Service can be used to generate multiple
derived events when a single source event is received. This is accomplished
by coding an array output argument for each derived event field.
The values in the arrays are then used to populate the fields of multiple
derived events.
A SAS Micro Analytic
Service module method can produce one or more arrays. When such a
method is mapped to a SAS Event Stream Processing source window, and
when at least one of the output array names matches a derived event
field name, multiple derived events can be generated. The number of
elements in the matching array or arrays at run time determines the
number of events that are generated. As is the case with scalar outputs,
any array output that does not match a derived event field name is
ignored.
When you are authoring
a method that is capable of generating more than one event, the best
practice is to produce parallel arrays of the same size. When you
follow this practice, each array element contributes one value to
each of the derived events, in order. The arrays can contain different
numbers of elements across method calls (for example, they might generate
one derived event for one call, three derived events for another,
and so on). However, for a single method call, the best practice is
to produce the same number of elements in each array.
If you ignore these
best practices, you can still generate multiple events, but keep the
following rules in mind:
-
The longest array that maps to
a derived event field determines the number of events that are generated.
-
When the longest array is being
determined, trailing missing values are not counted.
-
If an array is shorter than the
number of events to be generated, missing values are set in the corresponding
field of the derived events for which the array has no data.
Scalar output values,
if any, are repeated in the corresponding fields of every derived
event.