SET PATH *LIBL ; 

CREATE OR REPLACE FUNCTION CISTOOLS.GET_UNIQUE_TOKEN ( ) 
	RETURNS VARCHAR(26)   
	LANGUAGE SQL 
	SPECIFIC CISTOOLS.GET_UNIQUE_TOKEN 
	NOT DETERMINISTIC 
	READS SQL DATA 
	CALLED ON NULL INPUT 
	SET OPTION  ALWBLK = *ALLREAD , 
	ALWCPYDTA = *OPTIMIZE , 
	COMMIT = *NONE , 
	DBGVIEW = *SOURCE , 
	DECRESULT = (31, 31, 00) , 
	DYNDFTCOL = *NO , 
	DYNUSRPRF = *USER , 
	SRTSEQ = *HEX   
	BEGIN 
RETURN HEX ( GENERATE_UNIQUE ( ) ) ; 
END  ; 

LABEL ON SPECIFIC FUNCTION CISTOOLS.GET_UNIQUE_TOKEN 
	IS 'Get Unique Token' ; 

GRANT ALTER , EXECUTE   
ON SPECIFIC FUNCTION CISTOOLS.GET_UNIQUE_TOKEN 
TO AMAPICS WITH GRANT OPTION ; 

GRANT EXECUTE   
ON SPECIFIC FUNCTION CISTOOLS.GET_UNIQUE_TOKEN 
TO PUBLIC ; 

