Your COBOL program needs to maintain a counter that keeps track of the number of times a specific operation is performed. Which type of variable is suitable for this task?
- PIC 9(3) USAGE DISPLAY
- PIC 9(4)
- PIC 9(5) USAGE COMP-3
- PIC S9(6) USAGE COMP
For maintaining a counter in COBOL, PIC S9(6) USAGE COMP is appropriate. It is a signed numeric type that efficiently stores and increments numeric values.
Loading...
Related Quiz
- How is data storage allocated for a COBOL array defined using the OCCURS clause?
- You are designing a COBOL program to handle employee records, which include both personal and job-related data. How would you structure the data to represent these two categories effectively?
- When implementing a MERGE operation in COBOL, it's crucial to consider the _____ of the input files.
- Explain the difference between a primary key and an alternate key in indexed file processing.
- When using the OCCURS clause, the DEPENDING ON phrase specifies the number of times the data item ____________.