IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL Layout/ Picture Clause Query


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Tue Apr 25, 2006 4:40 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Apr 25, 2006 5:15 am
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Apr 25, 2006 5:58 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Apr 25, 2006 6:04 am
Reply with quote

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
View user's profile Send private message
naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Tue Apr 25, 2006 6:47 am
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Apr 25, 2006 8:24 am
Reply with quote

my error; thought they were both comp-3
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Apr 25, 2006 10:12 pm
Reply with quote

naive,

icon_redface.gif Maybe I should go back to Arithmetic 101 icon_redface.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top