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
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 |
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 |
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 |
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 |
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 |
Answer / vineet pasricha
nice ques.
remove pic clause from d
it will take 54 bytes
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?
How to retrive the 9th records out of ten records using the cobol program ?
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
input:- 12233344445555566666... output:- 1=1,2=4,3=9... Here firstno i.e 1 should be displayed and after that the alikeno.s should be added n displayed.i.e 2+2=4 like tat it goeson.
What is amode(24)?
In the JCL, how do you define the files referred to in a subroutine ?
What does the INITIALIZE verb do?
can internal sort be applied to sort ksds files?
what is the difference b/w level no.01 & level no.77?
is it possible to pass an SQL query inside a jcl which is inside a cobol program?
what are the utilities for load and unload the DB2 tables
what will happen if pass values more than 100 using PARM parameter?