diff --git a/SAILPOINT/Functions/ES_V2_CREATE_MAPICS_USER_RECORD.sql b/SAILPOINT/Functions/ES_V2_CREATE_MAPICS_USER_RECORD.sql
index 8ebcddf..cd15358 100644
--- a/SAILPOINT/Functions/ES_V2_CREATE_MAPICS_USER_RECORD.sql
+++ b/SAILPOINT/Functions/ES_V2_CREATE_MAPICS_USER_RECORD.sql
@@ -1 +1,161 @@
-âÅã@×ÁãÈ@\ÓÉÂÓ@^@
%
%ÃÙÅÁãÅ@ÖÙ@ÙÅ×ÓÁÃÅ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâmåòmÃÙÅÁãÅmÔÁ×ÉÃâmäâÅÙmÙÅÃÖÙÄ@M@
%ÅÕåÉÄ@ÃÈÁÙMò]@k@
%äâÅÙÕÁÔÅ@åÁÙÃÈÁÙMñð]@k@
%äâÅÙÙÖÓÅâ@åÁÙÃÈÁÙMñððð]@ÄÅÆÁäÓã@@ÕäÓÓ@@k@
%äâÅÙÄÅ×ã@åÁÙÃÈÁÙMñð]@ÄÅÆÁäÓã@@}}@@k@
%äâÅÙÅÔ×ÕÖ@åÁÙÃÈÁÙMø]@ÄÅÆÁäÓã@@}}@@]@
%ÙÅãäÙÕâ@ÃÓÖÂMòñô÷ôøóöô÷]@@@
%ÓÁÕÇäÁÇÅ@âØÓ@
%â×ÅÃÉÆÉÃ@âÁÉÓ×ÖÉÕãKåòmÅâÃÙãÔäâÙ@
%ÕÖã@ÄÅãÅÙÔÉÕÉâãÉÃ@
%ÔÖÄÉÆÉÅâ@âØÓ@ÄÁãÁ@
%ÃÁÓÓÅÄ@ÖÕ@ÕäÓÓ@ÉÕ×äã@
%ÕÖã@ÆÅÕÃÅÄ@
%âÅã@Ö×ãÉÖÕ@@ÁÓæÂÓÒ@~@\ÁÓÓÙÅÁÄ@k@
%ÁÓæÃ×èÄãÁ@~@\Ö×ãÉÔÉéÅ@k@
%ÃÖÔÔÉã@~@\ÕÖÕÅ@k@
%ÄÅÃÙÅâäÓã@~@Móñk@óñk@ðð]@k@
%ÄÓè×Ù×@~@\ÕÖ@k@
%ÄèÕÄÆãÃÖÓ@~@\ÕÖ@k@
%ÄèÕäâÙ×ÙÆ@~@\ÖæÕÅÙ@k@
%âÙãâÅØ@~@\ÈÅç@@@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@ÓÉÂÓ@åÁÙÃÈÁÙ@M@ñðòô@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÃäÙmäâÙ@åÁÙÃÈÁÙ@M@ñð@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@äâÅÙmÙÖÓÅâ@åÁÙÃÈÁÙ@M@ñððð@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÙãÕÃÖÄÅ@ÃÈÁÙ@M@ñ@]@ÄÅÆÁäÓã@}}@^@
%ÄÅÃÓÁÙÅ@ÈÅçâãÁÔ×@ÃÈÁÙ@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@
%âÅÓÅÃã@äâÅÙÕÁÔÅ@Áâ@ÂÙÂäÃÄ@k@}ÁÃÃÔÁ×ÉÃâ}@Áâ@ÂÙâÒçç@k@}}@Áâ@ÂÙÂãçç@k@
%ÈÅçâãÁÔ×@Áâ@ÂÙÁÁÈÙ@k@ÃÉâãÖÖÓâ@K@ãÖmÃèÔÄ@M@]@Áâ@ÂÙÁÓÄã@k@
%éÖÕÅÄ@M@ÃäÙÙÅÕãmãÉÔÅ@]@Áâ@ÂÙÁÂãÔ@k@ÃäÙÙÅÕãmäâÅÙ@Áâ@ÂÙÁÆåÕ@k@
%}ÅâÃÙãÔäâÙ}@Áâ@ÂÙÁÇåÕ@
%ÆÙÖÔ@âèâÉÂÔ@K@âèâÄäÔÔèñ@
%]@Áâ@âÖäÙÃÅ@
%ÖÕ@ãÁÙÇÅã@K@ÂÙÂäÃÄ@~@âÖäÙÃÅ@K@ÂÙÂäÃÄ@
%ÁÕÄ@ãÁÙÇÅã@K@ÂÙâÒçç@~@âÖäÙÃÅ@K@ÂÙâÒçç@
%æÈÅÕ@ÔÁãÃÈÅÄ@ãÈÅÕ@ä×ÄÁãÅ@âÅã@ÂÙÂãçç@~@âÖäÙÃÅ@K@ÂÙÂãçç@k@ÂÙÁÁÈÙ@~@
%âÖäÙÃÅ@K@ÂÙÁÁÈÙ@k@ÂÙÁÓÄã@~@
%âÖäÙÃÅ@K@ÂÙÁÓÄã@k@ÂÙÁÂãÔ@~@
%âÖäÙÃÅ@K@ÂÙÁÂãÔ@k@ÂÙÁÆåÕ@~@
%âÖäÙÃÅ@K@ÂÙÁÆåÕ@k@ÂÙÁÇåÕ@~@
%âÖäÙÃÅ@K@ÂÙÁÇåÕ@
%æÈÅÕ@ÕÖã@ÔÁãÃÈÅÄ@ãÈÅÕ@ÉÕâÅÙã@M@ÂÙÂäÃÄ@k@ÂÙâÒçç@k@ÂÙÂãçç@k@ÂÙÁÁÈÙ@k@
%ÂÙÁÓÄã@k@ÂÙÁÂãÔ@k@ÂÙÁÆåÕ@k@ÂÙÁÇåÕ@]@åÁÓäÅâ@M@âÖäÙÃÅ@K@ÂÙÂäÃÄ@k@
%âÖäÙÃÅ@K@ÂÙâÒçç@k@âÖäÙÃÅ@K@ÂÙÂãçç@k@âÖäÙÃÅ@
\ No newline at end of file
+SET PATH *LIBL ; 
+
+CREATE OR REPLACE FUNCTION SAILPOINT.ES_V2_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.V2_ESCRTMUSR 
+	NOT DETERMINISTIC 
+	MODIFIES SQL DATA 
+	CALLED ON NULL INPUT 
+	NOT FENCED 
+	SET OPTION  ALWBLK = *ALLREAD , 
+	ALWCPYDTA = *OPTIMIZE , 
+	COMMIT = *NONE , 
+	DECRESULT = (31, 31, 00) , 
+	DLYPRP = *NO , 
+	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 '' ; 
+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 
+( 
+SELECT JSON_OBJECT ( 
+'data' : 
+JSON_ARRAYAGG ( 
+JSON_OBJECT ( 
+'userId' VALUE RTRIM ( 
+CAST ( EUUSER AS VARCHAR ( 10 ) CCSID 37 ) ) , 
+'roles' VALUE JSON_ARRAY ( ROLESJSON FORMAT JSON ) 
+) FORMAT JSON 
+) , 
+'errors' : JSON_ARRAY ( ) 
+) 
+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 
+) ) ; 
+END  ; 
+
+GRANT ALTER , EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.V2_ESCRTMUSR 
+TO AMAPICS WITH GRANT OPTION ; 
+
+GRANT EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.V2_ESCRTMUSR 
+TO PUBLIC ; 
+
