Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 6: Procedure Division


COBOL Verbs

  • The COBOL verb, that appears at the beginning of a statement indicating the specific action that the statement will perform
  • There are several COBOL verbs available to denote different types of actions to be taken during the program execution
  • Below listed are some commonly used verbs:
  • MOVE verb: It is data movement verb. It is used to copy data from the one source data item (variable/identifier) or literal to the one or more destination data items. For more details about MOVE verb, click here < LINK >
  • Arithmatic Verbs:-
    • ADD verb: The ADD verb is used to calculate the sum of two or more numbers and store the calculated sum. For more details about ADD verb, click here < LINK >
    • SUBTRACT verb: The SUBTRACT verb is used to subtract one or the addition of two or more numeric values from one or more numeric values and store the subtracted value. For more details about SUBTRACT verb, click here < LINK >
    • MULTIPLY verb: MULTIPLY verb is used to multiply two or more numeric values and store the final result. For more details about MULTIPLY verb, click here < LINK >
    • DIVIDE verb: DIVIDE verb is used to divide one numeric value by another numeric value and store the calculated value. For more details about DIVIDE verb, click here < LINK >
  • COMPUTE verb: In COBOL, Arithmetic expressions can be written using COMPUTE statement. Operations performed using ADD, SUBTRACT, MULTIPLY and DIVIDE can also be performed using COMPUTE statement. For more details about COMPUTE verb, click here < LINK >
  • DISPLAY verb: DISPLAY statement is used to display messages and data values on the screen. For more details about DISPLAY verb, click here < LINK >
  • ACCEPT verb: ACCEPT verb is used to fetch input data from user’s terminal or system-date related information and move it into the specified identifier. For more details about ACCEPT verb, click here < LINK >
  • "CONDITIONAL verb : IF" Verb IF can be used to compare two values and if result is true, statement following condition will be executed. For more details about IF verb, click here < LINK >
  • INITIALIZE verb: As name suggests, it is used to initialize an elementary item or a group item. It functions similar to VALUE clause. The difference is that VALUE can be used to initialize data item in WORKING-STORAGE SECTION and thus initialization in this case takes place only at the beginning of the program execution. Whereas, INITIALIZE can be used to initialize data item as and when necessary in PROCEDURE DIVISION. For more details about INITIALIZE verb, click here < LINK >






© copyright mainframebug.com
Privacy Policy