import re


def _get_return_code_num(rc_str):
    """Parse an integer return code from
    z/OS job output return code string.

    Arguments:
        rc_str {str} -- The return code message from z/OS job log (eg. "CC 0000")

    Returns:
        Union[int, NoneType] -- Returns integer RC if possible, if not returns NoneType
    """
    rc = None
    match = re.search(r"\s*CC\s*([0-9]+)", rc_str)
    if match:
        rc = int(match.group(1))
    return rc