1/65
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
data name or variable
A user-defined name used to identify and store data in a COBOL program.
DATA DIVISION
Where are data names or variables declared?
30 characters
How long can a COBOL data name be?
one alphabetic character
What must a COBOL data name contain at least?
hyphen
What is the only special symbol allowed in a COBOL data name?
No
Are blanks allowed in COBOL data names?
IDENTIFICATION DIVISION
What is the first division of a COBOL program?
IDENTIFICATION DIVISION
To provide information about the program and identify it to users.
PROGRAM-ID
What is the only required paragraph in the IDENTIFICATION DIVISION?
AUTHOR, INSTALLATION, DATE-WRITTEN, DATE-COMPILED, SECURITY
Give examples of optional information in the IDENTIFICATION DIVISION.
ENVIRONMENT DIVISION
The computing environment where the COBOL program is written and run.
computing environment
The type of computer hardware/system on which the program is compiled and executed.
ENVIRONMENT DIVISION
The type of computer hardware/system on which the program is compiled and executed.
ENVIRONMENT DIVISION
Information about the computer equipment and data files used by the program.
CONFIGURATION SECTION
A section where it provides information about the computer on which the COBOL program is compiled and executed.
SOURCE-COMPUTER, OBJECT-COMPUTER, SPECIAL-NAMES
What are the three paragraphs of the CONFIGURATION SECTION?
SOURCE-COMPUTER
The computer used for compiling the program.
OBJECT-COMPUTER
The computer used for executing/running the program.
SPECIAL-NAMES
Special information used for reading or displaying data.
INPUT-OUTPUT SECTION
A section where it provides details about the input and output devices/files used by the program.
Terminals, printers, and disk drives
What devices can be described in the INPUT-OUTPUT SECTION?
FILE-CONTROL
What paragraph does the INPUT-OUTPUT SECTION start with?
SELECT
It defines a file and assigns it to a device.
input file
A file containing source data for processing.
output file
A file containing a report or result.
DATA DIVISION
Where are data names or variables defined and declared?
Data Name, Level Number, Picture Clause, Value Clause.
What four terms should be considered when describing data in COBOL?
Level Number
It specifies the level of data in a record.
Elementary items, Group items
What are the two types of data items based on their level?
elementary item
A data item that cannot be divided further.
group item
A data item consisting of one or more elementary items.
Level number, Data Name, PICTURE, and optionally VALUE
What clauses can describe an elementary item?
Level number, Data Name, and optionally the VALUE clause
What can be used to describe a group item?
Record description entry
What is level number 01 used for?
Group and elementary items
What are level numbers 02 to 49 used for?
RENAMES clause items
What is level number 66 used for?
Items that cannot be subdivided.
What is level number 77 used for?
Condition-name entries
What is level number 88 used for?
PICTURE CLAUSE
A clause to describe the format and characteristics of a data item.
PIC clause
The type of clause where it tells the compiler what type of data will be stored and how it will be displayed.
Data type, sign, decimal point position, and length
What four things does the PICTURE CLAUSE define?
any character
What does X represent in a PIC clause?
numeric character
What does 9 represent in a PIC clause?
alphabetic character
What does A represent in a PIC clause?
alphabetic with 10 characters
What does PIC A(10) mean?
numeric field with 5 digits
What does PIC 9(5) mean?
8 characters of any type.
What does PIC X(8) mean?
positive or negative numbers
What does the S indicate?
no
Does S, V and P use actual storage space?
implied decimal point
What does V represent?
numeric place holder
What does P represent?
P
What arithmetic positioning characters change the precision or represent assumed decimal positions in numeric values?
Zero Suppress
What does Z mean in COBOL numeric editing?
Z
It replaces leading zeros with blanks.
comma
It inserts a comma into the data item at that position.
Dollar sign
What does $ represent in numeric editing?
$
It inserts a dollar sign into the first position of the data item.
Asterisk (*)
It replaces leading zeros with asterisks.
Check writing
What is * commonly used for?
Credit
What does CR mean?
Debit
What does DB mean?
Placed at the end of a PICTURE clause, it displays CR or DB if the item is negative and remains blank if the item is positive.
What is the purpose of the CR (Credit) and DB (Debit) numeric editing character in a COBOL PICTURE clause?
inserts a slash into the specified position of the data item
How does the / (Slash) character function as a numeric editing character?
inserts a zero into the specified position of the data item
How does the 0 (Zero) character function as a numeric editing character?
VALUE clause
It is an optional clause used to initialize data items.
Numeric literals, alphanumeric literals, or figurative constants (SPACES)
What types of values can be specified in a VALUE clause?