Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
nandini

New User

Joined: 27 Feb 2004
Posts: 18

 Posted: Sat Jun 05, 2004 11:15 am    Post subject: comp1-comp2 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

mcmillan

Joined: 18 May 2003
Posts: 1204
Location: India

 Posted: Sat Jun 05, 2004 5:40 pm    Post subject: Re 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.
nandini

New User

Joined: 27 Feb 2004
Posts: 18

 Posted: Sun Jun 06, 2004 9:45 am    Post subject: 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
mcmillan

Joined: 18 May 2003
Posts: 1204
Location: India

 Posted: Sun Jun 06, 2004 10:18 am    Post subject: Re '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.
nandini

New User

Joined: 27 Feb 2004
Posts: 18

 Posted: Sun Jun 06, 2004 12:38 pm    Post subject: 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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Differnce between comp1 and comp3 MikePradeep Mainframe Interview Questions 3 Mon Jan 22, 2007 7:18 pm Why we do not use PIC clause in COMP1... Ratan Deokar COBOL Programming 1 Tue Dec 19, 2006 10:59 am Moving COMP2 field to COMP3 ap_mainframes COBOL Programming 1 Thu Mar 23, 2006 8:43 am COMP, COMP1, COMP2 & COMP3 in COBOL raghu_4412 Mainframe Interview Questions 14 Sat Mar 06, 2004 8:17 am Pic in Comp1 and Comp2? vamseepotti COBOL Programming 1 Fri Feb 20, 2004 4:04 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us