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

Requirement change in storing comp -3 S9(18) to S9(20)


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sudeshna Sarkar

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Mon May 17, 2010 12:42 am
Reply with quote

Hi,

I was asked a question as to, a COMP-3 variable stores 18 digits using 10 bytes , i.e. S9(18).

Now the requirement changes and I am supposed to store S9(20), consider there is an increment in the length of the field. In this case what are the changes that I need to make? Rather, which storage will be best for S9(20)?

I had absolutely no idea, I have also searched across forums, but could not get any answer. Any help is appreiciated!

TIA.. icon_rolleyes.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 17, 2010 1:46 am
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals". The top set is for COBOL.

Suggest you look at the Language Reference for your version of cobol and read about numeric fields and their capacity. If you find something in the documentation that is not clear, post what you found and your doubt. Someone here will be able to clarify.
Back to top
View user's profile Send private message
Sudeshna Sarkar

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Mon May 17, 2010 11:59 pm
Reply with quote

From what I have read and understood till now, is that the COMP usages can handle fields with size till S9(18), that is COMP-3 can store max 18 digits using 10 bytes.

After this if we have more digits like S9(20), then I think we better not use COMP-3 or any other COMP any more, just go for simple numeric declaration.

Please correct me if I am wrong!
icon_sad.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue May 18, 2010 12:06 am
Reply with quote

Pay particular attention to the ARITH(EXTEND) compiler option in the USAGE clause section of the manual.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue May 18, 2010 12:09 am
Reply with quote

What version/release of COBOL are you using?

If you're not sure, does your compiler support option ARITH(EXTEND)?

Note for 9(18) COMP-3, the high-order 4-bit nibble of the first byte is not addressable.

Bill
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed May 19, 2010 10:12 am
Reply with quote

Hi,

COMP-3 can store upto S9(31), ie 15 bytes , if compiler option ARITH(EXTEND) is enabled.

Sun
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed May 19, 2010 5:35 pm
Reply with quote

Don't you mean 16 bytes?
Back to top
View user's profile Send private message
Sudeshna Sarkar

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Mon May 31, 2010 12:22 pm
Reply with quote

Hi,

@ Bill: Sorry for the delayed reply. Yes well in our ZOS, we are hosting both COBOL 85 as we as Enterprise COBOL.

As I read from the manuals, the option ARITH(EXTEND) thereby supporting more than 18 digits of storage of COMP-3 variables, is permissible only on Enterprise COBOL.

So ideally for storing data of more capacity, Enterprise COBOL must be used and moreover system must support compiler option ARITH(EXTEND). Will try this out soon and let you know my results.

Thanks again.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 31, 2010 12:36 pm
Reply with quote

Hello,

Quote:
we are hosting both COBOL 85
Post the compiler release shown in the beginning of the complier output.

COBOL 85 is a standard, not a version of the compiler. . .

Unless i missed a memo. . . icon_smile.gif
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Storing a BLOB/CLOB in PL/I PL/I & Assembler 4
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
Search our Forums:

Back to Top