Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 252
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: 252
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
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us