You use the CREATE FUNCTION statement to create user-defined functions. However, you must have RESOURCE authority.
For a complete description of the CREATE FUNCTION syntax, including performance considerations and differences between SQL Anywhere and IQ, see Reference: Statements and Options > SQL Statements > CREATE FUNCTION Statement.