Event handlers, whether for scheduled events or for system event handling, contain compound statements, and are similar in many ways to stored procedures. You can add loops, conditional execution, and so on, and you can use the Sybase IQ debugger to debug event handlers.
The EVENT_PARAMETER function provides context information for event handlers. See Reference: Building Blocks, Tables, and Procedures.
For an example on using event handling, see System Administration Guide: Volume 1 > Automating Tasks Using Schedules and Events > Managing user accounts and connections.