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

wht r the advantages of 77 level number ?

8 Answers   TCS,


What is the difference between PIC 9.99 and PIC9v99?

0 Answers  


How do u sort the table for Search ALL? Is it only using ASCENDING KEY IS statement in occurs clause? If the data is input in non ascending order, will the ASC KEY IS automatically sort the data? or will it throw compile time error?

1 Answers   CTS,


What is the use of LINKAGE SECTION?

1 Answers  


In a program, variables are used but no DB2 involved in it. Can you call it as host variables??

4 Answers   EDS,






What do you understand by psb and acb?

0 Answers  


created cluster using IDCAMS ..that is empty ..when i write a program for read using Input ..wil it open the cluster or gives any error?

2 Answers   HCL,


SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.

3 Answers   Lehman Brothers,


What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I am going to Display the WS-VARX and WS- VARN?

6 Answers   Xansa,


What is the figurative constant in cobol?

1 Answers  


What is the difference between binary search and sequential search?

0 Answers  


have in 100 records in a file i want to move only matched records to one output_file1 and nonmathed records are moved to another output_file2 ... any one can provide logic code

3 Answers  


Categories