def parseData(data):
    """
    Parse a dict of dicts to generate a list of lists describing
    the fields, and an array of the corresponding data records

    :param dict data: a dict of dicts with field names as keys, and each
                      sub-dict containing keys of 'Type', 'Length',
                      'Precision' and 'Data'.

    :returns: fields, records
    :rtype: list

    """

    fields = []
    records = []
    for k in list(data.keys()):
        t = data[k]['Type']
        l = data[k]['Length']
        if t == 0:
            nt = 'C'
            p = 0
        elif t == 1:
            nt = 'N'
            p = 0
        elif t == 2:
            nt = 'N'
            p = data[k]['Precision']
        else:
            nt = t
            p = 0

        fields.append([k, nt, l, p])
        records.append([data[k]['Data']])

    return fields, records