I have one requirement, I have my current copybook as
05 PPQ-NUM-DAYS PIC 9(2).
Now there is a change of copybook , which says
05 PPQ-NUM-DAYS PIC 9(4) COMP.
05 PPQ-NUM-DAYS-XTL REDEFINES
PPQ-NUM-DAYS PIC 9(2)..
Now when i look at my data through File Aid
I am seeing like this
2/BI :::::::::: 2/NUM
(71-72) ::::: (71-72)R
9-------------- ::::: 10---------------
61681 ::::: 1
61682 ::::: 2
61683 ::::: 3
61684 ::::: 4
Can you please explaim me on these Binary Integers, and how is it equivalent to the non comp numbers, I mean (BI) 61682 = (NUM) 2.
Can you explain me please how can it be problematic, The business need is that Number of days , they forsee that they may increase to more number of dizits. Also F0F1 = 01, but how 61681 = 01, please can you explain. Like how we have HEX ON compand , can we have Binary on comand
Please guide me here. And thank you for your sooner reply.
Joined: 06 Jun 2008 Posts: 8165 Location: East Dubuque, Illinois, USA
The problem is that a COMP field accepts everything as a valid value. So the hex value for a DISPLAY field of 01 is F0F1; the COMP value for this number is 61681. So how do you know if F0F1 represents a DISPLAY value of 01 days or 61681 days?
Fire up the Windows calculator in scientific mode, enter 61681 as a decimal value then hit the HEX button. The display changes to F0F1, which is the hex value of 61681. Numbers only have meaning as agreed, and there are conflicting agreements possible with F0F1 -- as a COMP field it is 61681 decimal; as a COBOL DISPLAY field it is 01. You pays your money and takes your pick -- change the agreement you change the value. This is why I said it's problematic to do this.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Also, keep in mind that if the change is to accomodate more "days", all of the current values would need to be "converted" when the new copybook was activated. To do otherwise would become a maintenance nightmare. . .
Looking a bit further, "old" versions of the file (if this copybook is part of a file) may need to be converted as well if they are to be used.