View previous topic :: View next topic
|
Author |
Message |
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
We have an IMS database (HISAM) on which we are having to change the length of 1 field. The current definition of the field is
PIC S9(3)V99 COMP-3.
We need to increase the value to hold at least 9999. Is there any way we can accomodate a larger value without changing the length?
If we do not have to change the length, then a simple cobol copybook change will do. else we will have to redefine the whole database.
For example, we are changing another field from PIC S9(5)V99 COMP-3 to PIC S9(7)V99 COMP which will keep the length same but accomodate a larger value.
Any help will be greatly appreciated!! |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
naive,
Why would not the same scheme work for this field? Change from S9(3)V99 COMP-3 to S9(4)V99. This would give you a 4 byte value of +/- 2147483647. You will still have to unload the database, convert it to the new layout and reload it, then find all the programs that use that field and re-compile them. You will also have to make sure that no 'OLD' versions of unloads/extracts ever get used again.
Dave |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Quote: |
For example, we are changing another field from PIC S9(5)V99 COMP-3 to PIC S9(7)V99 COMP which will keep the length same but accomodate a larger value.
|
isn't that actually one byte larger (was 4, now 5 bytes long)? |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
dneufarth,
Correct, Type to fast. Nice catch.
Quote: |
Change from S9(3)V99 COMP-3 to S9(4)V99
|
should read
Quote: |
Change from S9(3)V99 COMP-3 to S9(4)V99 COMP
|
Now its the same size. |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
guys, actually it isnt working out thataway!
S9(3)V99 COMP-3 Length = 3
S9(4)V99 COMP Length = 4
This is probably coz the COMP fields can have lengths of 2,4 etc.
Any other ideas? |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
my error; thought they were both comp-3 |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
naive,
Maybe I should go back to Arithmetic 101
How many programs use the field you want to modify compared to the total number of programs that would have to be re-compiled to restructure the database? You could define the field as a PIC X(3) and store the binary value in it, but then you would have to do some manipulation of the field in every program that accesses it.
Please come back,
Dave |
|
Back to top |
|
|
|