Suppose i want to declare a binary comp fild of 7 byte .how
to write?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
how can we get current dat and time thru cobol pgm
What is the significance of the PROGRAM-ID paragraph? If this name doesnt match with the name of the COBOL program, does it make a difference? Is the name specified in the PROGRAM-ID paragraph used as a name for the load module or any such thing?
what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99
I want to remove a duplicates form a given input field using cobol program. please Any one help me out to solve this ... Thanks in Advance.
OCCURS clause is used in the DATA DIVISION on data names at (a) 01 level (b) 77 level (c) 88 level (d) any level from 02 to 49
how to run sub programs using static and dynamic call ...
without performing any operations on a file how can i know whether it contains data or not
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?
What is level 66 used for ?
In INITIALIZE what is Repalcing Word will do
using redefine can you redefine lower variable size to higher variable size?