How do you declare a global variable in COBOL?
- By declaring the variable in the FILE SECTION
- By placing the variable in the WORKING-STORAGE section
- By using the GLOBAL keyword in the VARIABLE clause
- COBOL does not support global variables
In COBOL, global variables are declared in the WORKING-STORAGE section. This makes the variable accessible to all procedures within the program, ensuring a global scope.
Loading...
Related Quiz
- You are developing a COBOL program to process a file with variable-length records that represent customer orders. Each record has a different length based on the number of items ordered. What clause should you use to efficiently read and process these records?
- In a COBOL application, you are required to validate user input for a date field. Which intrinsic function can help you ensure that the entered date is valid?
- In COBOL, what is the purpose of the 88-level condition names in the Data Division?
- Which COBOL data type is commonly used to store date and time values?
- In COBOL, what are the common strategies for recovering from a file error or exception?