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
 

 

comp1-comp2

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

New User


Joined: 27 Feb 2004
Posts: 18

PostPosted: Sat Jun 05, 2004 11:15 am    Post subject: comp1-comp2
Reply with quote

Hi

In cobol comp1 and comp2 will take 1 word and 2 word respectivelly.
But i would like to know its internal representation.here is an exp

77 d1 comp1
77 d2 comp2

move 100 to d1,d2.

How much byte will take in both cases and i would like to know how it will work internally.

Thanx
Back to top
View user's profile Send private message

mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1203
Location: India

PostPosted: Sat Jun 05, 2004 5:40 pm    Post subject: Re
Reply with quote

Dear

COMP-1 takes 4 Bytes and the internal format is: +0.9( 8 ) E+99

COMP-2 occupies 8 Bytes and the internal format is: +0.9(17)E+99

So the value for:

01 D1 COMP-1 VALUE ZERO.
01 D2 COMP-2 VALUE ZERO.

MOVE 100 TO D1.
MOVE 100 TO D2.


is:

+0.1E+3 and +0.1E+3 respectively.
Back to top
View user's profile Send private message
nandini

New User


Joined: 27 Feb 2004
Posts: 18

PostPosted: Sun Jun 06, 2004 9:45 am    Post subject:
Reply with quote

Hi sir,


Thank You sir, I have some more doubt on it.I couldn't undestand the ' E ' in
+0.1E+3 and can u explain by moving different values in to comp1 and comp2. Also why we are not specifying any pic value . Suppose if we are moving a value more than 2 word what happend? Hope u will reply


Love
Nandini
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1203
Location: India

PostPosted: Sun Jun 06, 2004 10:18 am    Post subject: Re
Reply with quote

'E' is a Code Character like 9, X, A, P , V, S & G. It occupies 1 Byte.

E Means Exponentiation.

Take the value 12345

You can say this as: 0.12345 * 10 ** 5

Internally this is equivalent to +0.12345E5

You can not specify Picture clause for COMP-1, -2, INDEX & POINTER data items. Because there Data type, size & format of this items are pre-defined.
Back to top
View user's profile Send private message
nandini

New User


Joined: 27 Feb 2004
Posts: 18

PostPosted: Sun Jun 06, 2004 12:38 pm    Post subject:
Reply with quote

Hi sir
Thank You sir,

Sir, u specified 'E' is a Code Character like 9, X, A, P , V, S & G' Whether
this letters have any significats or u specified it just like other character.


thanks
love
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 Differnce between comp1 and comp3 MikePradeep Mainframe Interview Questions 3 Mon Jan 22, 2007 7:18 pm
No new posts Why we do not use PIC clause in COMP1... Ratan Deokar COBOL Programming 1 Tue Dec 19, 2006 10:59 am
No new posts Moving COMP2 field to COMP3 ap_mainframes COBOL Programming 1 Thu Mar 23, 2006 8:43 am
No new posts COMP, COMP1, COMP2 & COMP3 in COBOL raghu_4412 Mainframe Interview Questions 14 Sat Mar 06, 2004 8:17 am
No new posts Pic in Comp1 and Comp2? vamseepotti COBOL Programming 1 Fri Feb 20, 2004 4:04 pm


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