THEN's were uniformly left out after ELSEIF. These have been inserted in all choices.
Functions only allow IN parameters in PSM. The function has been changed to a procedure.