Seems a bit backward – I put a table of codes and messages in the DB, and have scripts look it up. But if that’s what you have to have, you could try the view() function from the Simulation Aids module. Feed it a dataset with the code numbers, and get a dataset with code vs message.