Data Movement Statements Interview Questions
Initialize Statement -
What does the INITIALIZE verb do?
INITIALIZE sets all elementary variables under group variable with system-defined initial values based on their data types.
What are the defaults values of various data types when INITIALIZE statement is used?
Below are the default values according to the data types -
Data type | Default value |
---|---|
Numeric | ZEROES |
Alphabetic, Alpha-numeric | SPACES |
Does INITIALIZE initializes the FILLER also? If yes, how?
No. FILLER items are not initialized by the INITIALIZE statement.
Move Statement -
What is a move statement in COBOL?
MOVE statement is used to transfer data from the source data item to the target data item. The sending and receiving data items should be declared with compatible data type to avoid data transferring errors.
What are the different types of the MOVE statement?
MOVE statement divided into four types based on its usage -
- Simple MOVE
- Group MOVE
- MOVE Corresponding
- MOVE Reference Modification
What is simple MOVE?
It is used to move the value of the sending item(s) to the receiving item.
What is the group MOVE?
It is used to move data between two groups whose elementary items are in the same order.
What is corresponding MOVE?
It is used to move data between two groups whose elementary items are not in the same order. However, the elementary items in both groups should have the same names and data type.
What is reference Modification?
It is a special-purpose MOVE that moves a portion of data from the sending item to the receiving item.
What do you do to resolve SOC-7 error?
Find out the compile listing that displays in the abend information. Find the near by statement of the compile listing. Check the declarations of the variables used in MOVE statement and use the compatible data types to resolve the issue.
Frequently Asked Questions -
Mention the importance of INITIALIZE verb?
What is the significance of the INITIALIZE verb?
What is the purpose of the INITIALIZE verb in COBOL, and when would you use it?
Explain the preference of using move statements in programming?