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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Requirement change in storing comp -3 S9(18) to S9(20)
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

Site Director


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

PostPosted: Mon May 17, 2010 1:46 am    Post subject:
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    Post subject: Requirement change in storing comp -3 S9(18) to S9(20)
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue May 18, 2010 12:09 am    Post subject: Reply to: Requirement change in storing comp -3 S9(18) to S9
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    Post subject: Hi
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    Post subject:
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    Post subject: Requirement change in storing comp -3 S9(18) to S9(20)
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

Site Director


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

PostPosted: Mon May 31, 2010 12:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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