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
 

 

query on comp-3 and comp usage clauses

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sandy mf

New User


Joined: 26 Jun 2011
Posts: 7
Location: India

PostPosted: Thu Jun 21, 2012 10:00 pm    Post subject: query on comp-3 and comp usage clauses
Reply with quote

when we move 9(10) to s9(08) comp-3 and s9(08) comp variables does truncation occur.
If no what's the maximum value that can be moved to a s9(08) comp-3 and s9(08) comp variables
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1531
Location: Andromeda Galaxy

PostPosted: Thu Jun 21, 2012 10:04 pm    Post subject:
Reply with quote

Did you try writing a small program with displays on??

What was the output?

If you could answer me you can solve this your self ..
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: Thu Jun 21, 2012 10:13 pm    Post subject:
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals".

Suggest you look in the COBOL Language Reference for the maximum values for numeric fields. If you find something that is not clear, post what you found and your doubt. Someone will be able to clarify.

We will help, but we are not a manual reading service. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Thu Jun 21, 2012 10:17 pm    Post subject:
Reply with quote

Quote:
If no what's the maximum value that can be moved to a s9(08) comp-3 and s9(08) comp variables
In addition to Dick's suggestion, you'll want to read the Programming Guide manual for information about compiler options, since the options used can impact the maximum value a COMP variable can hold. In other words, the answer to your question is "it depends".
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: Thu Jun 21, 2012 10:22 pm    Post subject: Reply to: query on comp-3 and comp usage clauses
Reply with quote

Even numbered COMP-3 fields (except for 18) make no sense as they take up the same amount of storage. Use S9(09) COMP-3 instead.

As far as S9(08) COMP, if you're worried about high-order truncation, use the TRUNC(BIN) compile option and S9(09) COMP.

If your compiler supports COMP-5 (Native Binary) then change COMP to COMP-5 and the TRUNC option setting has no effect and high-order truncation will NOT occur.

The maximum positive value in a Signed 4-Byte Binary (COMP/COMP-5) field is X'7FFFFFFFFFFFFFFF'. If you remove the S from the picture clause, the maximum field value is X'FFFFFFFFFFFFFFFF', which is NOT negative one when the field is unsigned.

Maximum value in an S9(09) COMP-3 field should be easy to find in any of the manuals.
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: Thu Jun 21, 2012 11:31 pm    Post subject: Reply to: query on comp-3 and comp usage clauses
Reply with quote

Hi Bill,

I believe the max value of a s9(9) comp-3 field is self-explanitory, no? icon_cool.gif

d
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: Thu Jun 21, 2012 11:40 pm    Post subject: Reply to: query on comp-3 and comp usage clauses
Reply with quote

Hi Dick,

Perhaps for the most of us but not for the OP. That's why I advised the OP to consult the manuals.... icon_wink.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 -> 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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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