def mergeDataCodingTable(vartable, dctable):
    """Merges information from the data coding table into the variable
    table.

    Called by :func:`loadVariableTable`.

    :arg vartable: The variable table.
    :arg dctable:  The data coding table.
    """
    with_datacoding = vartable['DataCoding'].notna()
    for field in ['NAValues', 'RawLevels', 'NewLevels']:
        mask = vartable[field].isna() & with_datacoding
        newvals = vartable.loc[mask].merge(dctable, left_on='DataCoding',
            right_index=True, suffixes=('_v', '_dc'), copy=False)['{}_dc'.
            format(field)]
        vartable.loc[mask, field] = newvals
