I have a DB2 database consuming a byte encoded zip code. I'm told that the mainframe reads in the standardize US zip/postal code and encodes it to byte format (using COBOL) due to space constraints. The DB2 database reads in the encoded zip code into a VARCHAR(9) field. Is there any way to take the DB2 output and translate it back to the original zip code to represent the data as if it came in as a normal 5-4 format zip/postal code?
Ideally my solution would be in SQL, but python or C# would be helpful as well. Thank you.
Here are some examples of the encoded zip code coming off the mainframe.
134771824 the address is for Hartford, Ct and i would expect it to be 06103.
122900373 for Belfast Me 04915
In this use case, I’m working on the back end Teradata warehouse. I’m ingesting this information from IBM DB2 database and the raw data is stored on IBM COBOL mainframe. The mainframe doesn’t maintain the original zip code.
Seems like I should be able to manipulate the 9 digits back to 5 characters is the goal