COBOL 2 Flashcards

(107 cards)

1
Q

In what year was COBOL established?

A

1959

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Who initiated the development of COBOL and which government department sponsored it?

A

Mary K. Hawes initiated it, and it was sponsored by the Department of Defense under Charles A. Phillips.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does CODASYL stand for and what was its role?

A

CODASYL was the consortium that developed COBOL to provide a portable, English-like standard for commercial data processing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which programmer’s philosophy heavily influenced COBOL’s design principle of separating data descriptions from procedural instructions?

A

Grace Hopper’s FLOW-MATIC philosophy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When was the landmark test proving COBOL’s machine independence conducted?

A

December 6 and 7, 1960.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Approximately how many lines of COBOL code are estimated to be in active use as of 2024-2025?

A

50 billion lines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What percentage of the planet’s financial transactions does COBOL process?

A

Approximately 90%.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the latest official COBOL standard as of the manuscript date?

A

COBOL 2023 (ISO/IEC 1989:2023)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Name three new features introduced in COBOL 2023.

A

synchronous messaging, bitwise shifting operators, and expanded identifier lengths up to 63 characters (any three of these or similar features mentioned).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which IBM mainframe series is COBOL most closely associated with?

A

IBM System/360 and its successors, including IBM Z architectures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What percentage of online banking systems does COBOL serve as the foundation for?

A

40%.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many lines of COBOL code does the Social Security Administration manage as of 2025?

A

Approximately 60 million lines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Name three characteristics of COBOL.

A

English-like syntax, self-documenting nature, rigid hierarchical structure, precision in data handling, portability (any three).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the four divisions that make up a COBOL program’s hierarchical structure?

A

Identification Division, Environment Division, Data Division, and Procedure Division.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Is COBOL a compiled or interpreted language?

A

Compiled language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In which section of the Data Division are variables used within the program declared?

A

Working-Storage Section.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What clause is mandatory for elementary items and defines the category, size, and format of data?

A

PICTURE (PIC) Clause.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the three main ways to define constants in COBOL?

A

VALUE Clause, Constant-Names (Level 78), and Figurative Constants.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does PIC X(20) represent?

A

An alphanumeric data item that can hold 20 characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does the ‘V’ symbol indicate in a PICTURE clause like PIC 9V9?

A

An implied decimal point.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the difference between USAGE DISPLAY and USAGE COMP-3?

A

DISPLAY stores data in text format, while COMP-3 stores data in packed-decimal format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What clause is used to create arrays/tables in COBOL?

A

OCCURS clause.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the three primary file organizations supported by COBOL?

A

Sequential, Indexed, and Relative.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Is COBOL case-sensitive?

A

