How do u initialize an array?
Answers were Sorted based on User's Feedback
array can be initiazed by INITIALIZE verb or by moving the
values to the elements of a table.
if u initialise an array with INITIALIZE verb your
alphanumeric fields will be stored with space and numeric
fields with '0'.
| Is This Answer Correct ? | 9 Yes | 3 No |
Answer / nagaraj
You can initialize an array in several ways based on the
values in the array.
If you know the values in the array already, then you can
do it through REDEFINE clause. I will give an example here.
05 MONTHS-VAL PIC X(36)
VALUE 'JanFebMarAprMayJunJulAugSepOctNovDec'.
05 MONTHS REDEFINE MONTHS-VAL PIC X(3)OCCURS 12 TIMES.
If you want to initialize at run time based on the user
input, then you can pass the values via ACCEPT statement
(online) /SYSIN DD statement (batch) and initialize the
COBOL array.
If you want to initialize with default values then you can
do it using INITIALIZE verb but be careful doing so.
| Is This Answer Correct ? | 1 Yes | 0 No |
how to crack cts interview apps? NOVEMBER 21 2010
what is linkcard in cobol?
Which is not true about evaluate statement
Which is the best IBM mainframe Training Institute in Ameerpet, Hyderabad
88 level entry is used for (a) data items in WORKING-STORAGE SECTION (b) items with RENAMES clause (c) condition-names (d) None of the above
what is srange and nosrange pls reply to ths question ?
I have a seq file with different fields one field is address with pic x(50) as input in a cobol program. In address there is 'PUNE' at any different positions in the address field ( form 1 t0 50) . My requirement is select the fields with address 'PUNE' by using cobol. Please suggest
COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.
I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.
Can a Search can be done on a table with or without Index?
How To move a value to an array using move verb?
hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a record and if some condition is matched tat particular record must be deletd fom the ps