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
 
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: 1543
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: 8189
Location: East Dubuque, Illinois, USA

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: 2504
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: 2504
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 How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 0 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 3 Tue Nov 07, 2017 8:34 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

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