I have the following variable in COBOL program which gets its value from a file, when it is read:
01 Employee-number PIC 09(8) comp
01 Employee-number-x redefines
Employee-number PIC x(04)
I have another variable in the same program:
01 D-element-number PIC 9(04)
Now,
Move Employee-number
to D-element-number
Then I write this D-element-number
to a file
value read from input file is :
0013
0024
so this value comes to Employee-number
and Employee-number-x
and I move this value to D-Element-number
and write this variable to a output file.
But I get this in the output file:
4660
FFFF
4660
4660
is the decimal equivalent of X'1234'
But I want to see something like:
1234
FFFF
1234
How can I achieve this ?
I am allowed to change the definition of D-element-number
but nothing else.