COBOL Flashcards

(98 cards)

1
Q

COBOL stands for:

A

Common Business-Oriented Language

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

When was COBOL deveoped:

A

1959

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

Who created COBOL:

A

Grace Hopper

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

Known as the first hacker in history

A

Grace Hopper

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

Created the first compiler in history

A

Grace Hopper

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

The main objective of COBOL was to create a ______________ that could efficiently process business data, such as payroll, inventory, and financial transactions.

A

machine-independent language

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

COBOL’s first official version was released in

A

1960

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

COBOL is mainly used for:

A

Business applications

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

Influenced the creation of COBOL

A

FLOW-MATIC

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

The first standardized version, introduced in 1968

A

COBOL-68

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

This version added structured programming elements

A

COBOL-74

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

This version introduced scope terminators and other enhancements for maintainability.

A

COBOL-85

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

This version integrated object-oriented programming (OOP) features.

A

COBOL 2002

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

COBOL is primarily used in:

A
  1. Banking and Finance
  2. Government Systems
  3. Healthcare and Insurance
  4. Retail and Manufacturing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

COBOL is classified as a _______________

A

high-level, business-oriented programming language

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

COBOL is a _________, meaning it requires a compiler to convert source code into
machine code.

A

compiled language

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

True or False. COBOL supports both implicit and explicit variable declarations

A

False

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

Variables and constants are explicitly defined using:

A

DATA DIVISION

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

Assign value 12345 to Employee-ID

A

01 Employee-ID PIC 9(5) VALUE 12345.

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

Assign John Doe to Employee-Name

A

01 Employee-Name PIC X(20) VALUE ‘John Doe’.

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

What PIC clause is used in COBOL to store integer (whole number) values?

A

PIC 9 – Numeric

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

Which PIC clause is used to store text or a combination of letters, numbers, and symbols in COBOL?

A

PIC X – Alphanumeric.

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

What data type does PIC A represent in COBOL?

A

Alphabetic – It stores only letters (A–Z, a–z).

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

Which PIC clause is used for decimal numbers or floating-point values in COBOL?

A

