If i initialize the 01 level variable in array, will it
initialize all the array elements (occurs)?

Answers were Sorted based on User's Feedback



If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / snehatechm

occurs clause of an array cant be coded in 01 level.
it should always be coded in work area 2

01 xxx-yyy.
03 XX-YYY-ARRAY OCCURS 10 TIMES.
05 XX-YYY-MEM1 COMP-3 PIC S9(9).
05 XX-YYY-MEM2 COMP-3 PIC S9(9)V9.

Is This Answer Correct ?    16 Yes 1 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / snehatechm

All ryt.Answer is no.array elements will not be initialised
automatically.
you can initialise the table with INITIALIZE verb.
INITIALIZE XXX-YYY
this will initialize your alphanumeric with space and
numeric with '0'.
apart from this by moving also u can initialise.

Is This Answer Correct ?    8 Yes 2 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / rakesh

I know we cant use occurs in 01 level. My question was, if
we initialize 01 level variable, in ur example, xxx-yyy,
will all the elements be initialized as well (xx-yyy-array,
xx-yyy-mem1 and xx-yyy-mem2)?

Is This Answer Correct ?    6 Yes 3 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / rakesh

Thanx babes (@Sneha)

Is This Answer Correct ?    4 Yes 1 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / vaneesh

Hi All

we can intialize the array item by simply intialize 01
level. It is irrespective of occours, clause.

If we write INTITIALIZE XXX-YYY
it will initailize all the elements of the array
irrespective of its occourance.

Is This Answer Correct ?    4 Yes 1 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / chandrababu naidu

we can't use array or table in 01 level item.
(or)
01 name.
02 name2 pic x(5) occurs 10 times.
INITIALIZE NAME.----> means the variable name contains 'spaces'.

Is This Answer Correct ?    1 Yes 1 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / nag(igate)

hi rakesh and sneha

we can initialize the array at group level.

01 xxx-yyy VALUE "ABCDEFGH"
03 XX-YYY-ARRAY OCCURS 2 TIMES.
05 XX-YYY-MEM1 PIC X(2).
05 XX-YYY-MEM2 PIC X(2).
the initialize value should depend on the number of times
the, occurs clause repeat.

Is This Answer Correct ?    0 Yes 0 No

If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?..

Answer / sharath

Assuming we have to initialize the array variables with
zeroes.
MOVE ALL '0' to the '01' group variable will initialize the
whole array.

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More COBOL Interview Questions

What is the Linkage section? What is the Use and Why the parm length use alway "PARM-LENGTH PIC S9(4) or PIC S9 (4) COMP." any reason?.Please let me know any one... Cheers,Prasad

8 Answers   Syntel,


What is file status 39 ?

10 Answers   JPMorgan Chase,


what is dynamic array in cobol? what is the difference b/w array and table in cobol?

2 Answers  


01 var1 pic s9(9)v99. 01 var2 pic x(30). procedure division. move 12345.99 to var1. move12345.99 to var2. display var1. display var2. what is the output?

2 Answers   IBM,


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

0 Answers  






Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - 40. The result in X is

12 Answers   TCS,


What is the difference between goback, stop run and exit program in cobol?

0 Answers  


Have you code any new programs in COBOL ? What is the functionality of the programs?

2 Answers   Patni, Xansa,


What is the difference between SEARCH and SEARCH ALL?

6 Answers   Cognizant,


Read filea And file b write the same records in both files? Records in a but not in b record in b but not in a

3 Answers   TCS,


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

2 Answers   TCS,


i want to enter the name 'pandu' into ur table how?

1 Answers   Fidelity,


Categories