I have a text file with data extracted from a mainframe. One of the fields contains dollar amounts with a format of PIC S9(13)V99 COMP-3 per the file layout I have.
It should be have both negative and positive amounts, and i'm assuming 2 decimals, but i have no way of knowing. I've tried a variety of informats to read it in but i'm not sure if i'm using the right ones (zoned,packed,etc.) Any thoughts? Thanks.
The format of your value is specifical to COBOL. Normally, its size must be of 8 bytes on the mainframe.
If you want readable data, you should have a COBOL program which transfoms your file containing packed decimal data into a file containing edit data or readable data.
In your case, the program should contain for example :
Also, if you have no way to make a COBOL translation program, I explain you how to read decimal packed data.
In your case, you have an amount of PIC S9(13)V99 COMP-3 format : this kind of COBOL format is only aimed for computation. In this case, the decimal point is ignored.
I told you in my prior post, this format takes 8 bytes on the mainframe.
Example 1 : you have an amount of + 12345.67, the 8 bytes will contain the following HEXADECIMAL values from left to right :
A forum community dedicated to tech experts and enthusiasts. Come join the discussion about articles, computer security, Mac, Microsoft, Linux, hardware, networking, gaming, reviews, accessories, and more!