Suppose i want to declare a binary comp fild of 7 byte .how
to write?

Answers were Sorted based on User's Feedback



Suppose i want to declare a binary comp fild of 7 byte .how to write?..

Answer / i go crazy

Hi Suv,

If u code S9(14) COMP, it will take double word i.e. 8
bytes. Below is the size of comp variables.
S9(01) - S9(04) : 2 BYTES.
S9(05) - S9(09) : 4 BYTES.
S9(10) - S9(18) : 8 BYTES.

Is This Answer Correct ?    14 Yes 0 No

Suppose i want to declare a binary comp fild of 7 byte .how to write?..

Answer / tata

if we use comp3(packed decimal)
declare like 01 a pic s9(13)comp3.
13/2=6.5 and s takes extrahalf byte.
that is 6.5+0.5=7.

Is This Answer Correct ?    4 Yes 0 No

Suppose i want to declare a binary comp fild of 7 byte .how to write?..

Answer / suv

If your question is like this:::
Suppose i want to declare a binary COMP field of storage 7
bytes .how
to write?


Answer is:
PIC S9(14) COMP.

storage byte required by COMP field will = half of the
digit specified in the PIC clause.
Just an info....
storage byte required by COMP3 field will = ( half of the
digit specified in the PIC clause)+1

Please correct me if I am wrong.

Is This Answer Correct ?    6 Yes 6 No

Suppose i want to declare a binary comp fild of 7 byte .how to write?..

Answer / ankit

hi i think you cannot declare binary comp of 7 bytes
exactly as the comp variable are fixed to half(2 bytes)
word,full word(4 bytes) and double word(8 bytes), so you
need to choose the paricular comp variable to use ok
correct me if i am wrong

Is This Answer Correct ?    1 Yes 2 No

Suppose i want to declare a binary comp fild of 7 byte .how to write?..

Answer / sudheer

COmp will take 2byte pic size-1-4
4byte pic size 5-9
8byte pic size 10-18

if we use comp-3 it will take n/2+1/2 byte extra for sign if
pic is odd no.if it is even it will take n/2.

my answer is 8 bytes

pls let me know if any thng wrong

Is This Answer Correct ?    0 Yes 1 No

Suppose i want to declare a binary comp fild of 7 byte .how to write?..

Answer / sky

you would declare it as s9(7) comp

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More COBOL Interview Questions

What is a SSRANGE and NOSSRANGE?

0 Answers  


what are the error codes in cobol, db2, cics, vsam , and jcl

2 Answers   TetraSoft,


What is CALL statement in COBOL?

4 Answers  


What is the difference between CALL BY VALUE and CALL BY CONTENT?

7 Answers  


consider the following two IF statements: IF X AND NOT Y MOVE A TO B IF Z=1 OR 9 MOVE A TO B select one of the following data divusion entries which gives identical results for both the above IF statements a.01 Z PIC 9 88 X VALUE 1.9 88 Y VALUE 0.2 THRU 8 b.01 Z PIC 9 88 X VALUE 0.2 THRU 8 Y VALUE 1.9 c.01 Z PIC 9 88 X VALUE 1.9 88 NOT-Y VALUE 0.2 THRU 1.9 d.none of yhe above

3 Answers   TCS,






what is the difference between COBOL2 AND COBOL390?

0 Answers   L&T,


what is the use of outrecord?

0 Answers  


How many divisions we have in Cobol ?

4 Answers   Wipro,


What is the purpose of Identification Division?

1 Answers  


How may divisions are there in JCL-COBOL?

5 Answers   IBM,


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


Categories