First, take the contents of the following file "fn_aut001_date_check.sql" with proper documentation.

---
* Checks if the given date is valid
 * 
 * @param {string} DATE - The date to check.
 * @param {string} ALLOW_NULL_VALUES - Whether a NULL value is valid.
 * @return {boolean} VALID - TRUE if 
 */
CREATE FUNCTION core.fn_aut001_date_check( STRING, ALLOW_NULL_VALUES STRING) AS (
....
)

---

Now, the following file, "fn_fun001_card_format.sql" is shown below. 

---
CREATE FUNCTION core.fn_fun001_card_format(f1 STRING, f2 STRING, f3 STRING)
RETURNS STRING
AS (
    CONCAT(LPAD(f1, 2, '0'), '.', LPAD(f2, 2, '0'), '.', LPAD(f3, 8, '0'), '-',
        -- Digito Verificador
        core.fn_aut001_card_digit('0','0', CONCAT('947', LPAD(f1, 2, '0'), LPAD(f2, 2, '0'), LPAD(f3, 8, '0'))))

---

You should edit the contents of the fn_fun001_card_format.sql file to document it in the proper style, as shown in the example before, fn_aut001_date_check.sql. 