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
 

 

Single and Double Precession Floting Point

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

New User


Joined: 26 May 2006
Posts: 35
Location: india

PostPosted: Thu Nov 29, 2007 4:12 pm    Post subject: Single and Double Precession Floting Point
Reply with quote

What is this single and doubble precession floting point?
What is the difference between them, can any one explain explain it with some example??
Back to top
View user's profile Send private message

amajhi

New User


Joined: 21 Jul 2006
Posts: 18
Location: Pune

PostPosted: Thu Nov 29, 2007 5:11 pm    Post subject: Reply to: Single and Double Precession Floting Point
Reply with quote

When you declare variable as

01 ws-var1 pic 9.99.
It is called single percision floating point.

and when it is declared as
01 ws-var1 pic 9v99.
It is called double precision floating point.

Difference is single precision floating point will take 1 byte extra in comparision double precision floating point.

Guys correct me if there is misunderstanding.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Nov 29, 2007 6:01 pm    Post subject:
Reply with quote

01 ws-var1 pic 9.99 is an edit mask

and

01 ws-var1 pic 9v99. usage is display.

you have to use one of the usage comp-? to indicate single and double percision floating point. I don't use them in banking and insurance so you guys will have to go to the manual.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Nov 29, 2007 6:46 pm    Post subject:
Reply with quote

Quote:
Guys correct me if there is misunderstanding.

Yes, there is complete misunderstanding.

rdr is asking about COMP-1 and COMP-2. I would suggest rdr to read manual for knowing more about them.
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: Fri Nov 30, 2007 1:29 am    Post subject:
Reply with quote

Hello Amajhi,

Where did you come to your understanding of floating point?

I suggest you discontinue using that source of information as it is completely in error.
Back to top
View user's profile Send private message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Tue Apr 22, 2008 2:11 pm    Post subject: Query about double precision computation
Reply with quote

How will you identify if a COBOL program is having double precision computation or not ?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Tue Apr 22, 2008 2:28 pm    Post subject:
Reply with quote

From manual,
Code:
 COMPUTATIONAL-1 or COMP-1 (floating-point)                                 
             Specified for internal floating-point items (single             
           precision). COMP-1 items are 4 bytes long.                       
                                                                             
 COMPUTATIONAL-2 or COMP-2 (long floating-point)                             
           Specified for internal floating-point items (double precision).   
           COMP-2 items are 8 bytes long.                     
Back to top
View user's profile Send private message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Tue Apr 22, 2008 2:55 pm    Post subject:
Reply with quote

Thanks for the response...

but i want to know that if there do not exist any such field(COMP 1 or 2) in the Cobol Code and i want to know whether these can be used in the code then how can i?
Back to top
View user's profile Send private message
Deepakgoyal2005

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Tue Apr 22, 2008 7:23 pm    Post subject:
Reply with quote

Is there any internal routine in COBOL to convert COMP-2 variables before processing specially when the lenth of the defined varaible is greater than 15.
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: Tue Apr 22, 2008 7:31 pm    Post subject:
Reply with quote

Hello,

Quote:
Is there any internal routine in COBOL to convert COMP-2 variables
What would you want to convert them to? Keep in mind that floating point is little used in cobol as floating point is typically not used for mainframe business (checkbook/accounting/inventory) applications.

I suggest you spend some time in the COBOL documentation (available via the "IBM Manuals" link at the top of the web page. There are both Language Reference and Programmers Guides available for multiple versions of cobol.

When you find something in the documentation that is not clear, post it here and your question concerning what you found. Someone should be able to help clarify for you.
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
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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