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

[Closed]Why COMP-1 and COMP-2 dont hav picture clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Mar 09, 2007 5:48 am
Reply with quote

Sometimes some people just do not see the difference betwee "A and "B", all they see is that "they're letters, so what"..... icon_rolleyes.gif
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Fri Mar 09, 2007 1:45 pm
Reply with quote

Quote:
COBOL Computational Fields:
This is a discussion of COBOL Computational fields. Several numeric data types are discussed, including the common "packed" and "comp-3" fields.


By default, numeric values in COBOL files are stored in display, or character, format. That is, the value is stored as a base-ten number, with each digit represented by the corresponding EBCDIC (or ASCII) character. For example, the value 1234 is stored in four bytes which contain "1", "2", "3", and "4" (F1, F2, F3, F4 Hex).

But because computers perform computations with binary numbers, it is more efficient to store values in their native binary form than to store them in human readable base ten. If the number is stored in its native binary format it can be input from the file and used directly. If it's stored in a base ten format it needs to be converted to binary before performing calculations on it, then converted back to base ten for storage. Binary is faster -- typically about 8 times -- and usually requires less storage space.

this is from http://www.discinterchange.com/TechTalk_COBOL_comp_.html

see the line because computers perform computations with binary numbers, it is more efficient to store values in their native binary form than to store them in human readable base ten

as far as i know This is what main aim of COMP and
Quote:
When it adds 2 + 2, it adds X'2C' to X'2C' and the result is X'4C'


as a student from electronics i am not understand that because GATES and BUFFERS are the main building blocks of computer as far as i know electrical pulses does the arithmatic .I dont know how computer will know what is that X2C that is a higher version

william you are seeing things only from ouside i think you had to read more to get inside
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Mar 09, 2007 6:48 pm
Reply with quote

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: Fri Mar 09, 2007 9:34 pm
Reply with quote

Hi Bill,

Once again, he is posting information that is not mainframe-based.

If we could only get him to realize that windows/unix are very different than the IBM mainframe.

Probably won't happen. For some, what they learn first, overrides any additional learning.

Maybe with time he'll learn that while a lot of the syntax is the same, much of the underlying infrastructure is not between the platforms.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Mar 09, 2007 11:43 pm
Reply with quote

We can alway hope....

Never the less, 'nuff said....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
Search our Forums:

Back to Top