Can anybody give me example of subscript and index
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / arya
number of occurences are called subscript.............
number of dispositional position are called index...........
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / krishna
Subscript means occuresses, it can declared in WS-section
index means displacement,need not be declared
| Is This Answer Correct ? | 1 Yes | 5 No |
Answer / pandu
Subscript is sequential reading Index is direct reading of
perticular position of record
| Is This Answer Correct ? | 0 Yes | 5 No |
Answer / mahii
index is no of occurance we can find data exactly
subscript is displacement mainli its is used in arrays to
load the data
| Is This Answer Correct ? | 1 Yes | 9 No |
I hv ten records in ps file and i hv say some 15 records in vsam file .i hv empno and age in ps file n empno,empname,dept n desig in vsam file. i hv 2 read the ps file n check wid matching empno in vsam file and then insert all fields from ps and vsam into db2 table....plz help in writin the procedure division
can we print comp 3 stmts how ?
Hi all, I have a following requirement to write the cobol program. I have to load the 129 variables from input sequential file which are in excel sheet to the cobol inernal table. and after loading into table i have to compare this data with the business file. here compare means controlling the data whether the format(numeric,alpha) is same in the business file and in the table??? i have the same data in input and business file. could anyone please give me any idea of the logic?// i have all the 129 different variables(129rows,1 column)is there .
What are different file OPEN modes available in COBOL?
What are the pertinent COBOL
what is the difference between PA & PF keys?
File status must be checked both while opening and reading the file or only while reading the file?
I have a sequential file. How do I access a record in this sequential file randomly in my program ?
WORKING-STORAGE SECTION. 01 VAR1 COMP-2 VALUE 0. PROCEDURE DIVISION. MOVE 10.2115 TO VAR1. DISPLAY 'VAR1 =' VAR1. GOBACK. 10.2115 is stored as .10211499999999996E 02 in OS VS Cobol 10.2115 is stored as .10211500000000000E 02 in ecobol. Any reason why?
how to access vsam files in cobol and how to differentiate that this is ESDS file
How to remove 2 duplicate records and copy only one using job control language?
i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS