View previous topic :: View next topic
|
Author |
Message |
krishna_Murty Warnings : 2 New User
Joined: 17 Sep 2006 Posts: 24
|
|
|
|
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
PPQ-NUM-DAYS::::: PPQ-NUM-DAYS-XTL
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. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
61681 in hex is F0F1. The USAGE DISPLAY value of a PIC 9(02) field with value 1 (that is 01) is ... F0F1.
Redefining a PIC 9(02) field as PIC 9(04) COMP can be quite problematic ... what's the business case for this? |
|
Back to top |
|
|
krishna_Murty Warnings : 2 New User
Joined: 17 Sep 2006 Posts: 24
|
|
|
|
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. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, 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. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
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. |
|
Back to top |
|
|
|