In COBOL, what happens when you declare a variable in the DATA DIVISION but outside of any specific procedure?

  • The variable becomes global and can be accessed by all procedures within the program
  • The variable is accessible only within the procedure where it is declared
  • The variable is deallocated after each procedure call
  • The variable is initialized automatically
When a variable is declared in the DATA DIVISION outside of any specific procedure, it becomes global in scope. This means it can be accessed by all procedures within the program, making it available throughout the program's execution.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *