The premap process performs the actions of the SQL-invoked function. The following example shows the premap process for the sample function:
ADD MODULE NAME IS ASIND-PROC VERSION IS 1
LANGUAGE PROCESS
PROCESS SOURCE FOLLOWS
IF ARG LE 1.0
THEN
DO.
MOVE 0 TO USER-FUNC-I
MOVE ARCSINE-DEGREES(ARG) TO USER-FUNC
END.
ELSE
D0.
MOVE '38099' TO SQLPROC-SQLSTATE.
MOVE 'Arg must be <= 1.0' to SQLPROC-MSG-TEXT.
END.
LEAVE ADS.
MSEND
|
Copyright © 2014 CA.
All rights reserved.
|
|