Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can anybody give me example of subscript and index

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


Please Help Members By Posting Answers For Below Questions

How to remove 2 duplicate records and copy only one using job control language?

1217


What are the pertinent COBOL commands?

3174


What is the difference between binary search and sequential search?

1089


What is the difference between PIC 9.99 and 9v99 in COBOL?

1331


What is the difference between next sentence and continue in cobol programing language?

1220


what are decleratives in cobol?

2258


how do you reference the fixed unblock file formats from cobol programs

1234


Write the code to count the sum of n natural numbers.

1206


Which Search verb is equivalent to PERFORM…VARYING?

1040


How do u write test cases?

2064


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.

1566


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

1160


What is the difference between a binary search and a sequential search what are the pertinent cobol?

1138


how to access the file from prodution from changeman tool and to submit a file to production

7546


In COBOL programming, what is PERFORM? What is VARYING?

1148