No, COBOL is not case-sensitive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What symbol is used in column 7 of fixed-format COBOL to mark a comment line?
Asterisk (*).
26
What are the five main arithmetic operators in COBOL?
+ (addition), - (subtraction), * (multiplication), / (division), ** (exponentiation).
27
Which COBOL verb allows for algebraic syntax in calculations?
COMPUTE
28
What are the three logical operators in COBOL?
AND, OR, NOT.
29
What is the order of precedence for arithmetic operations in COBOL (from highest to lowest)?
Parentheses, Exponentiation, Multiplication/Division, Addition/Subtraction.
30
What keyword marks the end of an IF statement block?
END-IF.
31
What are the two string delimiters used in COBOL?
Double quotes (" ") and single quotes (' ').
32
What is the mandatory terminator for every COBOL sentence?
Period (.).
33
In fixed format, which columns (column range) are used for the Sequence Number Area?
1-6.
34
In fixed format, which columns are designated as Area A?
Columns 8-11.
35
In fixed format, which columns are designated as Area B?
Columns 12-72.
36
What symbol is used for inline comments in free-format COBOL?
*> (asterisk followed by greater-than sign).
37
What are the three categories of COBOL keywords?
Descriptive Keywords, Action Keywords, and Noise Words.
38
Give three examples of descriptive keywords in COBOL.
PIC, LEVEL, USAGE, REDEFINES, OCCURS (any three).
39
Give three examples of action keywords in COBOL.
MOVE, ADD, SUBTRACT, MULTIPLY, DIVIDE, PERFORM, IF, READ, WRITE (any three).
40
What is the purpose of noise words in COBOL?
To improve readability without affecting program execution.
41
What statement is used to copy data from one location to another?
MOVE
42
What statement is used to read data from an input file?
READ
43
What statement is used to write data to an output file?
WRITE
44
What statement is used to output data to the screen?
DISPLAY
45
What statement is used to accept user input?
ACCEPT
46
What is the COBOL equivalent of a switch-case structure?
EVALUATE
47
What statement executes a block of code repeatedly?
PERFORM
48
What statement is used for unconditional branching (though not recommended)?
GO TO.
49
What are the two types of subprograms in COBOL?
Internal subprograms and external subprograms.
50
How are internal subprograms invoked?
Using PERFORM statements.
51
How are external subprograms invoked?
Using CALL statements.
52
What are the two parameter passing methods in COBOL?
BY REFERENCE and BY CONTENT.
53
What is the difference between BY REFERENCE and BY CONTENT?
BY REFERENCE allows direct modification of variables, while BY CONTENT passes a copy of the value, preventing modification.
54
What statement must a subprogram end with to return control to the calling program?
EXIT PROGRAM.
55
Name three built-in COBOL functions.
FUNCTION TRIM, FUNCTION NUMVAL, FUNCTION RANDOM (any three mentioned).
56
What are the two key principles of program abstraction in COBOL?
Modular decomposition and information hiding.
57
What is the purpose of modular decomposition?
To break down a COBOL program into smaller, independent sections for easier understanding, debugging, and reuse.
58
What is the purpose of information hiding?
To restrict direct access to certain parts of the program to prevent unintended modifications.
59
What are the two types of expressions in COBOL?
Arithmetic expressions and Boolean expressions.
60
What operator is used for exponentiation in COBOL?
** (double asterisk).
61
Name three relational operators in COBOL.
= (equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to) (any three).
62
What is the purpose of the IF...ELSE statement?
To execute different blocks of code depending on whether a condition is TRUE or FALSE.
63
What is a test-before loop in COBOL?
A loop where the condition is checked before executing the loop body (PERFORM UNTIL).
64
What is a test-after loop in COBOL?
A loop that executes at least once before checking the condition (PERFORM WITH TEST AFTER UNTIL).
65
What type of loop is best suited for iterating through arrays with a counter?
Indexed iteration (PERFORM VARYING).
66
What statement terminates the entire COBOL program?
STOP RUN.
67
Does traditional COBOL support recursion?
No, but newer standards (COBOL 2002+) allow it with the RECURSIVE keyword.
68
What keyword is required to enable recursion in modern COBOL?
RECURSIVE.
69
Does traditional COBOL support parallel processing?
No, traditional COBOL does not support parallel execution.
70
Does traditional COBOL support coroutines?
No, COBOL does not support coroutines natively.
71
What are declarative sections in COBOL used for?
To handle specific conditions without explicit function calls (implicit calls).
72
In what year was COBOL-68 established as the first official ANSI standard?
1968
73
What major feature did COBOL-85 introduce to eliminate "spaghetti code"?
Structured programming features including scope terminators (like END-IF), the EVALUATE statement, and inline PERFORM loops.
74
What paradigm was introduced in COBOL 2002?
Object-Oriented COBOL, allowing for classes and encapsulated objects.
75
What cloud platforms can modern COBOL be deployed on?
Amazon Web Services (AWS), Microsoft Azure, and IBM Cloud.
76
What percentage of in-person credit card transactions does COBOL support?
80%.
77
What percentage of ATM transactions globally does COBOL handle?
95%.
78
What is the purpose of the USAGE clause?
To specify the internal storage format of data items (e.g., DISPLAY, BINARY, POINTER).
79
What special register returns the declared size in bytes of a data item?
LENGTH OF.
80
What are figurative constants?
System-reserved words that represent specific fixed values (e.g., ZERO, SPACE, HIGH-VALUE, LOW-VALUE, NULL).
81
How many levels of subscripting does COBOL support for tables?
Up to seven levels.
82
What level number is used to define named constants in COBOL?
Level 78.
83
In sequential files, how must records be accessed?
Serially, in the order they were originally written.
84
How are records accessed in relative files?
Directly by relative record number.
85
How are records located in indexed files?
Using one or more indexes that identify key values and their corresponding record locations.
86
What is the maximum default precision for numeric values in COBOL?
18 digits.
87
What symbol is used to separate words in COBOL identifiers?
Hyphen (-).
88
Can COBOL identifiers contain spaces?
No
89
What is the purpose of the STRING operator?
To concatenate or join multiple strings into a single value.
90
What is the purpose of the UNSTRING operator?
To split a single string into multiple substrings based on specific delimiters.
91
What operator is used to check if a value exists within a defined set or range?
IN
92
Where do division, section, and paragraph headers start in fixed format COBOL?
Area A (columns 8-11).
93
Where are COBOL statements and instructions written in fixed format?
Area B (columns 12-72).
94
What was the purpose of columns 73-80 in fixed format COBOL?
Identification Area, used for comments or punch card numbering (rarely used today).
95
When was free format introduced in COBOL?
COBOL 2002.
96
What is the advantage of free format over fixed format?
Free format allows code to be written without strict column placement, making it more flexible and easier to read.
97
What are the three types of declarative statements in COBOL?
Variable/constant declarations, file definitions, and procedural division declarations.
98
What are the three categories of executable statements?
Assignment statements, arithmetic statements, and input/output statements.
99
What statement resets a variable to default values?
INITIALIZE
100
What is the difference between PERFORM UNTIL and PERFORM WITH TEST AFTER UNTIL?
PERFORM UNTIL checks the condition before executing (test-before), while PERFORM WITH TEST AFTER UNTIL executes at least once before checking (test-after).
101
What does the VARYING clause do in a PERFORM statement?
It creates an indexed loop that runs a set number of times, incrementing a counter variable.
102
What statement is a placeholder that does nothing, used in IF blocks?
CONTINUE
103
What statement unloads a subprogram from memory?
CANCEL
104
In what section are local variables for a subprogram typically declared?
LINKAGE SECTION.
105
What is the purpose of the COPY statement?
To reuse predefined structures from external files while hiding implementation details.
106
Approximately how many reserved words does COBOL use?
Approximately 300.
107
What government agency announced a move from COBOL to Java in 2024?
The Internal Revenue Service (IRS).