Operation Codes and Flags

Each event contains an operation code, or opcode, and a set of flags. For a detailed explanation of these constructs, see SAS Event Stream Processing: Overview. SAS Micro Analytic Service module methods offer you the option of examining a source window event's opcode and flags and setting the opcode and flags of a derived event.
Note: This practice is recommended only for advanced SAS Event Stream Processing users.
These are the opcodes:
  • insert
  • update
  • delete
  • upsert
  • safedelete
One or more flags can be set in a given event, depending on the event opcode and circumstances. Here are the possible flags:
  • N — normal
  • P — partial update
  • R — retention
DS2 and Python module authors can add zero or more of the following special arguments to their DS2 method or Python function signatures:
_inOpcode
populated with the source window event opcode when the module method is called. _inOpcode is an input argument and, if included, must appear before any output arguments in the method signature. _inOpcode is a string type, and its value must be insert, update, delete, upsert, or safedelete when the method is called.
_outOpcode
used to either set the opcode of the derived event to be omitted, or to cause no derived event to be omitted. If _outOpcode is omitted from the method signature, SAS Micro Analytic Service transfers the opcode of the source window event to the derived event. This is the standard behavior under normal circumstances. If _outOpcode is included in the method signature and is set to missing, emission of the derived event is skipped. If _outOpcode is included and is not set to missing, the value of _outOpcode is used to set the opcode of the derived event. The value that is set must be either insert, update, delete, upsert, or safedelete. To achieve normal processing when _outOpcode is included, the method author must also include _inOpcode and set _outOpcode=inOpcode. _outOpcode is an output argument. Therefore, it must appear after all input arguments in the method signature.
_outOpcodeArray
If this argument is present, its elements are used to set the opcode of the corresponding derived events. If _outOpcodeArray is not present, but the scalar meta argument _outOpcode is present in the method signature, then the value of _outOpcode is used to set every derived event’s opcode field. If no meta arguments are present, the derived event’s opcodes are inherited from the source event. If both _outOpcode and _outOpcodeArray are present in the method signature, _outOpcodeArray takes precedence.
Similar to _outOpcode, _outOpcodeArray can be used to suppress the generation of one or more derived events. To suppress the generation of a derived event, set the corresponding _outOpcodeArray entry to a missing value. If _outOpcodeArray is present in the method signature and the entire array is set to missing, then the generation of all derived events is skipped for that method invocation.
_inFlags
populated with the source window flags when the module method is called. _inFlags is a string type containing one character per source window event flag that is set. For example, N and NR are possible values. Reserve space for at least three characters for the _inFlags argument. _inFlags is an input argument. Therefore, if included, it must appear before any output arguments in the method signature.
_outFlagsArray
If this argument is present in the method signature, the elements of _outFlagsArray are used to set the flags of each corresponding derived event. If the scalar meta argument _outFlags is present in the method signature, its value is used to set every derived event’s flags. If no meta arguments are present, the derived event’s flags are inherited from the source event. If both _outFlags and _outFlagsArray are present, _outFlagsArray takes precedence.
_outFlags
used to set the flags of the derived event to be omitted. If _outFlags is omitted from the method signature, SAS Micro Analytic Service transfers the flags of the source window event to the derived event. This is the standard behavior under normal circumstances. If _outFlags is included and is set to missing, SAS Micro Analytic Service defaults to standard behavior and copies the source window event flags to the derived event.
Last updated: March 2, 2017