When designing a modular COBOL application, you want to define a variable that will have scope across different programs but not be accessible from external applications. What approach would you choose?

  • Declare the variable in the DATA DIVISION
  • Use of copybooks
  • Use of global variables
  • Use of static variables
In COBOL, you can define a variable with scope across different programs by placing it in a copybook. Copybooks are reusable modules containing data definitions and are included in programs where the data is needed, ensuring data consistency and modularity while restricting access to external applications.
Add your answer
Loading...

Leave a comment

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