where can we use index and subscript ? with example ?
Answers were Sorted based on User's Feedback
Answer / tej
In addition to the above,
subscript is like a working storage variable
abc pic 999.
Using index the search for the data is faster since it gives
the object location(displacement) directly.
Subscript can be modified by ADD,SUBTRACT etc
Index modification is UP BY,DOWN BY
and yeah this q should have been in cobol section ;)
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / lu
Subscript refers to the array occurrence while index is the
displacement (in no of
bytes) from the beginning of the array. An index can only
be modified using PERFORM, SEARCH & SET.
Need to have index for a table in order to use SEARCH,
SEARCH ALL.
This is cobol, not DB2....
| Is This Answer Correct ? | 4 Yes | 2 No |
What do you need to do before you do EXPLAIN?
Q3. How will you fetch duplicate values from a DB2 table?
what is datacom db?
What is explain in db2?
A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cobol-db2 program. How should I declare my local input file variable or any suggestion?
If a table has a column "dept" (declared to have nulls) and there are 10 rows in the table of which 3 have a null value in the dept column, what will select count(*) and select count(distinct dept) return?
What is a db2 schema?
What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?
What is the purpose of the SDSNLOAD dataset in the STEPLIB while running DB2 programs?
What is sqlca’s maximum length?
What are db2 error codes -305 and -407. What is the difference between these 2 error codes ?
What is ibm db2 connect?