![]() ![]() If it matches, fine else repeat the process with the left half or the right half depending on where the item lies. Compare the item to be searched with the item at the center. Must load the table in the specified order).Ī13) Search on a sorted array. If you want the search to be done on anĪrray sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. ![]() Q12) What should be the sorting order for SEARCH ALL? – GSĪ12) It can be either ASCENDING or DESCENDING. SEARCH ALL – is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL. Q11) What is the difference between SEARCH and SEARCH ALL? – GS Need to have index for a table in order to An index can only be modified using PERFORM, SEARCH & SET. Q10) What is the difference between index and subscript? – GSĪ10) Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of theĪrray. ![]() Q9) Can the OCCURS clause be at the 01 level? Q8) How do you define a table/array in COBOL?Ġ5 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX. However, if the item being tested is a signed item, then it may contain 0-9, + and –. IS NUMERIC returns TRUE if the item only consists of 0-9. Q7) What does the IS NUMERIC clause establish ?Ī7) IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves. FILLER, OCCURS DEPENDING ON items left untouched.Ī4) Elementary level item. Numeric, Numeric edited items set to ZERO. Q3) What does the INITIALIZE verb do? – GSĪ3) Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Q2) What are the different data types available in COBOL?Ī2) Alpha-numeric (X), alphabetic (A) and numeric (9). It declares the ‘number’ as an array to contain a maximum of 10 integer constants.Įach element is identified by using an "array index".Īccessing array elements is easy by using the array index.Q1) Name the divisions in a COBOL program ?.Ī1) IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION. It declares ‘marks’ to be an array containing 50 float elements. The syntax for declaring an array is as follows − datatype array_name A particular value in an array is identified with the help of its "index number". SolutionĪn array is a group of related data items which share’s a common name. Sort the given array in descending or ascending order based on the code that has been written. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |