diff --git a/SAILPOINT/Functions/ES_CREATE_MAPICS_USER_RECORD.sql b/SAILPOINT/Functions/ES_CREATE_MAPICS_USER_RECORD.sql
index 160ed09..4710f87 100644
--- a/SAILPOINT/Functions/ES_CREATE_MAPICS_USER_RECORD.sql
+++ b/SAILPOINT/Functions/ES_CREATE_MAPICS_USER_RECORD.sql
@@ -1 +1,192 @@
-âÅã@×ÁãÈ@\ÓÉÂÓ@^@
%
%ÃÙÅÁãÅ@ÖÙ@ÙÅ×ÓÁÃÅ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâmÃÙÅÁãÅmÔÁ×ÉÃâmäâÅÙmÙÅÃÖÙÄ@M@
%ÅÕåÉÄ@ÃÈÁÙMò]@k@
%äâÅÙÕÁÔÅ@åÁÙÃÈÁÙMñð]@k@
%äâÅÙÙÖÓÅâ@åÁÙÃÈÁÙMñððð]@ÄÅÆÁäÓã@@ÕäÓÓ@@k@
%äâÅÙÄÅ×ã@åÁÙÃÈÁÙMñð]@ÄÅÆÁäÓã@@}}@@k@
%äâÅÙÅÔ×ÕÖ@åÁÙÃÈÁÙMø]@ÄÅÆÁäÓã@@}}@@]@
%ÙÅãäÙÕâ@ÃÓÖÂMòñô÷ôøóöô÷]@@@
%ÓÁÕÇäÁÇÅ@âØÓ@
%â×ÅÃÉÆÉÃ@âÁÉÓ×ÖÉÕãKÅâÃÙãÔäâÙ@
%ÕÖã@ÄÅãÅÙÔÉÕÉâãÉÃ@
%ÔÖÄÉÆÉÅâ@âØÓ@ÄÁãÁ@
%ÃÁÓÓÅÄ@ÖÕ@ÕäÓÓ@ÉÕ×äã@
%ÕÖã@ÆÅÕÃÅÄ@
%âÅã@Ö×ãÉÖÕ@@ÁÓæÂÓÒ@~@\ÁÓÓÙÅÁÄ@k@
%ÁÓæÃ×èÄãÁ@~@\Ö×ãÉÔÉéÅ@k@
%ÃÖÔÔÉã@~@\ÕÖÕÅ@k@
%ÄÅÃÙÅâäÓã@~@Móñk@óñk@ðð]@k@
%ÄèÕÄÆãÃÖÓ@~@\ÕÖ@k@
%ÄèÕäâÙ×ÙÆ@~@\ÖæÕÅÙ@k@
%âÙãâÅØ@~@\ÈÅç@@@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@ÓÉÂÓ@åÁÙÃÈÁÙ@M@ñðòô@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÃäÙmäâÙ@åÁÙÃÈÁÙ@M@ñð@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@äâÅÙmÙÖÓÅâ@åÁÙÃÈÁÙ@M@ñððð@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÙãÕÃÖÄÅ@ÃÈÁÙ@M@ñ@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÈÅçâãÁÔ×@ÃÈÁÙ@M@ò@]@ÆÖÙ@ÂÉã@ÄÁãÁ@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÃÖÕãÉÕäÅ@ÈÁÕÄÓÅÙ@ÆÖÙ@âØÓÅçÃÅ×ãÉÖÕ@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@åmâØÓâãÁãÅ@ÃÈÁÙ@M@õ@]@^@
%ÄÅÃÓÁÙÅ@åmÄÂòmÙÅãäÙÕmÃÖÄÅ@ÉÕã@^@
%ÄÅÃÓÁÙÅ@åmÄÂòmÔÅââÁÇÅmÉÄ@ÃÈÁÙ@M@÷@]@^@
%ÄÅÃÓÁÙÅ@åmÅÙÙÖÙmÔÅââÁÇÅ@ÃÓÖÂ@M@òðôø@]@^@
%``@Ã�—£¤™…@„‰�‡•–¢£‰ƒ@‰•†–@
%ÇÅã@ÄÉÁÇÕÖâãÉÃâ@ÃÖÕÄÉãÉÖÕ@ñ@
%åmÄÂòmÙÅãäÙÕmÃÖÄÅ@~@ÄÂòmÙÅãäÙÕÅÄmâØÓÃÖÄÅ@k@
%åmâØÓâãÁãÅ@~@ÙÅãäÙÕÅÄmâØÓâãÁãÅ@k@
%åmÅÙÙÖÙmÔÅââÁÇÅ@~@ÔÅââÁÇÅmãÅçã@k@
%åmÄÂòmÔÅââÁÇÅmÉÄ@~@ÄÂòmÔÅââÁÇÅmÉÄ@^@
%ÙÅãäÙÕ@
%M@
%åÁÓäÅâ@ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@åÁÓäÅ@}†�“¢…}@k@}âØÓÉ•†–}@åÁÓäÅ@ÑâÖÕmÖÂÑÅÃã@M@
%}âØÓâ£�£…}@åÁÓäÅ@åmâØÓâãÁãÅ@k@
%}âØÓÃ–„…}@åÁÓäÅ@åmÄÂòmÙÅãäÙÕmÃÖÄÅ@k@
%}”…¢¢�‡…ÉÄ}@åÁÓäÅ@åmÄÂòmÔÅââÁÇÅmÉÄ@k@
%}”…¢¢�‡…}@åÁÓäÅ@åmÅÙÙÖÙmÔÅââÁÇÅ@k@
%}ƒ¤™™…•£ã‰”…¢£�”—}@åÁÓäÅ@ÃäÙÙÅÕãmãÉÔÅâãÁÔ×@
%]@
%]@]@^@
%ÅÕÄ@^@
%âÅã@ÃÉâãÖÖÓâ@K@ÓÉÂÓ@~@ÃÉâãÖÖÓâ@K@âÅãmÓÉÂÙÁÙèmÓÉâã@M@ÅÕåÉÄ@]@^@
%âÅã@ÃäÙmäâÙ@~@ÃäÙÙÅÕãmäâÅÙ@^@
%âÅã@ÈÅçâãÁÔ×@~@ÙÉÇÈã@M@ÇÅÕÅÙÁãÅmäÕÉØäÅ@M@]@k@ò@]@^@
%``@Ô©†ð™…—@ÔÅÙÇÅ@M£ˆ‰¢@–•…@“––’¢@ƒ–™™…ƒ£]z@
%ÔÅÙÇÅ@ÉÕãÖ@ÔéÆðÙÅ×@Áâ@ãÁÙÇÅã@äâÉÕÇ@M@
%âÅÓÅÃã@ÁäãÈÖÙÉéÁãÉÖÕmÕÁÔÅ@Áâ@ÆðÂäÃÄ@k@
%ÉÆÕäÓÓ@M@ãÅçã@k@ÁäãÈÖÙÉéÁãÉÖÕmÕÁÔÅ@]@Áâ@ÆðÈñãç@
%ÆÙÖÔ@äâÅÙmÉÕÆÖ@
%æÈÅÙÅ@ÁäãÈÖÙÉéÁãÉÖÕmÕÁÔÅ@~@äâÅÙÕÁÔÅ@
%]@Áâ@âÖäÙÃÅ@
%ÖÕ@ãÁÙÇÅã@K@ÆðÂäÃÄ@~@âÖäÙÃÅ@K@ÆðÂäÃÄ@
%æÈÅÕ@ÔÁãÃÈÅÄ@ãÈÅÕ@ä×ÄÁãÅ@âÅã@ÆðÈñãç@~@âÖäÙÃÅ@K@ÆðÈñãç@
%æÈÅÕ@ÕÖã@ÔÁãÃÈÅÄ@ãÈÅÕ@ÉÕâÅÙã@M@ÆðÂäÃÄ@k@ÆðÈñãç@]@åÁÓäÅâ@M@
%âÖäÙÃÅ@K@ÆðÂäÃÄ@k@âÖäÙÃÅ@K@ÆðÈñãç@]@^@
%ÔÅÙÇÅ@ÉÕãÖ@ÔéÇäÃ××@Áâ@ãÁÙÇÅã@äâÉÕÇ@M@
%âÅÓÅÃã@\@
%ÆÙÖÔ@ãÁÂÓÅ@M@
%åÁÓäÅâ@äâÅÙÕÁÔÅ@
%]@â@M@ÇäÂäÃÄ@]@
%]@Áâ@âÖäÙÃÅ@
%ÖÕ@ãÁÙÇÅã@K@ÇäÂäÃÄ@~@âÖäÙÃÅ@K@ÇäÂäÃÄ@
%æÈÅÕ@ÔÁãÃÈÅÄ@ãÈÅÕ@ä×ÄÁãÅ@âÅã@M@ÇäÁÁÈÙ@k@ÇäÁÔÄã@k@ÇäÁÃãÔ@k@ÇäÁÈåÕ@k@
%ÇäÁÉåÕ@]@~@
%M@ÈÅçâãÁÔ×@k@ÃÉâãÖÖÓâ@K@ãÖmÃèÔÄ@M@]@k@éÖÕÅÄ@M@ÃäÙÙÅÕãmãÉÔÅ@]@k@ÃäÙmäâÙ@k@
%}ÅâÃÙãÔäâÙ}@]@
%æÈÅÕ@ÕÖã@ÔÁãÃÈÅÄ@ãÈÅÕ@ÉÕâÅÙã@M@ÇäÂäÃÄ@k@ÇäÁÁÈÙ@k@ÇäÁÓÄã@k@ÇäÁÂãÔ@k@
%ÇäÁÆåÕ@k@ÇäÁÇåÕ@]@åÁÓäÅâ@M@âÖäÙÃÅ@K@ÇäÂäÃÄ@k@ÈÅçâãÁÔ×@k@
%ÃÉâãÖÖÓâ@K@ãÖmÃèÔÄ@M@]@k@éÖÕÅÄ@M@ÃäÙÙÅÕãmãÉÔÅ@]@k@ÃäÙmäâÙ@k@
%}ÅâÃÙãÔäâÙ}@]@^@
%ÔÅÙÇÅ@ÉÕãÖ@ÔéÂÙÙÅ×@Áâ@ãÁÙÇÅã@äâÉÕÇ@M@
%âÅÓÅÃã@äâÅÙÕÁÔÅ@
\ No newline at end of file
+SET PATH *LIBL ; 
+
+CREATE OR REPLACE FUNCTION SAILPOINT.ES_CREATE_MAPICS_USER_RECORD ( 
+	ENVID CHAR(2) , 
+	USERNAME VARCHAR(10) , 
+	USERROLES VARCHAR(1000) DEFAULT  NULL  , 
+	USERDEPT VARCHAR(10) DEFAULT  ''  , 
+	USEREMPNO VARCHAR(8) DEFAULT  ''  ) 
+	RETURNS CLOB(2147483647)   
+	LANGUAGE SQL 
+	SPECIFIC SAILPOINT.ESCRTMUSR 
+	NOT DETERMINISTIC 
+	MODIFIES SQL DATA 
+	CALLED ON NULL INPUT 
+	NOT FENCED 
+	SET OPTION  ALWBLK = *ALLREAD , 
+	ALWCPYDTA = *OPTIMIZE , 
+	COMMIT = *NONE , 
+	DECRESULT = (31, 31, 00) , 
+	DYNDFTCOL = *NO , 
+	DYNUSRPRF = *OWNER , 
+	SRTSEQ = *HEX   
+	BEGIN 
+DECLARE LIBL VARCHAR ( 1024 ) DEFAULT '' ; 
+DECLARE CUR_USR VARCHAR ( 10 ) DEFAULT '' ; 
+DECLARE USER_ROLES VARCHAR ( 1000 ) DEFAULT '' ; 
+DECLARE RTNCODE CHAR ( 1 ) DEFAULT '' ; 
+DECLARE HEXSTAMP CHAR ( 2 ) FOR BIT DATA DEFAULT '' ; 
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION 
+BEGIN 
+DECLARE V_SQLSTATE CHAR ( 5 ) ; 
+DECLARE V_DB2_RETURN_CODE INT ; 
+DECLARE V_DB2_MESSAGE_ID CHAR ( 7 ) ; 
+DECLARE V_ERROR_MESSAGE CLOB ( 2048 ) ; 
+-- Capture diagnostic info 
+GET DIAGNOSTICS CONDITION 1 
+V_DB2_RETURN_CODE = DB2_RETURNED_SQLCODE , 
+V_SQLSTATE = RETURNED_SQLSTATE , 
+V_ERROR_MESSAGE = MESSAGE_TEXT , 
+V_DB2_MESSAGE_ID = DB2_MESSAGE_ID ; 
+RETURN 
+( 
+VALUES JSON_OBJECT ( 
+'success' VALUE 'false' , 'SQLInfo' VALUE JSON_OBJECT ( 
+'SQLState' VALUE V_SQLSTATE , 
+'SQLCode' VALUE V_DB2_RETURN_CODE , 
+'messageID' VALUE V_DB2_MESSAGE_ID , 
+'message' VALUE V_ERROR_MESSAGE , 
+'currentTimestamp' VALUE CURRENT_TIMESTAMP 
+) 
+) ) ; 
+END ; 
+SET CISTOOLS . LIBL = CISTOOLS . SET_LIBRARY_LIST ( ENVID ) ; 
+SET CUR_USR = CURRENT_USER ; 
+SET HEXSTAMP = RIGHT ( GENERATE_UNIQUE ( ) , 2 ) ; 
+-- Mzf0rep MERGE (this one looks correct): 
+MERGE INTO MZF0REP AS TARGET USING ( 
+SELECT AUTHORIZATION_NAME AS F0BUCD , 
+IFNULL ( TEXT , AUTHORIZATION_NAME ) AS F0H1TX 
+FROM USER_INFO 
+WHERE AUTHORIZATION_NAME = USERNAME 
+) AS SOURCE 
+ON TARGET . F0BUCD = SOURCE . F0BUCD 
+WHEN MATCHED THEN UPDATE SET F0H1TX = SOURCE . F0H1TX 
+WHEN NOT MATCHED THEN INSERT ( F0BUCD , F0H1TX ) VALUES ( 
+SOURCE . F0BUCD , SOURCE . F0H1TX ) ; 
+MERGE INTO MZGUCPP AS TARGET USING ( 
+SELECT * 
+FROM TABLE ( 
+VALUES USERNAME 
+) S ( GUBUCD ) 
+) AS SOURCE 
+ON TARGET . GUBUCD = SOURCE . GUBUCD 
+WHEN MATCHED THEN UPDATE SET ( GUAAHR , GUAMDT , GUACTM , GUAHVN , 
+GUAIVN ) = 
+( HEXSTAMP , CISTOOLS . TO_CYMD ( ) , ZONED ( CURRENT_TIME ) , CUR_USR , 
+'ESCRTMUSR' ) 
+WHEN NOT MATCHED THEN INSERT ( GUBUCD , GUAAHR , GUALDT , GUABTM , 
+GUAFVN , GUAGVN ) VALUES ( SOURCE . GUBUCD , HEXSTAMP , 
+CISTOOLS . TO_CYMD ( ) , ZONED ( CURRENT_TIME ) , CUR_USR , 
+'ESCRTMUSR' ) ; 
+MERGE INTO MZBRREP AS TARGET USING ( 
+SELECT USERNAME AS BRBUCD , 'ACCMAPICS' AS BRSKXX , '' AS BRBTXX , 
+HEXSTAMP AS BRAAHR , CISTOOLS . TO_CYMD ( ) AS BRALDT , 
+ZONED ( CURRENT_TIME ) AS BRABTM , CURRENT_USER AS BRAFVN , 
+'ESCRTMUSR' AS BRAGVN 
+FROM SYSIBM . SYSDUMMY1 
+) AS SOURCE 
+ON TARGET . BRBUCD = SOURCE . BRBUCD 
+AND TARGET . BRSKXX = SOURCE . BRSKXX 
+WHEN MATCHED THEN UPDATE SET BRBTXX = SOURCE . BRBTXX , BRAAHR = 
+SOURCE . BRAAHR , BRALDT = 
+SOURCE . BRALDT , BRABTM = 
+SOURCE . BRABTM , BRAFVN = 
+SOURCE . BRAFVN , BRAGVN = 
+SOURCE . BRAGVN 
+WHEN NOT MATCHED THEN INSERT ( BRBUCD , BRSKXX , BRBTXX , BRAAHR , 
+BRALDT , BRABTM , BRAFVN , BRAGVN ) VALUES ( SOURCE . BRBUCD , 
+SOURCE . BRSKXX , SOURCE . BRBTXX , SOURCE . BRAAHR , SOURCE . BRALDT , 
+SOURCE . BRABTM , SOURCE . BRAFVN , SOURCE . BRAGVN ) ; 
+-- Esuexp MERGE 
+MERGE INTO ESUEXP AS TARGET USING ( 
+VALUES ( USERNAME , USERDEPT , 'A' , '1' , USEREMPNO ) 
+) AS SOURCE ( EXUSER , EXDEPT , EXSTAT , EXFLG1 , EXT08A ) 
+ON TARGET . EXUSER = SOURCE . EXUSER 
+WHEN MATCHED THEN UPDATE SET EXDEPT = SOURCE . EXDEPT , EXSTAT = 
+SOURCE . EXSTAT , EXFLG1 = 
+SOURCE . EXFLG1 , EXT08A = 
+SOURCE . EXT08A 
+WHEN NOT MATCHED THEN INSERT ( EXUSER , EXDEPT , EXSTAT , EXFLG1 , 
+EXT08A ) VALUES ( SOURCE . EXUSER , SOURCE . EXDEPT , SOURCE . EXSTAT , 
+SOURCE . EXFLG1 , SOURCE . EXT08A ) ; 
+IF ( SELECT 
+CASE 
+WHEN COUNT ( * ) > 0 THEN '1' 
+ELSE '0' 
+END 
+FROM ESUSRP 
+WHERE EUUSER = USERNAME ) = '0' THEN 
+CALL SAILPOINT . CREATE_ES_USER_RECORD ( 'ADD' , 'U' , USERNAME , CUR_USR 
+) ; 
+END IF ; 
+
+IF USERROLES IS NOT NULL 
+AND TRIM ( USERROLES ) <> '' THEN 
+SET USER_ROLES = USERROLES ; 
+ELSE 
+SET USER_ROLES = 'ALUSR' ; 
+END IF ; 
+FOR SELECT DISTINCT FRAGMENT 
+FROM TABLE ( 
+SELECT FRAGMENT 
+FROM TABLE ( 
+CISTOOLS . SPLIT_STRING ( 
+REGEXP_REPLACE ( 
+CAST ( USER_ROLES AS VARCHAR ( 1000 ) CCSID 37 ) , 
+'[\\\[|\]|\{|\}|\"|\,|\s+]' , ' ' ) , ' ' ) 
+) 
+WHERE FRAGMENT <> '' 
+AND FRAGMENT IS NOT NULL 
+UNION ALL 
+SELECT * 
+FROM TABLE ( 
+VALUES 'ALUSR' 
+) 
+) 
+DO 
+CALL SAILPOINT . ASSIGN_ES_USER_TO_ROLE ( CUR_USR , 'G' , FRAGMENT , 
+USERNAME ) ;  -- assign default 
+END FOR ; 
+RETURN 
+COALESCE ( 
+JSON_OBJECT ( 
+'success' : 'true' , 'data' VALUE ( 
+SELECT 
+JSON_ARRAYAGG ( 
+JSON_OBJECT ( 
+'userId' VALUE RTRIM ( 
+CAST ( EUUSER AS VARCHAR ( 10 ) CCSID 37 ) ) , 
+'roles' VALUE JSON_ARRAY ( ROLESJSON FORMAT JSON ) 
+) FORMAT JSON 
+) AS FINALJSON 
+FROM TABLE ( 
+SELECT EUUSER , 
+JSON_OBJECTAGG ( RTRIM ( 
+CAST ( EUROLE AS VARCHAR ( 10 ) CCSID 37 ) ) 
+VALUE RTRIM ( 
+CAST ( EUDESC AS VARCHAR ( 50 ) CCSID 37 ) ) ) 
+AS ROLESJSON 
+FROM ESUSRP 
+JOIN ESROLP 
+USING ( EUROLE ) 
+WHERE EUUSER = USERNAME 
+GROUP BY EUUSER 
+) ) FORMAT JSON 
+) , JSON_OBJECT ( 
+'success' : 'false' , 'SQLInfo' VALUE JSON_OBJECT ( 
+'messageID' : 'SQL02000' , 
+'message' : 'Requested result not found ' , 
+'currentTimestamp' : CURRENT_TIMESTAMP 
+) 
+) ) ; 
+END  ; 
+
+GRANT ALTER , EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.ESCRTMUSR 
+TO AMAPICS WITH GRANT OPTION ; 
+
+GRANT EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.ESCRTMUSR 
+TO PUBLIC ; 
+
