Answer Posted / billyboyo
In IBM Cobol there are two methods of accessing elements in
a table (array). By subscript, which you explicitly define
in the Data Division or by index, which is implicitly
defined by the compiler.
01 subscript-for-table COMP PIC S9(4).
If you want the 20th item, set the above to 20 and use
field-looked-for (subscript-for-table).
An index is the displacement of an item from the start of a
table. For a subscript, the displacement, which is needed
to find the item, is calculated at run time (from the
subscript and the length of the data item(s)). So an index
is faster, but is generally considered more complex to use.
Some features, like SEARCH ALL, require the use of an INDEX.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What are the access modes of START statement?
how do you reference the printer file formats from cobol programs
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
How do you get the data to code the BMS macro?
Can we redefine the field of x(200) to less than 200?
How do get the result of your program directly on your pc?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
Write a program to explain size error.
What is amode(24)?
How do define dynamic array in cobol.