COBOL вопросы и ответы для интервью
Вопрос 31. Explain the purpose of the USAGE clause in COBOL.
The USAGE clause in COBOL is used to specify the internal representation of data items. It defines how data is stored in memory, such as binary, packed-decimal, or display.
Example:
01 AMOUNT PIC 9(5) USAGE COMP-3.
Вопрос 32. What is the significance of the MOVE CORRESPONDING statement?
The MOVE CORRESPONDING statement in COBOL is used to move corresponding data items from one record to another. It simplifies the process of copying similar fields between records.
Example:
MOVE CORRESPONDING RECORD-1 TO RECORD-2.
Вопрос 33. Explain the concept of the REWRITE statement in COBOL.
The REWRITE statement in COBOL is used to modify the contents of a record in a file. It is typically used in conjunction with the READ statement to update existing records.
Example:
READ FILE-1 INTO DATA-RECORD.
REWRITE DATA-RECORD.
Вопрос 34. What is the purpose of the SEARCH statement in COBOL?
The SEARCH statement in COBOL is used to search a table for a specified value. It is commonly used with the WHEN clause to perform conditional actions based on the search result.
Example:
SEARCH ITEM-TABLE AT END DISPLAY 'Item not found'.
Вопрос 35. Explain the concept of the STRING statement in COBOL.
The STRING statement in COBOL is used for string concatenation. It allows the programmer to concatenate and manipulate character strings efficiently.
Example:
STRING 'Hello' ' ' 'World' DELIMITED BY SIZE INTO OUTPUT-STRING.
Самое полезное по оценкам пользователей:
- What is COBOL?
- Explain the Division structure in COBOL.
- What is the purpose of the LEVEL number in COBOL?