Those records should exist at the National Archives and Records Administration (NARA) as part of the War Department Collection of Confederate Records, Record Group 109. These are part of the records of the Office of the Commissary General of Prisoners, and each individual prison turned their records into that office. Contact the nearest NARA office near where you live (look for the agency website to tell you specifics) or contact the agency main office in Washington, D. C.
Here is Missouri in 1995 Joanne Chiles Eakin sifted through those prison records to record in book form the main prison accounting ledger for all the Missourians held at the St. Louis area prisons (which includes the prison at Alton, IL). She did not include in her book prisoners from other states. I obtained the above information from the introduction to her book.
Bruce Nichols