Determine the total no of bytes in the following.

01 rec1.
02 a pic x(6)
02 b redefines a.
03 c occus 6 times pic 9.
02 d occurs 6 times pic 9.
03 e pic x(5)
03 f pic 999.

Answers were Sorted based on User's Feedback



Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / guest

It should be 54. (ie 6 + 8*6)

Is This Answer Correct ?    8 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / guest

01 rec1.
02 a pic x(6)
02 b redefines a.
03 c occus 6 times pic 9.----------- 6 bytes
02 d occurs 6 times.
03 e pic x(5)-----------------------30 bytes
03 f pic 999.-----------------------18 bytes
________
54 bytes
scenario 2:If we remove e and f

01 rec1.
02 a pic x(6)-------------------------------6 bytes
02 b redefines a.
03 c occus 6 times pic 9.
02 d occurs 6 times pic 9.-------------------6 bytes
___________
12 bytes

Is This Answer Correct ?    5 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / sri

It has to be 54 (6 + (8*6)) if we remove PIC clause from d.

Is This Answer Correct ?    2 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / milan kumar

a PIC X(6)-------------6B
b REDEFINES A ---------0B
IF WE REMOVE PIC CLUSE
D=( E PIC X(5)+F PIC 999)
D=(8B OCCURS 6 TIMES)
D----------------------48B
----------
TOTAL OF 54B

Is This Answer Correct ?    1 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / imran ahmad

FIRST YOU HAVE TO REMOVE PIC CLAUSE FROM GROUP ITEM D

ANSWER IS 56

Is This Answer Correct ?    0 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / madeshh

1st of all it will give an error because of pic clause with
group item in occurs.
a.if we remove pic clause from there it will take 66 bytes.
01 rec1.
02 a pic x(6) == 6
02 b redefines a. == 0
03 c occus 6 times pic 9. == 0
02 d occurs 6 times.
03 e pic x(5) ==30
03 f pic 999. ==24
------
60
b.if we remove e,f
01 rec1.
02 a pic x(6) ==6
02 b redefines a. ==0
03 c occus 6 times pic 9. ==0
02 d occurs 6 times pic 9. ==6
----
12

Is This Answer Correct ?    0 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / vineet pasricha

nice ques.

remove pic clause from d
it will take 54 bytes

Is This Answer Correct ?    0 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / ram.g

54 is the right answer!

Is This Answer Correct ?    0 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / v@m$i

first u r syntax is wrong.
6
6
6
6
30
18
---
72

Is This Answer Correct ?    0 Yes 0 No

Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefi..

Answer / madesh

1st of all it will give an error because of pic clause with
group item in occurs.
a.if we remove pic clause from there it will take 66 bytes.
01 rec1.
02 a pic x(6) == 6
02 b redefines a. == 6
03 c occus 6 times pic 9. == 0
02 d occurs 6 times.
03 e pic x(5) ==30
03 f pic 999. ==24
------
66
b.if we remove e,f
01 rec1.
02 a pic x(6) ==6
02 b redefines a. ==6
03 c occus 6 times pic 9. ==0
02 d occurs 6 times pic 9. ==6
----
18

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More COBOL Interview Questions

How do you define a sort file in JCL that runs the COBOL program?

6 Answers   Syntel,


What is the difference beetween Arrays and Tables in Cobol? please dont give the answer that arrays in cobol terminology is called tables......

3 Answers   BirlaSoft,


What rules are to be followed while using the corresponding options?

0 Answers  


Explain complete concept of table handling in COBOL with an example?

2 Answers   IBM, TCS, Wipro,


what is scope terminator

2 Answers   IBM,






How to read records which is in sequential file in reverse order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my doubt any one

10 Answers   IBM,


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

2 Answers   TetraSoft,


what is Reentrancy and Quasi-reentrancy?

1 Answers  


What is the difference between SEARCH and SEARCH ALL?

6 Answers   Cognizant,


How do you reference the fixed block file formats from cobol programs

0 Answers  


i want a program using by if, evaluate , string, unstring, perform, occurs?

1 Answers  


01 text-data pic x(100). move 'xyzdbfrjjg u' to text-data. how to find the value of last index of text-data?

3 Answers   Mind Tree,


Categories