1/93
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
COBOL
Developed in 1959 by the CODASYL committee
Still widely used in business, insurance, and government systems
Remains the backbone of mainframe computing and essential for the global economy
It is simple, portable, and maintainable but is wordy, has rigid format and not for scientific use
1960
COBOL’s first compilers got released
1968
It is when the first standard version of cobol was released
1974
The second version was released and was made for efficiency
1985
Cobol got enhanced had more versatility and structure
2002
Object-oriented features got added to cobol
2014
Method overloading got introduced to cobol
Machine Dependent, Easy to understand, Easy to maintain, Uniquely organized in 4 divisions, can handle voluminous data using few statements
Features of cobol language
Uses english like syntax, Unusual lenght, Column sensitive, spacing sensitive, uses indentation
Features of cobol program
Abend
An unexpected or abnormal termination of the program due to some problem in code or data
Syntax
It is a system-defined standard that should be followed while coding the cobol statements like MOVE, IF, PERFORM, etc.
Character String
It is a set of characters used to name something
Statement
It is a synthetically valid combination of words and characters written in the procedure division of cobol program and beginning with a verb.
Individual instructions or commands in COBOL, like MOVE, ADD, DISPLAY, etc.
Sentence
It refers to the group of statements ending in a period
Paragraph
It is a set of statements that are coded together separately from procedure division to perform a task
Section
It is a set of paragraph that are coded together separately from the procedure division
Division
Major parts used to code the cobol program
Consists of one or more paragraph or section
Identification, Environment, Data, Procedure
Four major divisions in a cobol program
Separator
These are characters that are used to separate strings
Delimiter
It is used to specify the start or the end of the strings
Condition
It is the expression that results in True or False
Based on the return value, the program flow gets decided
Variable
It is a data name used to hold the value for processing in the program
It holds a pointer to the memory location where the value is actually stored
These are defined and declared in the data division
These must be prepared so they can be recognized in the procedure division
Constant
It is a variable that has only one value throughout the execution of the program
Figurative Constants
These are system-defined keywords with predefined values
Literal
It is the value that is assigned to the variable
Scope terminator
It is a cobol reserved word that specifies the end of the specific cobol statements
Arithmetic Expressions
It is the coding form of arithmetic calculations and it is a combination of two or more variables with arithmetic operators
Physical file
It is the actual file that contains the data in the form of records
Logical file
It is a named used in the program that refers the actual physical file
Array
It is a set of similar elements arranged in sequential order and can access with the position
It is called a table in COBOL
Binary Search
It is an algorithm used on sorted arrays to search the element quickly
Uses the technique of repeatedly dividing the entire array into two parts until it finds the element
Compiler
It is a utility that converts source code into object code
Load modules
It is an executable component of the program that is generated by the compiler
Character
Lowest form in the paragraph structure
Word
It is made up of one or more characters
Clause
Consists of characters and words, and is used to specify an attribute of an entry
Identification Division
The first division of the COBOL program
Contains the identification of the program and its author or programmer
The function of this division is to supply information about the program to others who may use it as reference
Its purpose is to identify the program and its author and to provide other general information about the program, such as the dates the program is written, any program security, etc.
Environment Division
It describes the computing environment of the program
This division describes the types of hardware in which the program is written and executed
It supplies information about the computer equipment used in the program
Contains the Configuration section and the Input and output section
Configuration Section
It supplies the information about the computer on which the cobol program will be compiled and executed
Provides documentation information which includes the computer manufacturer, computer number, and computer number model
This defines the source and the object computer
Source Computer
The computer that will be used for compiling the program
Object computer
The computer that will be used for executing or running the program
Special Names
A third paragraph that is optional in the configuration section
This focuses on special used for reading or displaying data
Input and output section
Defines the files to be used in the program
starts with the FILE-CONTROL paragraph, which uses SELECT statements
Includes input file, where the source data is stored for processing, and the output file, where the report or result file is stored.
Data division
This contains the file section which declares the logical input and output file to be used in the program and the working storage section which declares all the variables to be used in the program
File section
declares the logical input and output files to be used in the program
Working storage section
This is where all the variables to be used in the program are declared.
Procedure Division
This division contains used defined section, paragraphs, clauses, and statements
This is where the problem logic is developed
Cobol Coding Sheet
It specifies from where each statement coding should start and how it differentiates from other statements
Sequence Number Area
Columns 1-6
Cobol compiler does not consider these columns part of the code
Is divided in 2 parts: Page number (column 1-3), which represents the current page number and line number (4-6), which represents the current line number on the page.
Indicator Area
It is the column 7 in the coding sheet split
Continuation Line
uses “-” symbol
Used to continue any sentence, entry, clause or phrase in Area B of the next line that is neither a comment or a blank line
Comment Line
Uses “*“ symbol
It can be written anywhere in area A and B of that line and can consists of any combination of characters from the character set of the computer
Forward slash
Uses “/“ symbol
Used to go to the top of the next page when printing a report
Area A
Columns 8-11
Contains division headers, section headers, paragraph headers or paragraph names, level indicators, declarative and end declaratives, and end program, end class, and end method markers.
Area B
Columns 12-72
Contains the entries, sentences, statements, and clauses
Also contains the continuation lines
System Generated Number
Columns 73-80
Gets excluded by the cobol compiler during compilation time
User-defined words and reserved words
2 types of words
User-defined words
Any word that is defined by the developer and it is used to store the data
It can have a maximum length of 30 bytes
Reserved words
It is a system-defined word with proper meaning or task assigned in COBOL language
It can be keywords, optional words, figurative constants, special character words and special registers
Non-numeric and numeric
2 types of Literals
Non-numeric Literal
Are strings enclosed by quotation marks or apostrophes
It can contain all valid characters that are allowed by COBOL
Numeric Literals
It is a number that is a combination of a sign and a decimal point
Coded directly without quotation marks and apostrophes
Numeric, Alphanumeric, Figurative
3 types of constants
Alphanumeric constants
Alphanumeric variables with only one value throughout the program execution
Numeric Constants
Numeric values that have one value throughout the program execution
Level Number
Is used to specify the level of data in a record
Can be group or elementary items
Elementary items
These items cannot be divided even further
Level number, data name, Picture clause, and value clause are used to describe this
Group Items
Consists of one or more elementary items
The level number of this item is always 01
Picture clause
Is used to describe the format and characteristics of a data item
It tells the compiler what type of data will be stored and how it will be displayed
Data type
Picture clause defines this whether it is numeric, alphabetic, or alphanumeric
Sign
Whether the values can be positive or negative
Decimal point position
Where the decimal is placed in numeric data
Length
Refers to how many characters or digits are allowed
PIC
Keyword for picture clause
X
May contain any character including special or unprintable characters
9
May contain only numeric characters from 0-9
A
May only contain alphabetic characters from A-Z, a-z, and space
S
Numeric sign
Does not use any actual storage, without this character, a numeric item would be treated as unsigned
V
Implied decimal Point
It separates the integer portion of a numeric item from its decimal portion
Used to keep track of the decimal point for arithmetic calculations
P
Numeric Placeholder
Used to change the precision and can also be used to represent positions after the decimal
-
Used to display a sign in a printed item
This character will be showed if the numeric value is negative
+
Used to display a sign in a printed item, it will be showed if the value is positive
.
Actual decimal point
Separates the integer portion of a numeric item from its decimal portion
This character cannot be used in an item involved in calculations
Z
Zero Suppress
Replaces leading zeros with blanks, has no effect on non-zero positions or zero in not leading positions
,
Commonly used as a separator in numeric data items
$
Inserts a dollar sign into the first position in the data item
Commonly used for currency but can also be used to suppress 0s
*
Replaces leading zeros with asterisks
Commonly used in check writing
CR
Credit
Used at the end of a PICTURE clause
This will appear in the position indicated if the item is negative
DB
Debit
This will appear in the position indicated if the item is positive
/
Commonly used as a separator in date fields
0
Inserts a zero into the data item in this position
Not commonly used
Value Clause
It is an optional clause which is used to initialize the data items
The values can be numeric, literal, alphanumeric literal, or figurative constant
Rounded clause
Provides automatic rounding
On Size Error clause
Is a conditional statement that implies “if there the size of a value does not fit in the field”, do whatever is indicated in the statement that follows the statement.
The following statement must be imperative