code for generating loan-count, patron-db and lids-db using transducers