Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL Layout/ Picture Clause Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COBOL Layout/ Picture Clause Query
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    Post subject: Re: COBOL Layout/ Picture Clause Query
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: 241
Location: Cincinnati OH USA

PostPosted: Tue Apr 25, 2006 5:58 am    Post subject:
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    Post subject: Re: COBOL Layout/ Picture Clause Query
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    Post subject:
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: 241
Location: Cincinnati OH USA

PostPosted: Tue Apr 25, 2006 8:24 am    Post subject:
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    Post subject: Re: COBOL Layout/ Picture Clause Query
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us