Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


COMP-3 field occupy ?

Answers were Sorted based on User's Feedback



COMP-3 field occupy ?..

Answer / shan

(N+1)/2 bytes

Is This Answer Correct ?    21 Yes 4 No

COMP-3 field occupy ?..

Answer / phani

if n is even, then n/2 + 1 bytes
if n is odd, then int(n+1/2) bytes
every time rightmost 1/2 byte is used to store sign value.

Is This Answer Correct ?    5 Yes 3 No

COMP-3 field occupy ?..

Answer / sp

Its not even and odd. Its jst (n+1)/2. If aftre calculation
we are getting decimal value then it will roundeed to next
value.

Is This Answer Correct ?    4 Yes 2 No

COMP-3 field occupy ?..

Answer / vasanth

No it should be M+N/2 for bytes allocation in case of
variable var1 pic 9(6)v99 comp-3

where M=6 and N=2

The limit of comp-3 variable declartion is EX: var1 s9(18)
comp-3

Is This Answer Correct ?    9 Yes 9 No

COMP-3 field occupy ?..

Answer / vasanth

I guess there is no Odd and Even theory in case of COMP-3
variable memory allocation calculation.

If there is an fractional output of M+N/2+1
Then the value is rounded off to its next value accordingly.

Is This Answer Correct ?    2 Yes 2 No

COMP-3 field occupy ?..

Answer / sid

Hi Friends;

Here I want to contribute a few lines in this discussion,
those might helpful to understand it very clearly.

BINARY
Specified for binary data items. Such items have a decimal
equivalent
consisting of the decimal digits 0 through 9, plus a sign.
Negative numbers
are represented as the two's complement of the positive
number with the same absolute value. The amount of storage
occupied by a binary item depends on the number of decimal
digits defined in its PICTURE clause:
1 through 4 2 bytes (halfword)
5 through 9 4 bytes (fullword)
10 through 18 8 bytes (doubleword)

The operational sign for ?big-endian? binary data (such as
OS/390 and VM) is contained in the left most bit of the
binary data. The operational sign for ?little-endian? binary
data is contained in the left most bit of the right most
byte of the binary data.

PACKED-DECIMAL
Specified for internal decimal items. Such an item appears
in storage in
packed decimal format. There are 2 digits for each character
position, except for the trailing character position, which
is occupied by the low-order digit and the sign. Such an
item can contain any of the digits 0 through 9, plus a sign,
representing a value not exceeding 18 decimal digits.

The sign representation uses the same bit configuration as
the 4-bit sign
representation in zoned decimal fields.

Following is the range I found in a IBM COBOL Programming manual

Picture Storage representation Numeric values

S9(1) through S9(4) Binary half-word (2 bytes) -32768
through +32767
S9(5) through S9(9) Binary full-word (4 bytes)
-2,147,483,648 through
+2,147,483,647
S9(10) through S9(18) Binary double-word (8bytes)
-9,223,372,036,854,775,808 through +9.223,372,036,854,775,807

9(1) through 9(4) Binary half-word (2 bytes) 0 through 65535
9(5) through 9(9) Binary full-word (4 bytes) 0 through
4,294,967,295
9(10) through 9(18) Binary double-word (8bytes) 0 through
18,446,744,073,709,551,615

Is This Answer Correct ?    1 Yes 2 No

COMP-3 field occupy ?..

Answer / krishna chaitanya

Comp3 will occupy from s9(1) to s9(18) . it wont exceed more
than it . So max value of comp3 is 10 bytes

i.e, 18/2 +1 = 9 + 1 = 10 bytes .

I thk i am correct .

Is This Answer Correct ?    1 Yes 2 No

COMP-3 field occupy ?..

Answer / mf buzz

Hi,
for pic 9(n) comp-3.
if n is even, then n/2 + 1 bytes
if n is odd, then int(n/2) bytes.

Is This Answer Correct ?    5 Yes 9 No

Post New Answer

More COBOL Interview Questions

With in these three which one is the default one Call Reference, Call By Value, Call By Content.-Which one is default?

4 Answers   IBM,


how we rectify soc4 and soc7 error in project(need real time answer)? please reply

3 Answers   HCL, Wipro,


What is the size of s9(19)comp3? explain

8 Answers  


in the TIME parameter we r giving hours r minutes

4 Answers   IBM,


what is the difference between Plan & package?

1 Answers   IBM,


IDENTIFICATION DIVISION. PROGRAM-ID. MOVEPGM. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-I PIC 9(2). PROCEDURE DIVISION. A1000-MAIN-PARA. PERFORM PARA-X WITH TEST BEFORE UNTIL WS-I= 5 STOP RUN. PARA-X. DISPLAY "BEST2". I m getting error s722,while executing the program, seems getting in loop, can anybody tell me why

3 Answers  


I am getting S00F abend when i try to compare two variable of different pic class,one variable is of 9(09) and another is S9(09) comp-3. First i moved the data from S9(09) comp-3 to 9(09), but no luck. So i tried to move the data from S9(09) comp-3 to X (09) and move to 9(09). I am getting same error message, Please help me to find solution for this ptoblem. ERROR MESSAGE - "The system or user abend S00F R=NULL was issued."

1 Answers  


I have a PS file and I would like to manually insert the binary values (like a COMP format) into the file. How can i do that? the way do in COMP-3 format.. suppose i want to insert -12345 in to file in comp-3 format. simply we can open a file in edit mode and do HEX-ON and insert the value . SEE BELOW-- 135 24D in 3 bytes - this will be COMP-3 presenatation of -12345.

1 Answers  


Describe the cobol database components?

0 Answers  


What does MAXCC 3 means? It is used in one my codes.

2 Answers   Wipro,


select TURE Statement(s) aboUt eject statemenet in cobol? a)The eject statememnt must be the only statement on the line b.It causes the program to edit abnormally c. eject statement can be written in either area A or area B d. specifies that the next source statement is to be printed at Top of the next page e.The EJECTstatement has no effect on the compilation of the source program itself

2 Answers  


What are the divisions in a cobol program? Which one is the mandatory division among them?

1 Answers  


Categories