FAQs(76 to 90)

76) What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default.

A) INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults.

77) What is SET TO TRUE all about, anyway?

A) In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL II's better specifications.)

78) What is LENGTH in COBOL II?

A) LENGTH acts like a special register to tell the length of a group or elementary item.

79) What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands?

A) In a binary search the table element key values must be in ascending or descending sequence. The table is 'halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential.

80) What is the point of the REPLACING option of a copy statement?

A) REPLACING allows for the same copy to be used more than once in the same code by changing the replace value.

81) What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program i.e. a

program which is not calling any other program.

A) The program will go in an infinite loop.

82) How can I tell if a module is being called DYNAMICALLY or STATICALLY?

A) The ONLY way is to look at the output of the linkage editor (IEWL)or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal (CALL

83) What is the difference between a DYNAMIC and STATIC call in COBOL.

A) To correct an earlier answer: All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. DYNAMICally called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A STATICally called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module.

84) How may divisions are there in JCL-COBOL?

A) SIX

85) What is the purpose of Identification Division?

A) Documentation.

86) What is the difference between PIC 9.99 and 9v99?

A) PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE- POSITION numeric field with implied or assumed decimal position.

87) what is Pic 9v99 Indicates?

A) PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point.

88) What guidelines should be followed to write a structured Cobol prg'm?

A)

1) use 'evaluate' stmt for constructing cases.

2) use scope terminators for nesting.

3) use in line perform stmt for writing 'do ' constructions.

4) use test before and test after in the perform stmt for writing do-while constructions.

89) Read the following code. 01 ws-n pic 9(2) value zero. a-para move 5 to ws-n. perform b-para ws-n times. b-para.

move 10 to ws-n. how many times will b-para be executed ?

A) 5 times only. it will not take the value 10 that is initialized in the loop.

90) What is the difference between SEARCH and SEARCH ALL? What is more efficient?

A) SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items.