diff --git a/SAILPOINT/Functions/ES_GET_EMPLOYEE_NUMBER.sql b/SAILPOINT/Functions/ES_GET_EMPLOYEE_NUMBER.sql
index 1afd5b9..1dfb0e1 100644
--- a/SAILPOINT/Functions/ES_GET_EMPLOYEE_NUMBER.sql
+++ b/SAILPOINT/Functions/ES_GET_EMPLOYEE_NUMBER.sql
@@ -1 +1,103 @@
-âÅã@×ÁãÈ@\ÓÉÂÓ@^@
%
%ÃÙÅÁãÅ@ÖÙ@ÙÅ×ÓÁÃÅ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâmÇÅãmÅÔ×ÓÖèÅÅmÕäÔÂÅÙ@M@
%äâÅÙÕÁÔÅ@ÃÈÁÙ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âØÓÃÖÄÅ@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@ÅÔ×ÕÖmÓÉâã@M@
%ÅÕåÉÄ@ÃÈÁÙ@M@ò@]@k@ÓÉÂ@ÃÈÁÙ@M@ñð@]@k@ÅçäâÅÙ@ÃÈÁÙ@M@ñð@]@k@ÅÔ×ÕÖ@ÃÈÁÙ@M@ø@]@]@
%æÉãÈ@ÙÅ×ÓÁÃÅ@^@
%ÆÖÙ@âÅÓÅÃã@ÄÉâãÉÕÃã@Á@K@ÅÕåÉÄ@k@ãÙÉÔ@M@}ÃÅâÓÉÂ}@OO@
%ÃÁâÅ@Á@K@ÅÕåÉÄ@
%æÈÅÕ@}ÔÔ}@ãÈÅÕ@}}@
%ÅÓâÅ@ÙÉÇÈã@M@Á@K@ÅÕåÉÄ@k@ñ@]@
%ÅÕÄ@]@Áâ@ÃÅâÓÉÂ@
%ÆÙÖÔ@ãÁÂÓÅ@M@
%âÅÓÅÃã@ÙÖæmÕäÔÂÅÙ@M@]@ÖåÅÙ@M@
%]@Áâ@ÙÕ@k@ÅÕåÉÄ@
%ÆÙÖÔ@ÑâÖÕmãÁÂÓÅ@M@
%âÁÉÓ×ÖÉÕã@K@ÅâmÇÅãmÁÓÓmÔÁ×ÉÃâmÅÕåÉÙÖÕÔÅÕãâ@M@]@k@
%}[K„�£�º\»}@
%ÃÖÓäÔÕâ@M@
%ÅÕåÉÄ@åÁÙÃÈÁÙ@M@ò@]@ÃÃâÉÄ@ó÷@×ÁãÈ@}[K…•¥É„}@
%]@
%]@
%]@Á@
%ÄÖ@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@ÃÖÕãÉÕäÅ@ÈÁÕÄÓÅÙ@ÆÖÙ@âØÓÅçÃÅ×ãÉÖÕ@
%ÂÅÇÉÕ@
%ÅÕÄ@^@
%âÅã@ÃÉâãÖÖÓâ@K@âØÓmâãÁãÅÔÅÕã@~@
%}ÉÕâÅÙã@ÉÕãÖ@âÅââÉÖÕKÅÔ×ÕÖmÓÉâã@}@OO@}â…“…ƒ£@}}}@OO@
%ÅÕåÉÄ@OO@}}}k@}}}@OO@ÃÅâÓÉÂ@OO@}}}k@Å§ä¢…™k@Å§£ðøÁ@}@
%OO@}ÆÙÖÔ@}@OO@ÃÅâÓÉÂ@OO@}KÅâäÅç×@æÈÅÙÅ@Å§ä¢…™@~@}}}@
%OO@ãÙÉÔ@M@äâÅÙÕÁÔÅ@]@OO@}}}}@^@
%ÅçÅÃäãÅ@ÉÔÔÅÄÉÁãÅ@ÃÉâãÖÖÓâ@K@âØÓmâãÁãÅÔÅÕã@^@
%ÅÕÄ@^@
%ÅÕÄ@ÆÖÙ@^@
%ÙÅãäÙÕ@
%ÃÖÁÓÅâÃÅ@M@
%ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@z@}£™¤…}@k@}„�£�}@åÁÓäÅ@M@
%âÅÓÅÃã@ÑâÖÕmÁÙÙÁèÁÇÇ@M@
%ÑâÖÕmÖÂÑÅÃã@M@
%}…•¥É„}@åÁÓäÅ@ÅÕåÉÄ@k@}¤¢…™Å”—•–}@åÁÓäÅ@ãÙÉÔ@M@
%ÅÔ×ÕÖ@]@
%]@ÆÖÙÔÁã@ÑâÖÕ@
%]@
%ÆÙÖÔ@âÅââÉÖÕ@K@ÅÔ×ÕÖmÓÉâã@]@ÆÖÙÔÁã@ÑâÖÕ@ÁÂâÅÕã@ÖÕ@ÕäÓÓ@
%]@k@ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@åÁÓäÅ@}†�“¢…}@k@}âØÓÉ•†–}@åÁÓäÅ@ÑâÖÕmÖÂÑÅÃã@M@
%}”…¢¢�‡…ÉÄ}@åÁÓäÅ@}âØÓðòððð}@k@
%}”…¢¢�‡…}@åÁÓäÅ@}Ù…˜¤…¢£…„@™…¢–¤ƒ…@•–£@†–¤•„@}@k@
%}ƒ¤™™…•£ã‰”…¢£�”—}@åÁÓäÅ@ÃäÙÙÅÕãmãÉÔÅâãÁÔ×@
%]@
%]@]@^@
%ÅÕÄ@@^@
%
%ÇÙÁÕã@ÁÓãÅÙ@k@ÅçÅÃäãÅ@@@
%ÖÕ@â×ÅÃÉÆÉÃ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâÔÅÔ×ÕÖ@
%ãÖ@ÁÔÁ×ÉÃâ@æÉãÈ@ÇÙÁÕã@Ö×ãÉÖÕ@^@
%
%ÇÙÁÕã@ÅçÅÃäãÅ@@@
%ÖÕ@â×ÅÃÉÆÉÃ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâÔÅÔ×ÕÖ@
%ãÖ@×äÂÓÉÃ@^@
%
%
\ No newline at end of file
+SET PATH *LIBL ; 
+
+CREATE OR REPLACE FUNCTION SAILPOINT.ES_GET_EMPLOYEE_NUMBER ( 
+	USERNAME CHAR(10) ) 
+	RETURNS CLOB(2147483647)   
+	LANGUAGE SQL 
+	SPECIFIC SAILPOINT.ESMEMPNO 
+	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 = *USER , 
+	SRTSEQ = *HEX   
+	BEGIN 
+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 ; 
+DECLARE GLOBAL TEMPORARY TABLE SESSION . EMPNO_LIST ( 
+ENVID CHAR ( 2 ) , LIB CHAR ( 10 ) , EXUSER CHAR ( 10 ) , EMPNO CHAR ( 8 ) ) 
+WITH REPLACE ; 
+FOR SELECT DISTINCT A . ENVID , TRIM ( 'CESLIB' || 
+CASE A . ENVID 
+WHEN 'MM' THEN '' 
+ELSE RIGHT ( A . ENVID , 1 ) 
+END ) AS CESLIB 
+FROM TABLE ( 
+SELECT ROW_NUMBER ( ) OVER ( 
+) AS RN , ENVID 
+FROM JSON_TABLE ( 
+SAILPOINT . ES_GET_ALL_MAPICS_ENVIRONMENTS ( ) , 
+'$.data[*]' 
+COLUMNS ( 
+ENVID VARCHAR ( 2 ) CCSID 37 PATH '$.envId' 
+) 
+) 
+) A 
+DO 
+BEGIN 
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION 
+BEGIN 
+END ; 
+SET CISTOOLS . SQL_STATEMENT = 
+'INSERT INTO SESSION.EMPNO_LIST ' || 'Select ''' || 
+ENVID || ''', ''' || CESLIB || ''', ExUser, Ext08A ' 
+|| 'FROM ' || CESLIB || '.ESUEXP WHERE ExUser = ''' 
+|| TRIM ( USERNAME ) || '''' ; 
+EXECUTE IMMEDIATE CISTOOLS . SQL_STATEMENT ; 
+END ; 
+END FOR ; 
+RETURN 
+COALESCE ( 
+JSON_OBJECT ( 
+'success' : 'true' , 'data' VALUE ( 
+SELECT JSON_ARRAYAGG ( 
+JSON_OBJECT ( 
+'envId' VALUE ENVID , 'userEmpno' VALUE TRIM ( 
+EMPNO ) 
+) FORMAT JSON 
+) 
+FROM SESSION . EMPNO_LIST ) FORMAT JSON ABSENT ON NULL 
+) , JSON_OBJECT ( 
+'success' VALUE 'false' , 'SQLInfo' VALUE JSON_OBJECT ( 
+'messageID' VALUE 'SQL02000' , 
+'message' VALUE 'Requested resouce not found ' , 
+'currentTimestamp' VALUE CURRENT_TIMESTAMP 
+) 
+) ) ; 
+END  ; 
+
+GRANT ALTER , EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.ESMEMPNO 
+TO AMAPICS WITH GRANT OPTION ; 
+
+GRANT EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.ESMEMPNO 
+TO PUBLIC ; 
+