PIC 9V9 – The V represents an implied decimal point.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
COBOL allows setting a range within _______ clauses
PICTURE
26
True or False. COBOL have built-in enumerations
False
27
Make an array with 10 employee records. Each record contains: - An employee ID (5 digits). - An employee name (up to 20 characters).
IDENTIFICATION DIVISION. PROGRAM-ID. EmployeeRecordExample. DATA DIVISION. WORKING-STORAGE SECTION. 01 Employee-Table. 05 Employee-Record OCCURS 10 TIMES. 10 Employee-ID PIC 9(5). 10 Employee-Name PIC X(20).
28
Make a record:
IDENTIFICATION DIVISION. PROGRAM-ID. EmployeeRecordExample. DATA DIVISION. WORKING-STORAGE SECTION. 01 Employee-Record. 05 Employee-ID PIC 9(5). 05 Employee-Name PIC X(20). 05 Employee-Salary PIC 9(7)V99.
29
True or False. COBOL is case-sensitive.
False
30
True or False. COBOL code is typically written in uppercase
True
31
COBOL allows numeric values up to __ digits by default
18
32
Used for formatting printed output.
Line Feed (LF), Carriage Return (CR)
33
Concatenates (joins) multiple strings into a single value.
STRING
34
Splits a string into multiple substrings based on delimiters.
UNSTRING
35
Checks if a value exists within a defined set or range.
IN
36
This has the highest precedence among logical operators.
NOT
37
True or False. AND is evaluated before OR when both appear in an expression.
True
38
Marks the end of an IF block.
END-IF
39
Marks the end of a PERFORM loop.
END-PERFORM
40
Indicates the end of a READ operation.
END-READ
41
Marks the end of a WRITE statement.
END-WRITE
42
Closes an EVALUATE (case-like) statement.
END-EVALUATE
43
Used when integrating SQL statements in COBOL
END-EXEC
44
Print Hello World!
DISPLAY "Hello, World!".
45
Indicates the beginning of a new section.
SECTION.
46
Denotes the start of a paragraph.
PARAGRAPH.
47
Marks a single-line comment.
* (Asterisk in column 7)
48
Advances output to a new page when printed.
/ (Slash in column 7)
49
What does level number 01 represent in COBOL?
It defines a top-level data item (group or record).
50
Which COBOL level numbers are used for grouping or nested fields?
Levels 02 to 49.
51
What is the purpose of level 66 in COBOL?
It is used for the RENAMES clause to create alternative names for existing fields or groups.
52
Which level number is used for standalone variables that are not part of any group?
Level 77.
53
What does level 88 define in COBOL?
Condition names for Boolean-style logic (used to give readable names to specific values).
54
Ask for user name and ouput it:
IDENTIFICATION DIVISION. PROGRAM-ID. AskUserName. DATA DIVISION. WORKING-STORAGE SECTION. 01 User-Name PIC X(30). PROCEDURE DIVISION. DISPLAY "Enter your name: " ACCEPT User-Name. DISPLAY "Hello, " User-Name. STOP RUN.
55
True or False. COBOL supports two main text formatting styles: fixed format and free format.
True
56
What is the purpose of columns 1–6 in a COBOL program?
Optional; used for sequence numbers or line numbering.
57
What is the purpose of column 7 in COBOL?
It is the indicator area – * for comments, - for continuation lines.
58
Which columns make up Area A in COBOL?
Columns 8–11.
59
What is written in Area A of COBOL code?
Division headers, section headers, paragraph names
60
Which columns make up Area B in COBOL?
Columns 12–72.
61
What is the purpose of Area B in COBOL?
Used for statements and instructions.
62
What is the purpose of columns 73–80 in COBOL?
Identification area – traditionally used for comments or punch card numbers (rarely used today).
63
Keywords like IDENTIFICATION DIVISION and DATA DIVISION start in _____________
Area A (columns 8-11).
64
Statements like DISPLAY and STOP RUN are in ___________
Area B (columns 12-72).
65
Defines the picture clause for data representation.
PIC
66
Indicates the hierarchical level of a data item.
LEVEL
67
Defines storage format and usage (e.g., DISPLAY, COMP).
USAGE
68
Allows a data item to share storage with another item.
REDEFINES
69
Defines repeating data items (arrays).
OCCURS
70
Declares variables, constants, and file structures.
DATA DIVISION
71
Defines files and their record structures.
FILE SECTION
72
Declares variables used within the program.
WORKING-STORAGE SECTION
73
Contains executable instructions.
PROCEDURE DIVISION
74
Copies data to a variable.
MOVE
75
Resets a variable to default values.
INITIALIZE
76
Reads data from a file.
READ
77
Writes data to a file.
WRITE
78
Outputs data to the screen.
DISPLAY
79
Accepts user input.
ACCEPT
80
Ask for employee name and write data to a file:
DISPLAY "Enter Employee Name:'. ACCEPT EMPLOYEE-NAME. WRITE EMPLOYEE-RECORD.
81
Acts like a switch-case structure.
EVALUATE
82
Loops until a condition is met
PERFORM UNTIL
83
Works like a FOR loop.
PERFORM VARYING
84
Make a loop and display name 5 times
WORKING-STORAGE SECTION. 01 COUNTER PIC 9 VALUE 1. PROCEDURE DIVISION. PERFORM UNTIL COUNTER > 5 DISPLAY "JOHN DOE" ADD 1 TO COUNTER END-PERFORM. STOP RUN.
85
Internal subprograms are defined within the same program and are typically used for modularity. They are invoked using ______statements.
PERFORM
86
External subprograms are stored in separate files and can be called by multiple programs. They allow code reuse across different applications. They are invoked using ______.
CALL
87
Allows direct modification of variables
BY REFERENCE
88
Passes a copy of the value, preventing modification.
BY CONTENT
89
Global variables are declared in:
WORKING-STORAGE SECTION
90
Local variables are declared in:
LINKAGE SECTION ag naa sa manuscript but the correct answer is LOCAL-STORAGE SECTION
91
Removes spaces from strings.
FUNCTION TRIM
92
Converts a string to a number.
FUNCTION NUMVAL
93
Generates random numbers
FUNCTION RANDOM
94
COBOL achieves information hiding through:
Data Encapsulation, COPY Statements, and Scope Rules
95
Used for inline or modern-style comments. Can be placed anywhere after column 7, usually after code in Area B.
*>
96
COBOL primarily relies on ___ and _____for subprogram execution
CALL and PERFORM
97
True or False. COBOL was also the first language that allowed names to be truly connotative
True
98
COBOL source program are grouped into the following four divisions:
IDENTIFICATION DIVISION ENVIRONMENT DIVISION DATA DIVISION PROCEDURE DIVISION