I want to fill my Input file with data manually.
What i'm supposed to put in a field with type PIC 9(11) COMP-3.
Can anyone help me ?
I want to fill my Input file with data manually.
What i'm supposed to put in a field with type PIC 9(11) COMP-3.
Can anyone help me ?
Answer to "how do I place PACKED-DECIMAL data into a file that is read by COBOL, with the record including a table of COMP-3 variables":
You don't. Define the file with only USAGE DISPLAY
or USAGE NATIONAL
to be able to easily adjust the file.
You may use a COBOL conversion program (or external sort program) on the file to convert it to using COMP-3 in the output file.
Or you do, then use an hex editor to add packed-decimal values in like 0x01234f
(which would be 1234 unsigned, with whatever decimal place the COBOL definition has). In this case take care to match the defined structure exactly.
You can EDIT your input file with an editor that supports HEX edition, and put the values at the required offset. Remember that packed-values are expressed with two digits per byte. If you're using TSO, you will see something like that bellow. the value 00000001234 represented in three different formats: (col 1:6) PIC 9(11) COMP-3. (col 7:6) PIC S9(11) COMP-3. (col 13:11) PIC 9(11).
As you can see, the first line is what you get when you're viewing the data in standard output (at this line values can be edited just at columns that is not packed). The second and third lines are showing the packed-value (at those lines you can modify the packed-values).