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
What are the various section in data division and briefly explain them.
What are 77 levels used for?
what is amode(24), amode(31), rmode(24) and rmode(any)?
Write the code implementing the perform … varying.
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
what is s000 u4087 error? please give the all error codes in cobol,jcl.
Are you comfortable in cobol or jcl?
Which mode is used to operate the sequential file?
Why would you use find and get rather than to obtain?
what is the use of outrecord?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
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.
how do you reference the printer file formats from cobol programs
) How do u handle errors in BMS macro
Discuss about changing dataset name in proc.