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: Deployment Guide. 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 emit, or to cause no derived event to be emitted. 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.
_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.
_outFlags
used to set the flags of the derived event to emit. 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.