Table of Contents
Sams Teach Yourself COBOL in 24 Hours Index
Return to Teach Yourself COBOL in 24 Hours, COBOL bibliography, COBOL, COBOL DevOps, Awesome COBOL, Awesome IBM Mainframe, IBM Mainframe development, IBM Mainframe bibliography, Fortran
Index
Symbols $ (currency symbol), 49, 51
( ) (parentheses), 132
- (asterisk), 49
+ (positive), 49
, (comma character), 49, 65
- (negative), 49
. (decimal point), 49
/ (slash), 49, 51
0 (zero character), 49, 51, 89
21 File Status error, 270, 272
24 File Status error, 284
39 File Status error, 284
43 File Status error, 272
48 File Status error, 270
88 level items (condition names), 136–140
A A-0 programming language, 11
abbreviating complex conditional statements, 133
Accept statement, 62–63, 96–98
attributes, 64
date, 108
Day clause, 368
Exit Program clause, 413
From Date clause, 368
Gregorian calendar, 97
Julian calendar, 97
screen descriptions, 69
Special-Names paragraph, 97
terminating, 70
values, 71–72
accessing
Dynamic, 234, 270
Indexed files, 232
Random, 234, 270
Relative files, 275–283
Sequential, 234, 270, 284
Accumulator statement, control break program, subtotals, 351
Add statement, 83–86, 93
compiler options to programs, 181
data items, 85
end-of-file, 219, 230
files, 270
group-level items, 85
Random access, 270
records, 220
Relative file, 280
Sequential access, 270
subtotals, 345
Add with Corresponding statement, 357
add-on tools, user interface, 61
Advancing statement, printers, 341
After clause, 330–331
After Initial clause, 100–103
After Zero clause, 336
alert sounds, screen items, 66
aligned numeric fields, 49
alphanumeric fields, 41
blank characters, 51
comparing, 127–128
edited, 51–52, 55, 92
Initialize statement, 99
justification, 46
literals, 47–48
moving, 90, 131
numeric fields, 94
Picture clause, 46
reference modification, 103, 109
slash (/), 51
truncating, 68
Value clause, 46
greater, 130
less than, 129–130
relative, 129
zeros, 98
Alternate Key, 232
beginning-of-file, 255
File Status values, 244
Random access, 257
Select statement, 234
Start statement, 255
American National Standards Institute (ANSI), 11, 62
And statement, 39, 132
Animate option (debugging utility), 183
Annuity Intrinsic Function, 395–396
ANSI (American National Standards Institute), 11, 62
Any clause, 153
Arccosine Intrinsic Function, 390–391
Arcsin Intrinsic Function, 390–391
Arctangent Intrinsic Function, 390–391
arguments (functions)
average values, 393
integers, 392
Intrinsic Functions, 371
multiple, 380
numeric literals, 391
square root, 392
standard deviation, 394
values, 393
arithmetic statements
add, 83–86
compute, 89–90
divide, 88–89
improvements, 449
multiply, 87–88
reference modification, 104
subtract, 86–87
arrays, see tables
Ascending sorts, 290
Assign clause
data values, 189
numeric fields, 42
Select statement, 212
asterisk (*) in numeric fields, 49
At End clause, 299
Full-Name field, 225
Read statement, 257
Sequential files, 251
audit editing fields, 317
Auto clause, 64, 67
B B (Blank fill), 49
Background Color clause, 64–67
batch processes, 62
Before clause, 330–331
Before Initial clause, 100–103
beginning-of-file, 255
Bell clause, 66–67
binary search
Search All statement, 198
Usage clause, 45
blank characters
alphanumeric fields, 51
numeric fields, 49
Blank Erase clause, 65
Blank Line clause, 65, 67, 349, 358
Blank Screen clause, 63, 65, 67
Blank When Zero clause, 67
Blink clause, 66–67
bold printing, 337
bonds, calculating, 397
boundary violations, 193, 204–205
breakpoint (debugging utility), 183
brightening screens, 66
bugs, see debugging
built-in validations, 449
business processing
client/server, 9
computing needs, 8
data, 8
By Content, 420–421
By Reference, 420–421
bytes, 45
C calculating
bonds, 397
Easter dates, 383–386
fields, 123
calendars
COBOL, 387
dates, 368–369
Gregorian, 382–383
Julian, 382–383
Call statement
By Content, 420–421
By Reference, 420–421
canceling, 426
COBOL sp2, 429
dynamic, 421–423, 426
Not On Exception clause, 422
On Exception clause, 422
programming languages, 426
static, 421–423, 426
subprograms, 417
Using clause, 417
called programs, see subprograms
Cancel statement
programs, 422
Call statement, 426
capturing
errors, 277, 294
function keys, 70
transaction data, 306–309
Carriage Return/Line Feed (CRLF), 210–211
case sensitivity, 24
central processing unit (CPU), 7
Char Intrinsic Function, 399
characters
converting, 103
counting, 100–101
replacing, 101–102
checking control break sequence, 356
CICS (Customer Information Control System), 62
clauses
After Initial, 100–101
And, 132, 199
Any, 153
Assign, 212
At End, 299
Auto, 64, 67
Background Color, 63, 65, 67
Before Initial, 100–101
Bell, 66–67
Blank Erase, 65
Blank Line, 65, 67
Blank Screen, 63, 65, 67
Blank When Zero, 67
Blink, 66–67
Count In, 119–120
Currency-Sign is, 25
Decimal-point is Comma, 25
decimal position, 43
Delimited By, 122
Delimited By Size, 112
Delimiter In, 120
Depending On, 203
Else, 131
Erase, 67
File Status, 212
Foreground Color, 63, 65, 67
Full, 64, 67
Giving, 287, 290
Highlight, 66–67
Indexed By, 195
Invalid Key, 244–245, 277
Justified, 67
Justified Right, 68, 70
Leading, 102
Line, 65–66
Lowlight, 66–67
Not, 133
numeric fields, 44–46
Occurs, 188
On Overflow, 120
Or, 132
Other, 148
Picture, 40–41, 46–47, 59, 67
Pointer, 117, 123
Redefines, 189–193, 195
Relative Key, 275
Renames, 40
Replacing, 99, 102
Required, 64–65, 67
Reverse-Video, 66
Secure, 64–65, 67
Sign, 67
Sign Separate, 43
Tallying In, 102, 119, 123
To, 69–70
Underline, 66–67
Until, 162
Upon, 28
Usage, 67
Using, 70, 287
Value, 42, 98
Varying, 197
When, 145, 199
Clear push button, 435–436
Clear Screen statement, 281
clearing
Full-Name field, 225
lines, 66
screens, 64, 265
target fields, 122
client/server processing, 9
Close statement
COBOL sp2 panels, 441
files, 313
Dynamic access, 265
Sequential access, 215
Status values, 215
COBOL (Common Business Oriented Language), 7
calendar, 387
Data division, 38
ease-of-use, 19
Environment division, 38
future versions, 449
Identification division, 38
industry standards, 11–12
intrinsic functions, 12
Procedure division, 38
recursion, 420
structured programming, 12
COBOL sp2, 428
Call statement, 429
Clear push button, 435–436
Close statement, 441
conversing, 439
designing, 429–436
drop-down boxes, 434–435
editing, 429, 437–449
error message, 441
evaluation version, 429
Exit push button, 435–436, 439
FD statement, 441
fields, 429, 431–433
generated program, 436–438
icons, 441
line numbers, 441–442
linking, 448
lowercase, 438
Open statement, 438, 441
panels, 429
Picture clause, 435
processing loops, 442
Read push button, 434–436, 441
saving, 436
Select statement, 441
text display, 430
titles, 429, 441
uppercase, 438
CODASYL committee, 11
coding
If statement, 142
Screen_Section program, 77–78
collating sequence, 25
color
screens, 64, 76
toggling, 66
comma character (,) in numeric fields, 49, 65
command-line arguments
data, 108
retrieving, 96
special names, 108
comment lines, 22, 105
Common Business Oriented Language, see COBOL
Communications Section (Data Division), 26
COMP data items, 210
Comp value (Usage clause), 45
comparing
alphanumeric fields, 127–130
Call statement, 421–423
data items, 126, 128
date, 319
Line Sequential, 210, 229
literals, 127–128
master files, 319
numeric fields, 127–129
Perform statement with Go To statement, 163
compatibility platforms, GUI, 428
compilers
16-bit version, 32
collating sequence, 25
compute statement, 90
computers, 24
debugging utilities, 181
diagnostic messages, 36–37
directives, 29
division headers, 37
Fujitsu, 71–72
Editing window, 33
error messages, 57
executing, 17–19
hardware requirements, 13
installation, 12–19
object modules, 34
options
adding, 181
configuration, 16, 18
linking, 181
TEST, 185
output devices, 28
Programming Staff, 30, 33–34, 415
recompiling, 37
reporting, 31
software requirements, 13
Special-Names paragraph, 71
statements, 62
syntax errors, 33, 38
text mode, 63
troubleshooting, 36–37
user interface, 62
validating, 15–19
VMS COBOL, 71
Windows 3.1, 14–15
complex conditional statements, 134–135, 139
abbreviating, 133
isolating, 132
compute statement, 89, 90, 93, 156
computers
bugs, 11
compilers, 24
condition names, 136
conditional statements
abbreviating, 133
And clause, 132
comparing data items, 126, 128
complex, 132–135, 139
Continue, 133
Else clause, 131
equal, 127
Evaluate statement, 141, 143
executing, 128
false, 137, 143–144
If, 126–131
isolating, 132
less than values, 129
literals, 131
multiple, 139
names, 137–138
nesting, 135
Not clause, 133
Or clause, 132
Perform statement, 160
resetting, 137
Set, 136–137
Size Error phrase, 126
terminating, 128
testing, 136, 139, 150
Then phrase, 129
true, 126, 128, 140, 143–144, 148–149
unequal, 128
values, 129
variable names, 137
Configuration Section
Fujitsu compilers, 16, 18
Object-Computer paragraph, 24
Source-Computer paragraph, 24
Special-Names paragraph, 25, 70, 72
statements, 72
Console reserved word, 28
Continue statement, 133
control break programs (reports)
blank lines, 349
checking order, 356
creating, 363
date format, 350
dealer totals, 345, 359
Declaratives statement, 353
end-of-file, 353
errors, 357, 364
grand totals, 345, 360
headings, 362
hierarchy, 345
Initialize statement, 351
Input Procedure, 348
layout, 344
line count, 360–362
master files, 347
Random access, 347
resetting values, 346, 357
save fields, 351, 357
Sort sequence, 345–346, 348, 353–354
String statement, 350
subtotals, 344
Accumulator statement, 351
Add statement, 345
total lines, 350
transaction date, 345–348, 358
usage, 364
walk through, 346–363
conversing COBOL sp2 panels, 439
converting
characters, 103
Gregorian to/from Julian, 382–383
Copy statement, file definitions (FD), 426
Copybooks statement, source code, 424–425
correcting errors, 76
corresponding fields, 86, 295
corrupting Perform statement, 167
Cosine Intrinsic Function, 390
Count In clause, 119
counting
characters, 100–101, 119
print lines, 332
records, 298
target fields, 119
CPU (central processing unit), 7
CR (credit balance), 49
creating
control break programs, 363
folders, 29–30
Indexed files, 290–292
input fields, 69–70
Perform logic, 159–163
processing loops, 30–31
records, 281
Relative file, 277
Sequential files, 210, 215–217, 235–238
user input, 239–244
variable-length tables, 203–204
see also writing
credit balance (CR), numeric fields, 49
CRLF (Carriage Return/Line Feed), 211
cross-platforming, 10
Crt Status data item, 71–72
currency symbol ($), 49, 51
Currency-Sign is clause, 25
current date/time, 12, 97, 369–371, 380
Cursor statement, 261
capturing, 70
length, 71
positioning, 64, 70, 76, 79
Customer Information Control System (CICS), 62
D data
entering in programs, 32–33
moving between fields, 90–93
passing, 27, 410
on-screen, 63
returning, 410
Data Division, 27, 32, 38
Occurs clause, 188
Redefines clause, 189–193
sections, 26
data items
88 levels, 136
accepting, 96
adding, 85
COMP, 210
condition names, 136
Crt Status, 72
decimal limit, 59
defining, 54, 59
elementary-level, 40–41, 53–54
Evaluate statement, 112, 141–143, 146, 154
Filler, 54
formatting, 117
group-level, 40, 53–54, 59, 188
If statements, 126, 128
incrementing, 197
index values, 200
initializing, 197
level numbers, 40–41
moving, 55
numeric, 59
Read statement, 351
Redefine clause, 189–193
reference modification, 103–104
sizing limitations, 190
storing, 85
subprograms, 416–417
tables, 187
testing, 154
validation, 310–313
Value clause, 52, 144–145, 172–173, 189
see also fields
data processing, 8
date
Accept statement, 108
comparing, 319
converting from seconds, 380
Current, 97
fields, 78
format, 98, 317
Gregorian, 97
Julian, 97
validations, 449
Date-Of-Integer Intrinsic Function, 371, 387
dates
COBOL calendar, 387
current days, 369
days, 371–373, 376, 413–414
Easter, 384–386
epact, 384
errors, 379
field values, 376
format, 350, 354
Gregorian calendar, 368, 382–383
headings, 352
history, 368
integers, 372, 377
Intrinsic Functions, 368, 387
Julian calendar, 368–369, 382–383
leap years, 369, 376, 378
months, 376
printing, 337–338
ranges, 377
Sort statement, 348, 350
subprograms, 418–420
two-digit, 368
validation, 376–382
Day clause, 368
Day-Of-Integer Intrinsic Function, 383
days
between dates, 371–375, 413–414
format, 317
values, 376
weekdays, 374–375
DB (debit balance), 49
dealer totals (reports), 345, 359
debit balance (DB), 49
debugging utility, 11
Animate option, 183
breakpoint, 183
compilers, 181
programs, 37
TEST compiler option, 185
troubleshooting, 185
Windows 3.1, 181–182
decimal limit, numeric fields, 41, 43, 59
decimal point (.) position
implied, 43
numeric fields, 49, 58
Decimal-point is Comma clause, 25
Declaratives statement, 248
errors, 245–246, 298
reports, 353
Sections headers, 245
transaction data, 323
default
output devices, 28
sequential files, 210
defining
condition names, 136
data items, 54, 59
fields, 40–41, 55
screens, 79
tables, 188
Delete statement
records, 274, 280
Sort Work File, 300
Delimited By clause, 112, 122
Delimiter In clause, 120
delimiters
Carriage Return, 210–211
Count In clause, 120
length, 122
Line Feed, 210–211
multiple, 119
spaces, 114, 118, 120
String statement, 116
Unstring statement, 118
Depending On statement, 203, 228, 395
Descending sorts, 290
designing
COBOL sp2 panels, 429–436
fields, 73
layout, 328
programs, 338–339
records, 329
reports, 328–330
Screen_Section program, 72
detail lines (reports), 331, 333–336
diagnostic messages, compilers, 36–37
dimming screens, 66
disabling Fujitsu compiler messages, 220
Display statement, 57, 62–63
attributes, 64
edited numeric fields, 67
field contents, 69
on-screen, 63, 69, 263, 265
Upon clause, 28
Usage clause, 45
Display-And-Accept statement, 281
Divide statement
case sensitivity, 24
Data, 26–27, 32, 38
Environment, 24–26, 32, 38
formats, 88–89
headers, 37
Identification, 23–24, 32, 38
Procedure, 27–28, 32, 38, 106
required, 23
sections, 24, 26
statements, 88–89
zero, 89
DLLs (dynamic link libraries), 423
dollar sign ($), 49, 51
drop-down boxes, COBOL sp2 panels, 434–435
Duplicate Key (Indexed files), 248
File Status values, 244
Select statement, 234
Sort Keys sequence, 299
Dynamic access, 270
Indexed files, 234, 258–266, 272, 274
Close statement, 265
error messages, 263
File Status values, 261
Open statement, 259, 262–263, 265
Random Read, 258
Read statement, 264
Relative file, 279
retrieving records, 250
Select statement, 258
Sequential Read, 259
Start statement, 259, 264–265
dynamic Call statement, 421–423, 426
dynamic link libraries (DLLs), 423
E Easter, 383–386
edit fields
alphanumeric, 51–52, 55, 92
audit, 317
date, 317
day, 317
displaying as spaces, 67
month, 317
numeric, 48–51, 91–92
zero suppression, 49–50
editing
COBOL sp2 panels, 437–449
fields, 55–58
Fujitsu compiler, 33
index values, 196
Line Sequential files, 210
primary Key, 272
screens, 76
subprograms, 412
elementary-level items, 40–41, 53–54
condition names, 136
reference modification, 104, 189
Else clause, 131
End-Compute explicit scope terminator, 89
End-Evaluate scope terminator, 144
End-If explicit scope terminator, 184
end-of-file condition
adding, 230
Output Procedure, 296
records, 219
report control breaks, 353
Rewrite statement, 228
Sequential files, 222
status, 251
transaction data, 323
End-Read explicit scope terminator, 257
End-Return explicit scope terminator, 298
End-Search explicit scope terminator, 197
End-Unstring explicit scope terminator, 118
entering data in programs, 32–33
Environment Division, 24–26, 32, 38
epact (dates), 384
equal conditions, 127
Erase clause, 66–67
errors
Alternate Key, 244
capturing, 277
COBOL sp2 panels, 441
compiler, 57
control break programs, 364
correcting, 76
date validation, 379
File Status, 270, 284
Indexed files, 263, 298
Input Procedure, 294
Primary Key, 244
Procedure Division, 245–246
Sequential files, 216
subtotals, 357
syntax, 31
transaction data, 309
Write statement, 244–245
Evaluate statement, 143, 154
conditions, 141, 143
data items, 143
executing, 154
false, 143–144
format, 143
group-level items, 146
If logic, 151
literals, 143
multiple, 147–148
nesting, 147, 154
numeric, 144–145
Other clause, 148
rearranging, 153
scope terminators, 144
selection objects/subjects, 143, 145, 147–148
sequence, 145
source code, 142, 150, 152–153
stacking, 146
testing, 150
true, 143–145, 148–149
values, 141–143, 154
When clause, 152–153
event-driven logic, 427
executing
conditional statements, 128
Evaluate statement, 154
Fujitsu compilers, 17–19
Input/Output Procedure, 296, 301
multiple, 132, 145
Perform statement, 160
programs, 35–36
selection objects, 148–149
statements, 175, 301
Exit Program statement
Accept clause, 413
COBOL sp2 panels, 435–436, 439
subprograms, 412
explicit scope terminators, 84
End-Compute, 89
End-Evaluate, 144
End-If, 184
End-Read, 257
End-Return, 298
End-Search, 197
End-Unstring, 118
exponents, 89
F Factorial Intrinsic Function, 391
false conditions
Evaluate statement, 143–144
setting to false, 137
FD (File Description) statement, 213
fields, 39
aligned, 49
alphanumeric, 41, 46, 99, 127–128
calculating, 123
characters, 51, 100–101
COBOL sp2 panels, 429, 431–433
comparing, 127–128
contents, 69
corresponding, 295
counting, 119
creating, 69–70
cursor, 79
data, 90–93
date, 78, 376
decimal positions, 41, 43, 58
defining, 40–41, 55
delimiters, 122
editing, 48–52, 55–58, 67, 91–92
filling, 64
formatting, 42
From, 79
initializing, 118
input/output, 79, 105
Inspect statement, 400
justification, 42, 46
length, 398–400
literals, 41, 47–48
moving, 90–91
multiple, 112, 122
name entries, 137–138
numeric, 40–41, 94
Output Procedure, 296
overflowing, 120
packing, 45
quotation marks, 47
receiving, 58
reference modification, 103, 109, 112
Relative-Key, 276
required, 65, 73, 78
resetting, 119
Screen Section program, 71, 73, 76
separating, 118–121
signed, 43–44, 87
slash (/), 51
Sort, 300
source, 118
storage, 44–45
stringing, 117
target, 112
To, 79
troubleshooting, 84
truncating, 90–91
unique, 99
Unstring statement, 138
update, 79
Using, 79
validation, 310, 312
Value clause, 42, 46, 98–99, 129–130
zeros, 49–50, 98
see also data items
File Description (FD) statement, 213
COBOL sp2 panels, 441
Copy statement, 426
File Section (Data Division), 26–27
File Status clause, 270, 284
Alternate Key, 244
capturing, 277
Close statement, 215
Duplicate Key, 244
Dynamic access, 261
Indexed files, 248
Open statement, 214
in Extend, 219
in Output, 216, 219
Random access, 244, 256
Read statement, 222, 259
reports, 335
Rewrite statement, 225
Select statement, 212
Sequential access, 221
Start statement, 254
transaction data, 317, 323
Write statement, 216–217, 219, 238
filenames
physical, 212
Sequential files, 216
symbolic, 212
files
adding, 270
closing, 313
Copy statement, 426
data items, 209
extensions, 77
fields, 209
Indexed files, 231, 292
Line Sequential, 210, 229
opening, 313
reading, 270
Record Sequential, 210
retrieving, 270
saving, 77
Sequential, 214–217, 225–228
sorting, 286–291
Write statement, 210, 219, 270–271, 340
Filler data item, 54, 64
financial functions, 395–396
flags, condition names, 136
Flexus web site, 429
FLOW-MATIC language, 11
folders, 29–30
fonts, 338
Foreground Color clause, 63–67
format
COBOL programs, 21
data items, 117
date, 98
Evaluate statement, 143
numeric fields, 42
free-form source code, 23
From Date clause, 368
From statement, 67, 79
Fujitsu compiler, 71–72
Editing window, 33
executing, 17–19
hardware requirements, 13
installation, 12–19
messages, 220
options, 16, 18
output devices, 28
Programming Staff, 30
software requirements, 13
Sort Work Files, 286
validating, 15–19
Windows 3.1, 14–15
Full clause, 64, 67
Full-Name field, 225
functions
arguments, 380
capturing keys, 70
Factorial, 391
financial
Annuity, 395–396
Present-Value, 396
integer
Integer-Of-Date, 371–372, 374, 387
Integer-Part, 392
Intrinsic
Current-Date, 12, 370–371, 380
Rem, 379, 392
logarithm, 391
miscellaneous
Mod, 392
Random, 403–404
When-Compiled, 403–404
Sqrt, 392
statistical
Max, 393
Mean, 393
Median, 394
Midrange, 393
Min, 393
Ord-Max, 393
Ord-Min, 393
Range, 394
Standard-Deviation, 394
Sum, 394
Variance, 394
string
Char, 399
Length, 398
Lower-Case, 400
Max, 399
Min, 399
Numval, 402
Numval-C, 402
Ord, 400
Ord-Max, 399
Ord-Min, 399
Random, 397
Reverse, 400
Upper-Case, 400
trigonometric
Arccosine, 390–391
Arcsin, 390–391
Arctangent, 390–391
Cosine, 390
Sin, 390–391
Tangent, 390–391
G generating COBOL sp2 panels, 436
Giving clause, 287, 290
GMT (Greenwich Mean Time), 380–382
Go To statement
infinite loops, 168
Paragraph title, 163–169
Perform statement, 163–164, 168, 184
processing loops, 163, 170
Section header, 163–169
unconditional branch, 163
government use of COBOL, 9
grand totals (control break programs), 345, 360
Graphical User Interface, see GUI
greater than values, 130
Greenwich Mean Time (GMT), 380–382
Gregorian calendar
converting from Julian, 382–383
dates, 97, 368
group-level items, 40, 53–54, 59
adding, 85
Evaluate statement, 146
Initialize statement, 99
moving, 92
paragraphs, 82, 169
records, 210
reference modification, 104, 109
stringing, 112
tables, 188
Value clause, 52
GUI (Graphical User Interface)
add-on tools, 61
COBOL sp2 panels, 428–429
event-driven logic, 427
platform compatibility, 428
third-party tools, 428
Visual Basic, 428
Visual C++, 428
see also user interface
H hardware requirements for Fujitsu compiler, 13
headings (reports)
control breaks, 362
dates, 352
reports, printing, 331, 333–337
times, 352
hierarchy in control break programs, 345
High-Value (literals), 48
Highlight clause, 66–67
history of
dates, 368
Hopper, Grace (Admiral), 11
A-0 language, 11
CODASYL committee, 11
computer bug, 11
FLOW-MATIC, 11
influence, 10
I I-O (Open in Input) mode
Dyanmic access, 270
Random access, 270
Sequential access, 214, 221, 270
updating, 221
IBM mainframes, 28, 62
icons in COBOL sp2 panels, 441
Identification Division, 223–224, 32, 38
If conditional statement, 139, 142, 154
abbreviating, 133
coding, 142
complex, 132–135
condition names, 137–138
data items, 126, 128
Else clause, 131
equal conditions, 127
literals, 131
nesting, 135, 139, 151
terminating, 128
Then phrase, 129
true conditions, 126, 128
values, 129
implied decimal position, 43, 58
increasing Sort statement speed, 295
incrementing
data items, 197
values, 172–173
Index values
contents, 195
editing, 196
element numbers, 195
referencing, 200
Search statement
starting, 196
tables, 200
Usage clause, 45
Indexed By clause, 195
Indexed files
Alternate Key, 232, 234, 244, 257
At End condition, 251
Close statement, 265
creating, 235–244, 290–292
Declaratives, 248
definitions, 232
deleting, 274
Duplicate Key, 234, 248
Dynamic access, 234, 258–266, 272, 274
efficiency, 320
error messages, 244, 263, 298
File Status values, 248, 256, 261
Input/Output, 235–238, 250
Invalid Key, 248
Key field, 231–233, 235
Move statement, 256
Open statement, 244, 259, 262–263, 283
Primary Key, 232–233, 244, 272
Random access, 234, 244, 256–257, 272, 274
Read statement, 237, 251, 257–258, 264, 273, 324–325, 450
records, 232–233, 250–253, 270–271
rewriting, 271–272
Select statement, 233–235, 256, 258
Sequential access, 234–239, 247, 250, 259
sorting, 292
Start statement, 254–256, 259, 264–265
storing, 234
structures, 232
updating, 233, 271–273, 283, 320–325
user input, 239–244
validating, 232
Write statement, 238, 244
industry standards
COBOL, 11–12
future improvements, 449–450
infinite loops, 168
Initialize statement, 108
alphanumeric fields, 99
data items, 197
group-level items, 99
Output Procedure fields, 296
Redefines clause, 191
Replacing clause, 100
reports, 98, 351
target fields, 113, 118
Varying statement, 184
inline Perform statement, 171, 174–177
Go To clause, 184
inline If statement, 178–180
left-justification routine, 180
nesting, 177, 184
Paragraph, 184
Input Procedure
control breaks, 348
data, 105
errors, 294
fields, 69–70, 79
Justified Right clause, 70
processing loop, 292
records, 292
screens, 261
size, 299
Sort statement, 293–296, 301
text file, 235–237
Input-Output Section (Environment Division), 24
Input-Output, see I-O mode Inspect statement
characters, 103, 108
clause, 100–102
counting, 100–101
fields, 400
leading character phrases, 103
replacing, 101–102
installation
COBOL sp2 evaluation version, 429
Fujitsu compilers, 12–19
validating, 15–19
Windows 3.1, 14–15
integer functions
Integer, 392
Integer-Part, 392
Mod, 392
date validation, 377
positive numbers, 392
interactive debugging utility, see debugging utliity
interactive processing, 62
interface, see GUI; user interface
Intrinsic Functions, 12, 369
arguments, 317
Current Date, 12, 370–371, 380
Date-Of-Integer, 371–372, 374, 387
Day-Of-Integer, 383
dates, 368, 387
Factorial, 391
financial, 395–396
Integer, 392
Integer-Part, 392
logarithm, 391
mathematical, 392
miscellaneous
Random, 403–404
When-Compiled, 403–404
Mod, 392
multiple, 380
numerical, 387
Present-Value, 396
Rem, 379
Sqrt, 392
statistical
Max, 393
Mean, 393
Median, 394
Midrange, 393
Min, 393
Ord-Max, 393
Ord-Min, 393
Range, 394
Standard-Deviation, 394
Sum, 394
Variance, 394
string
Char, 399
Length, 398
Lower-Case, 400
Max, 399
Min, 399
Numval, 402
Numval-C, 402
Ord, 400
Ord-Max, 399
Ord-Min, 399
Output-Field, 400
Random, 397
Reverse, 400
Upper-Case, 400
trigonometric
Arccosine, 390–391
Arcsin, 390–391
Arctangent, 390–391
Cosine, 390
Sin, 390–391
Tangent, 390–391
Invalid Key clause, 248, 277
errors, 244–245
Read statement, 257
Start statement, 254
Is Initial clause subprograms, 416
isolating complex conditional statements, 132
J Job Control Language (JCL), 212
Julian calendar, 97
converting from Gregorian, 382–383
dates, 368–369
Intrinsic Functions
Day-Of-Integer, 383
justification
alphanumeric fields, 46
left, 106
numeric fields, 42
Justified clause, 67
Justified Right clause, 68, 70
K Key fields, see Indexed files
Keyboard-Status field, 261
keys
master files, 314
transaction data, 314
L layouts
description, 210
records, 293
Leading clause, 102
counting, 101
level numbers, 41
numeric fields, 42
leap years, 369, 376–378
left-justification, 106, 180
Length Intrinsic Function, 122, 398
less than values, 129–130
level numbers
data items, 40–41
elementary, 41, 53–54
fields, 40
group, 52–54
leading digits, 41
Renames clause, 40
Line clause, 65–66
line count
control break, 360–362
printing, 332, 334, 336–337
Line Feed delimiter, 210
line numbers
COBOL sp2 panels, 441–442
programs, 22
Line Sequential files, 229
delimiters, 211
editing, 210
master files, 315–316
records, 230
updating, 225–228, 315–316
lines, clearing, 66
Linkage Section (Data Division), 26–27
called programs, 418
COBOL sp2
panels, 448
compiler options, 181
object modules, 34
programs, 35
listings
3.1 Demonstrate Group/Elementary Levels, 53–54
3.2 Demonstrate Edited Fields, 55–58
4.1 Screen_Section with Justified Right, 68
4.2 Screen_Section Demonstration, 74–76
7.1 String Example, 114–115
7.2 Unstring Example, 120
8.1 Intelligent Telephone Number Format, 134
8.2 Intelligent Name Separation, 137–138
10.1 Perform logic, 157–158
10.2 Processing Loop, 160–161
10.3 Go To with Perform, 164
10.4 Perform with Go To, 168
11.1 Count to 10, 172
11.2 Count to 10, Revised, 173
11.3 Inline Perform Example, 176–177
11.4 Inline Perform with Inline If, 178–180
12.1 Month/Date Name Display, 191–192
12.2 State Name Lookup, 193–195
12.4 Search Multidimensional Table, 201–203
13.1 File Creation Example, 217–218
13.2 Read statement, 223–224
13.3 Update Sequential files, 226–227
14.1 Dealer File Creation, 235–237
14.2 Dealer Data Entry, 239–243
15.1 Indexed File/Sequential Access, 251–253
15.3 Dynamic Access Example, 260
16.1 Relative file access, 275–282
17.1 Sort statement, 287
17.2 Creating Indexed File Using Sort, 290–292
17.3 Sort with Input Procedure, 293–296
17.4 Sort with Output Procedure, 297–299
18.2 Sequential File Update, 315
18.3 Indexed File Update, 321–323
21.1 Current-Date Intrinsic Function, 370–371
21.2 Integer-Of-Date, 372
21.3 Days Between Dates, 372–373
21.4 Days between Dates/Weekday, 374–375
21.5 Date Validation, 377
21.6 Convert Local Time to GMT, 381–382
21.7 Easter Date Calculation, 384–386
22.1 Annuity Function, 395–396
22.2 Center a Field, 398–399
22.3 Assemble Full Name, 401–402
22.4 Random Function, 404
23.1 Menu Program, 411
23.2 Called Phone Number Format, 412–413
23.3 Called Days Between Dates, 413–414
23.4 Date Entry, Calling Validation, 417
23.5 Date Validation Subprogram, 418–420
23.6 Date Validation Copybook, 424
23.7 Date Validation Copybook, 424–425
24.1 sp2 Generated Program, 437–438
24.3 Final Dealer Display, 442–448
literals
alphanumeric, 47–48
comparing, 127–128
Evaluate statement, 143
fields, 41
If conditional statements, 131
numeric, 47–48, 391
quotation marks, 47
screen, 79
values, 47–48
loading tables, 189–193, 195, 211
local time, 380
location of Sequential files, 211
logarithm functions391
lookups in tables, 193–195
Low-Value (literals), 47
Lower-Case Intrinsic Function, 400
Lowlight clause, 66–67
M machine language, 8
main programs, 410, 415
mainframes (IBM)
CICS, 62
output devices, 28
master files
comparing, 319
control breaks, 347
Indexed
efficiency, 320
Read statement, 324–325
updating, 320–325
keys, 314
Sequential files
Line Sequential, 315–316
updating, 313–320
transaction data, 314
Matchcase of Keyword check box, 32
mathematical functions, 89, 392
Max Intrinsic Function, 393, 399
Mean Intrinsic Function, 393
Median Intrinsic Function, 394
menu programs, 410–411
merging, see String statement
messages, Fujitsu compiler, disabling, 220
Midrange Intrinsic Function, 393
Min Intrinsic Function, 393, 399
miscellaneous functions, 403–404
Mod Intrinsic Function, 392
modifying Sort fields, 300
month
dates, 376
format, 317
Move statement, 55, 90–93
alphanumeric fields to numeric, 131
Indexed files, 256
data items, 55, 90–93
fields, 295
group-level items, 92
spaces, 98
zeros, 98
multidimensional tables, 200–203
Multiply statement, 87–89
N name entries
unstringing, 137–138
reports, 337
naming programs, 421
negative (-), 43, 49
nesting
Evaluate statements, 147, 154
If statements, 135, 139, 151
inline Perform statement, 177, 184
Next clause
Read statement, 258
File Status values, 259
nibbles (bytes), 45
Not clause, 133
Not On Exception clause, 422
numeric fields, 41
alphanumeric fields, 94
aligned, 49
arguments, 391
asterisk (*), 49
Blank fill (B), 49
comma character (,), 49
comparing, 127–128
credit balances (CR), 49
currency symbol ($), 49
debit balance (DB), 49
decimal point positions, 41, 43, 49, 58
defining, 41
edited, 48–51, 67, 91–92
literals, 47–48
moving, 91
negative (-), 49
packing, 45
Perform statement, 174
positive (+), 49
reference modification, 103, 109
Relative-Key, 276
right justification, 42
signed, 43–44
slash (/), 49
storage, 44–45
saving, 44
tables, 189
Usage clause, 44–46
values, 42, 129, 144–145, 172–173
zero suppression, 42, 49–50, 98
numeric Intrinsic Functions, 387, 402
Numval-C Intrinsic Function, 402
O object modules, 34
Object-Computer paragraph (Configuration section), 24
object-oriented programming, 450
Occurs clause, 188, 203, 228
On Exception clause, 422
On Overflow clause, 120
On Size Error phrase, 86
Open in Extend mode
File Status clause, 219
Indexed files, 244
Sequential files, 214
transaction data, 308
Open in Input, see I-O mode
Open in Output mode
errors, 216
File Status values, 215, 219
Indexed files, 235–238
Sequential, 214–215, 247
Open statement
COBOL sp2 panels, 438, 441
Dynamic access, 262–263
File Status values, 214, 313
Indexed files, 259, 265, 283
Record Sequential file, 284
Relative file, 284
reports, 334–335
Sequential files, 214, 283
Optional clause
Select statement, 229
options, Fujitsu compilers configuration, 16, 18
Or clause, 132, 139
Ord Intrinsic Function, 400
Ord-Max/Ord-Min Intrinsic Function, 393, 399
Other clause, 148
Output Procedure
clauses, 67
data, 105
default, 28
end-of-file detection, 296
executing, 296
fields, 79, 296
processing loop, 296, 298
records, 296
size, 299
reports, 296
Sort statement, 297–299, 301
see also target fields
Output-Field Intrinsic Function, 400
overflowing target fields, 113–114, 120
P Packed-Decimal value (Usage clause), 45
page breaks (reports)
line counters, 334
printing, 331–339
panels (COBOL sp2)
Clear push button, 435–436
Close statement, 441
conversing, 439
designing, 429–436
drop-down boxes, 434–435
editing, 429, 437–449
error messages, 441
Exit push button, 435–436, 439
FD statement, 441
fields, 429, 431–433
generating, 436
icons, 441
line numbers, 441–442
linking, 448
Open statement, 441
opening, 438
Picture clause, 435
processing loops, 442
push buttons, 434, 441
Read push button, 435–436
saving, 436
Select statement, 441
text display, 430
titles, 429, 441
window display, 429
Paragraph title, 27–28, 157–158
case sensitivity, 24
Go To statement, 163–169
grouping, 82, 169
Perform statement, 159, 167, 184
periods, 82
Procedure Division, 82, 93
Special-Names, 162
Thru clause, 158
passing data, 410
Perform
Perform logic, 157–158
Perform statement, 156
corrupting, 167
executing, 160
Go To statement, 164, 168
comparing, 163
inline, 171, 174–177
left-justification, 180
nesting, 184
Paragraph, 184
nesting, 177
numeric data items, 174
numeric literal items, 174
Paragraph title, 158, 167
multiple, 159
processing loops, 159–161, 169
creating, 159–163
Section headers, 157
Stop Run statement, 159
terminating, 169, 172
testing, 173
Thru clause, 158
Until clause, 162, 172
Varying clause, 172–173
With Test After clause, 173–174
phrases
After Initial, 103
Before Initial, 103
Size Error, 126
Then, 129
physical filenames, 212
Picture clause, 40, 59, 67
alphanumeric fields, 46
COBOL sp2
decimal position, 43
edited, 49–50
fields, 40–45
panels, 435
platforms, GUI, 428
Pointer clause
data, 117
positioning, 121
Unstring statement, 123
positioning
Auto clause, 64
cursor, 70, 76, 79
Pointer clause, 121
Relative file, 279
positive (+), 43, 49
Present-Value Intrinsic Function, 396
preserving on-screen data, 63
Primary Key, 231–233, 244, 272
printing
Advancing statement, 341
bold, 337
dates, 337–338
dealer totals, 359
detail records, 335–336
File Status values, 335
fonts, 338
grand totals, 360
headings, 331, 333–337
lines, 331, 333–334
multiple records, 338
name formatting, 337
opening, 334–335
Output Procedure, 296
page breaks, 332
requirements, 332–333
sorting records, 339
time, 337–338
transaction date, 358
underlining, 339
Write statement, 340
Proc-Open-File Paragraph sp2 program, 438
Procedure Division, 28, 32, 38, 81, 106
batch, 62
called programs, 418–420
Declaratives, 245–246
divide statement, 88–89
Input, 292–296
Paragraphs, 27–28, 82, 93, 157–158
Output, 296
Sections, 27–28, 82, 157–158
statements
add, 83–86, 93
compute, 89–90, 93
move, 90–93
multiple, 87–88
Start statement, 255
subtract, 86–87
Process-Files Paragraph, 318
processing
client/server, 9
interactive, 62
processing loop
Input Procedure, 292
Output Procedure, 296, 298
Relative file, 278
transaction data, 324
processing loops, 156
COBOL sp2 panels, 442
creating, 159–163
Go To statement, 163, 170
Perform statement, 160–161, 169
terminating, 445
Program-Id paragraph (Identification Division), 23, 38
programming languages
A-0, 11
business needs, 8
Call statement, 426
files, 77
FLOW-MATIC, 11
object-oriented, 450
sentences, 82
structured, 12, 20
tutorials, 127
Programming Staff (Fujitsu compiler), 30
programs
called, 410–415
Cancel statement, 422
collating sequence, 25
comment lines, 22, 105
compilers, 33–34, 181
directives, 29
division headers, 26–27, 36–37
control breaks, 362
creating, 30–31
data
entering, 32–33
passing, 27, 410
returning, 410
debugging, 37
designing, 338–339
Environment, 32
executing, 35–36
formats, 21
Fujitsu compilers, 16–19
line numbers, 22
linking, 34–35
menus, 410–411
naming, 421
object modules, 34
Procedure Division, 418–420
recompiling, 37
recursion, 420, 449
reinitializing, 421
removing, 421
reserved words, 28
saving, 33
source code, 23
statements, 32
terminating, 29, 107
walk through, 346–363
Project method, 415
projects, subprograms, 416
push buttons, COBOL sp2 panels, 434, 441
Q–R Quote value (literals), 47
radians, 391
Random access, 270
Alternate Key, 257
control breaks, 347
Dynamic access, 258
File Status values, 244, 256
Indexed files, 234, 244, 256–257, 272, 274, 320–325
Move statement, 256
Read statement, 257–258, 450
records, 270
Select statement, 256
update procedures, 313, 326
Random Intrinsic Function, 397, 403–404
Range Intrinsic Function, 394
ranges, dates, 377
Read statement, 221, 223–224
At End clause, 257
clearing, 225
COBOL sp2 panels, 435–436
Dynamic access, 264
File Status values, 259
Full-Name field, 237, 251
Indexed files, 250–253, 273, 450
Invalid Key clause, 257
master Indexed files, 324–325
Next clause, 258
Output Procedure, 296
records, 254–258, 270, 314
Relative file, 279
reports, 351
Random access, 257
Sequential files, 222
transaction data, 318
see also retrieving
rearranging selection objects, 153
rebuilding subprogram projects, 416
receiving fields, 58
recompiling programs, 37
Record Sequential
opening, 284
Line Sequential files, 210
trailing spaces, 211
records
accessing, 232, 283–284
adding, 220, 230, 270
counting, 298
creating, 281
deleting, 274, 280
description, 213
Dynamic Access, 250
end-of-file, 219, 230, 270, 280
first, 351
identifiers, 216, 329
Indexed files, 232, 250–253
Input/Output Procedure, 296, 299
last, 351
layout, 210, 293
opening, 283
Random access, 250
Read statement, 254–258, 270, 273, 314, 351
Relative file, 282
reports, 338
restricting, 292
retrieving, 220–221, 260, 270
Rewrite statement, 228, 271–272, 281
Sequential access, 210, 219, 250
size limitations, 228
Sort statement, 299, 339
storing, 219
terminating, 210
underlining, 341
updating, 271–273
variable-length, 228
writing in files, 270–271, 292
recursion, 420, 420, 449
Redefines clause, 195
boundary violations, 193
Initialize statement, 191
tables, 189–193
reducing source code, 142, 150, 152–153
reference modification, 103–104
arithmetic expressions, 104
elementary-level items, 104
fields, 103–104, 109
statements, 103
target fields, 112, 117
referencing
called programs, 418–420
elements, 189
index values, 200
Sequential files, 219
reinitializing programs, 421
rejecting transaction data, 314
Relative file, 129
accessing, 275–282, 284
creating, 277
Dynamic access, 279
field size, 275
opening, 284
positioning, 279
processing loop, 278
reading, 279
records, 283
adding, 280
creating, 281
deleting, 280
end-of-file, 282
Select statement, 275, 279
Sequential access, 275
storing, 275
Release statement, 292
Rem Intrinsic Function, 379, 392
removing programs, 421
Renames clause, 40
Replacing clause, 99
characters, 101–102
Initialize statement, 100
Report Section (Data Division), 26
reports
control break programs, 363–364
blank lines, 349
checking order, 356
layout, 344
dates, 337–338, 350–352
dealer totals, 359
Declaratives statement, 353
designing, 328–330, 338–339
detail records, 335–336
end-of-file, 353
File Status values, 335
first, 351
fonts, 338
formats, 354
grand totals, 360
headings, 335–337, 352, 362–363
hierarchy, 345
Initialize statement, 351
last, 351
layout, 328
master files, 347
maximum line count, 360–362
multiple records, 338
name formatting, 337
opening, 334–335
Output Procedure, 296
printing, 331–334
Random access, 347
requirements, 332–333
save fields, 339, 351
Sort statement, 339, 345–348, 353–354
String statement, 350
subtotals, 344–346, 357
syntax errors, 31
time, 337–338, 352
total lines, 350
transaction date, 358
underlining, 339
Write statement, 330–331
Required clause, 23, 64–65, 67, 78
reserved words, 28
resetting
numeric fields, 119
subtotal values, 346, 357
restricting records, 292
retrieving
command-line arguments, 96
Indexed files, 233
records, 220–221, 250, 260
Sequential access, 250, 270
see also Read statement
returning data, 410
Reverse Intrinsic Function, 400
Reverse-Video clause, 66
Rewrite statement, 281
File Status values, 225
records, 228
Sequential access, 225, 271–272
Rounded phrase, 86
rounding, 89
S save fields (reports)
Initialize statement, 351
subtotal values, 357
saving
COBOL sp2 panels, 33, 77, 436
reports to files, 314, 339
storage space, 44
scope terminators
End-Compute, 89
End-Evaluate, 144
End-If, 184
End-Read, 257
End-Return, 298
End-Search, 197
End-Unstring, 118
screens
background/foreground toggle, 66
brightening, 66
clearing, 64, 265
color, 64, 76
definition, 79, 105
Accept statement, 69–70
alert sounds, 66
blinking, 66
cursor, 70
erasing, 66
fields, 76, 79
literals, 63, 65–66, 79
underlining, 66
dimming, 66
displaying, 69, 263, 265
editor, 76
input, 261
user interface, 27, 65
Screen Section (Data Division), 26–27, 63, 70, 307
clauses, 65–66
coding, 77–79
cursor, 70
data
displaying, 63
preserving, 63
Justified Right clause, 68
screen literals, 65
designing, 72
example, 74–76
fields, 73, 78
literals, 63
multiple, 79
Special-Names, 71–72
statements
accept, 63
attributes, 64
display, 63
SD (Sort Description), 286
Search All statement, 205
And clause, 199
binary search, 198
When clause, 198–199
Search statement
End-Search explicit scope terminator, 197
Indexed By clause, 195–198
multidimensional, 200–203
speed, 205
tables, 205
Varying clause, 197
seconds, converting to conventional date and time, 380
Section (Procedure Division), 82
Section headers (Procedure Division), 27–28
Declaratives, 245
Go To statement, 163–169
headers, 157–159
Paragraph title, 157–158, 169
Perform statement, 157
Secure clause, 64–65, 67
Select statement
Alternate Key, 234
Assign clause, 212
COBOL sp2 panels, 441
Duplicate Key, 234
File Status clause, 212
Indexed files, 233–235, 258
Optional clause, 229
Primary Key, 233
Random access, 256
Relative file, 275, 279
Sequential files, 211
storing, 234
selection objects/subjects
Evaluate statement, 143, 145, 147
multiple, 147–148
Other clause, 148
executing, 148–149
multiple, 147–148
Other clause, 148
rearranging, 153
sentences, 82
sequence, 145
stacking, 146, 154
True, 145
When, 143
separating fields, 118–121
Sequential access, 234, 270
adding, 219–220
At End condition, 251
Close statement, 215
creating, 215–217
Depending On statement, 228
delimiters, 211
errors, 216
end-of-file condition, 222
File Description (FD)
statement, 213
File Status values, 215–217, 219, 225
filenames, 216
I-O (Open in Input mode), 214, 221
Indexed files, 234–239, 247, 250, 283
Line Sequential, 210–211, 225–230, 314–320
Occurs statement, 228
Open for
Input/Output/Extend, 214–215, 219, 225, 238
Read statement, 222, 237
Record Sequential, 210–211
records, 250–253, 270
description, 213
identifiers, 216
referencing, 219
retrieving, 220–221
size limitations, 228
storing, 219
variable-length, 228
Relative file, 275, 284
Rewrite statement, 225, 272
Select statement, 145, 211
Start statement, 254–256
tables, 211
update procedure, 313, 326
Write statement, 210, 216–217
Set conditional statement, 136
conditions, 137
to false, 137
fields, 98–99
index values, 196
Sign clause, 64, 67
Sign Separate clause, 43
signed fields
subtract statement, 87
numeric, 43–44
Sin Intrinsic Function, 390–391
single characters
converting, 103
Inspect statement, 108
sizing
data items, 190
fonts, 338
records in Sequential files, 228
slash (/), 49, 51
software requirements
Fujitsu compiler, 13
Sort Description (SD), 286
Sort statement, 287
Ascending field, 290
control breaks, 345–348, 353–354
data, 292
dates, 348–350
Descending field, 290
duplication, 300
executing, 301
files, 286–291
Giving clause, 287, 290
Indexed files, 290–292
Input/Output Procedure, 287, 291, 293–299
records, 298, 339
restricting, 292
sequence, 299
speed, 295
Using clause, 287
Sort Work File, 346
deleting, 300
Fujitsu COBOL, 286
records, 299
sorting, 301
writing, 292
source code, 8, 118
characters, 119
delimiters, 118
free-form, 23
reducing, 142, 150, 152–153
separating, 119, 121
storing, 29–30
subprograms, 424–425
Source-Computer paragraph (Configuration section), 24
sp2 program, 437–438
spaces
delimiters, 114
moving, 98
source fields, 118
using as delimiters, 120
Spaces value (literals), 47
special names in commandlines, 108
Special-Names Paragraph, 25, 70, 162
Accept statement, 97
Crt Status, 71–72
cursor, 70–71
function keys, 70
statements, 72
speed
Sort statement, 295
tables, 205
Sqrt Intrinsic Function, 392
square root of argument, 392
stacking selection objects, 146, 154
Standard-Deviation Intrinsic Function, 394
standards
improvements, 449–450
industry, 11–12
Start statement
Alternate Key field, 255
beginning-of-file, 255
Dynamic access, 259, 264
File Status values, 254
Indexed files, 259, 264
Invalid Key clause, 254
Key fields, 265–266
Search statement, 196
Sequential access, 254–256
String statement, 117
Unstring statement operations, 120–121
statements
add, 83–86, 93
case sensitivity, 24
complex, 132–135
compute, 89–90, 93
conditional, 126
delimiters, 118
divide, 88–89
entering, 32
executing, 128, 132, 145, 175
fields, 87, 122
format, 88–89, 143
multiple, 87–88, 139
phrases, 126
reference modification, 103
starting, 117, 120–121
subtract, 86–87
terminating, 84
see also specific statements
static Call statement, 421–423, 426
statistical functions
Max, 393
Mean, 393
Median, 394
Midrange, 393
Min, 393
Ord-Max, 393
Ord-Min, 393
Range, 394
Standard-Deviation, 394
Sum, 394
Variance, 394
Stop Run statement, 29, 166
Perform statement, 159
subprograms, 412
storing
bytes, 44
data items, 85
Indexed files, 234
numeric fields, 45
records, 219
Relative Key clause, 275
source code, 29–30
string functions
Char, 399
Length, 398
Lower-Case, 400
Max, 399
Min, 399
Numval, 402
Numval-C, 402
Ord, 400
Ord-Max, 399
Ord-Min, 399
Output-Field, 400
Random, 397
Revers, 400
Upper-Case, 400
String statement
clearing, 122
control breaks, 350
delimiters, 114–116
space, 114
fields, 115, 118–121
multiple, 122
group-level data items, 112
Pointer clause, 117
formatting data, 117
initializing, 113
overflowing, 113–114
reference modification, 112, 117
starting, 117
target fields, 112
structured programming, 12, 20
called programs, 410–415
subprograms, 410–414
Call statement, 417
Call By Reference, 420–421
date validation, 418–420
editing, 412
Exit Program statement, 412
Is Initial clause, 416
Linkage Section, 418
main programs, 415
projects, 416
source code, 424–425
Stop Run statement, 412
subscripts, tables, 187
subtotals (reports)
Add with Corresponding statement, 357
control break programs, 344–346, 351
dealer, 345
errors, 357
grand, 345
resetting values, 357
save fields, 357
transaction date totals, 345
subtract statement, 86–87
Sum Intrinsic Function, 394
symbolic filenames, 212
syntax errors, 38
in compilers, 33
reporting, 31
T tables, 187
assigning values, 189
binary search, 198
boundary violations, 193, 204–205
creating, 203–204
data items, 191–192
defining, 188
editing, 196
elements, 189, 195
Group Level elementary items, 188
incrementing, 197
index values, 195–198, 200
initializing, 197
loading, 189–193, 195, 211
lookups, 193–195
multidimensional, 200–204
numeric data items, 189, 195
occurrences, 203
Redefine clause, 191–192
referencing, 200
Search statement, 195–198, 200–203, 205
speed, 205
subscripts, 187, 189
values, 399
variable-length, 395, 399
Tallying clause, 102, 119, 123
Tangent Intrinsic Function, 390–391
target fields
clearing, 122
initializing, 113, 118
overflowing, 113–114, 120
reference modification, 112, 117
terminating
Accept, 70
If conditional statements, 128
Line Sequential files, 210
Perform statement, 169, 172
processing loops, 445
programs, 29, 107
records, 210
statements, 84
update procedures, 317
TEST compiler option, debugging screen, 185
testing
conditions, 127, 136, 139
Evaluate statement, 150
numeric fields, 129
Perform statement, 173
values, 129–130
text display
COBOL sp2
Input, 235–237
panels, 430
text mode user interface, 63
Then phrase, 129
Thru clause, 158
time
converting from seconds, 380
current, 380
GMT, 380–382
headings, 352
local, 380–382
printing, 337–338
titles in COBOL sp2 panels, 429, 441
To clause, 69–70, 79
total lines (control breaks), 350
transaction data (reports)
capturing, 306–309
control break programs, 345–348
end-of-file field, 323
errors, 309
File Status values, 317, 323
keys, 314
Open with Extend, 308
printing, 358
processing loop, 324
reading, 318
rejecting, 314
saving, 314
updating, 321
validation, 310–313, 326
trigonometric functions
Arccosine, 390–391
Arcsin, 390–391
Arctangent, 390–391
Cosine, 390
Sin, 390–391
Tangent, 390–391
troubleshooting
compilers, 36–37
debugging screen, 185
field length, 84
true conditions, 145
Evaluate statement, 143–144
executing, 128
If statements, 126, 128
truncating, 68, 90–91
tutorials for programming courses, 127
two-digit dates, 368
U unaligned numeric fields, 49
unconditional branch, 163
Underline clause, 67
records, 341
reports, 339
screens, 66
unedited numeric fields, 48
unequal conditional statements, 128
UNIX
compatibilty, 63
Line Sequential files, 210
user interface, 63
Unstring statement, 118, 138
Count In clause, 119–120
Delimiter In clause, 118, 120
fields, 119, 123
initializing, 118
multiple, 119
name entries, 137–138
On Overflow clause, 120
Pointer clause, 123
positioning, 121
spaces, 118
source fields, 118
separating, 121
starting, 120–121
Tallying In clause, 123
target fields, 119–120
Until clause, 162, 172
update items, 70
update procedures
I-O mode, 221
Indexed files, 233, 283
Line Sequential files, 225–228
master, 320–325
Process-Files Paragraph, 318
Random, 313, 326
records, 271–273
Sequence, 313–320, 326
terminating, 317
transaction data, 321
see also Write statement
Upon clause, 28
Upper-Case Intrinsic Function, 400
Usage clause, 44, 64, 67
numeric fields, 44–46
storage of bytes, 44
values, 44–45
user interface
add-on tools, 61
ANSI COBOL standard, 62
compilers, 62
Indexed files, 239–244
Screen_Section, 27, 63, 65
text mode, 63
see also GUI
Using clause, 70, 79, 287, 417
utilities, debugging, 181–183
V Validate statement, 449
data subprograms, 416–417
dates, 376–382
days, 376
errors, 379
fields, 310, 312, 376
Fujitsu compiler installation, 15–19
integers, 377
leap years, 376, 378
months, 376
ranges, 377
records, 232
subprograms, 418–420
transaction data, 310–313, 326
Value clause
accept statement, 71–72
alphanumeric fields, 46
characters, 103
data items, 144–145
dates, 376
Evaluate statement, 141–143, 154
fields, 98–99, 376
greater than, 130
group-level items, 52
incrementing, 172–173
less than, 129–130
literals, 47–48
leading digits, 42
numeric fields, 42
ranges, 129, 136
subtotals, 346, 357
tables, 399
testing, 154
Usage clause, 44–45
variable-length records in Sequential files, 228, 399
creating, 203–204
multidimensional, 204
variables, 137
Variance Intrinsic Function, 394
Varying clause, 197
initializing values, 184
Perform statement, 172–173
verbs, see statements
versions of COBOL, 449
Visual Basic, 428
Visual C++, 428
VMS COBOL compiler, 71
W walk through (programs), 346–363
Web sites, 429
weekdays, 374–375
When clause, 143, 145, 152–153
When-Compiled Intrinsic Function, 403–404
Windows 3.1
debugging utility, 181–182
Fujitsu compilers, 14–15, 17
Matchcase of Keyword check box, 32
With Test After clause, 173–174
Working Storage Section (Data Division), 26–27, 55
Read statement, 222
records, 219
tables, 189, 195
Write statement, 270–271
files, 270–271
buffers, 219
Status values, 219, 238
Indexed files errors, 244
Invalid Key errors, 244–245
opened I-O, 225
printers, 340
records
adding, 219
identifiers, 216
reports, 330–331
Sequential, 210, 216–217
Sort Work File, 292
see also creating; updating
X-Y-Z Y2K (Year 2000), 368
zero (0)
alphanumeric fields, 98
division, 89
insertion, 51
moving, 98
numeric fields, 49, 98
suppression (Z), 49–50
Zeros value (literals), 47
Fair Use Sources
COBOL Programming Language, COBOL Source File, COBOL .cbl File Extension, COBOL .cob File Extension, COBOL .cobol File Extension, COBOL Compiler, COBOL Compilation Unit, COBOL Run-time System, COBOL Environment Division, COBOL Identification Division, COBOL Procedure Division, COBOL Data Division, COBOL Configuration Section, COBOL Input-Output Section, COBOL File-Control Paragraph, COBOL I-O Control Paragraph, COBOL File Section, COBOL Working-Storage Section, COBOL Local-Storage Section, COBOL Linkage Section, COBOL Communication Section, COBOL Report Section, COBOL FD Entry (File Descriptor), COBOL SD Entry (Sort Descriptor), COBOL SELECT Statement, COBOL ASSIGN Clause, COBOL ORGANIZATION Clause, COBOL ACCESS MODE, COBOL SEQUENTIAL Access, COBOL RELATIVE Access, COBOL INDEXED Access, COBOL RECORD KEY Clause, COBOL ALTERNATE KEY Clause, COBOL DYNAMIC Access Mode, COBOL RANDOM Access Mode, COBOL KEY IS Clause, COBOL LINAGE Clause, COBOL BLOCK CONTAINS Clause, COBOL RECORD CONTAINS Clause, COBOL RECORDING MODE Clause, COBOL LABEL RECORDS Clause, COBOL CODE-SET Clause, COBOL FILE STATUS Clause, COBOL FD (File Description) Entry, COBOL FILE SECTION Variables, COBOL WORKING-STORAGE Variables, COBOL 01 Level Number, COBOL 77 Level Number, COBOL 66 Level Number, COBOL 88 Level Number (Condition Names), COBOL PIC Clause (Picture), COBOL USAGE Clause, COBOL DISPLAY Usage, COBOL COMP Usage, COBOL COMP-3 (Packed Decimal), COBOL COMP-1 (Floating Point) , COBOL COMP-2 (Floating Double) , COBOL COMP-4 Equivalent to COMP, COBOL COMP-5 (Native Binary) , COBOL SIGN SEPARATE Clause, COBOL SIGN TRAILING Clause, COBOL JUSTIFIED RIGHT Clause, COBOL SYNCHRONIZED Clause, COBOL OCCURS Clause, COBOL OCCURS DEPENDING ON Clause, COBOL REDEFINES Clause, COBOL RENAMES Clause, COBOL VALUE Clause, COBOL VALUE IS Clause, COBOL FILLER Keyword, COBOL ACCEPT Statement, COBOL DISPLAY Statement, COBOL MOVE Statement, COBOL ADD Statement, COBOL SUBTRACT Statement, COBOL MULTIPLY Statement, COBOL DIVIDE Statement, COBOL COMPUTE Statement, COBOL INITIALIZE Statement, COBOL STRING Statement, COBOL UNSTRING Statement, COBOL INSPECT Statement, COBOL PERFORM Statement, COBOL PERFORM UNTIL, COBOL PERFORM VARYING, COBOL PERFORM THRU, COBOL EXIT Statement, COBOL STOP RUN Statement, COBOL GOBACK Statement, COBOL EVALUATE Statement, COBOL WHEN Clause (EVALUATE), COBOL CONTINUE Statement, COBOL NEXT SENTENCE Statement, COBOL IF Statement, COBOL ELSE Clause, COBOL END-IF Statement, COBOL GO TO Statement, COBOL ALTER Statement (Obsolete), COBOL SORT Statement, COBOL MERGE Statement, COBOL RELEASE Statement (for SORT), COBOL RETURN Statement (for SORT), COBOL SEARCH Statement, COBOL SEARCH ALL (Binary Search), COBOL CALL Statement, COBOL CANCEL Statement, COBOL LINKAGE SECTION Variables, COBOL USING Clause (in Procedure Division), COBOL EXIT PROGRAM Statement, COBOL ENTRY Statement (Obsolete), COBOL COPY Statement, COBOL REPLACE Directive, COBOL EJECT Directive, COBOL SKIP Directive, COBOL SERVICE RELOAD (IBM Extension, COBOL INTRINSIC FUNCTIONS, COBOL FUNCTION Keyword, COBOL CURRENT-DATE Function, COBOL NUMVAL Function, COBOL NUMVAL-C Function, COBOL WHEN-COMPILED Function, COBOL RANDOM Function, COBOL REM Function, COBOL LENGTH Function, COBOL MAX Function, COBOL MIN Function, COBOL MOD Function, COBOL SUBSTRING Function, COBOL UPPER-CASE Function, COBOL LOWER-CASE Function, COBOL NATIONAL-OF Function, COBOL DISPLAY-OF Function, COBOL TEST Function (in some compilers, COBOL EXAMINE Statement (Old name of INSPECT), COBOL CLASS Condition, COBOL ALPHABETIC Class Condition, COBOL ALPHANUMERIC Class Condition, COBOL NUMERIC Class Condition, COBOL JUSTIFIED Clause (in PIC), COBOL SYNCHRONIZED Clause repeated, COBOL ON SIZE ERROR Clause, COBOL ON OVERFLOW Clause, COBOL ON EXCEPTION Clause, COBOL INVALID KEY Clause, COBOL END-ADD Statement (in COBOL 2002+, COBOL END-SUBTRACT Statement, COBOL END-MULTIPLY Statement, COBOL END-DIVIDE Statement, COBOL END-COMPUTE Statement, COBOL END-PERFORM Statement, COBOL END-READ Statement, COBOL END-WRITE Statement, COBOL END-REWRITE Statement, COBOL END-DELETE Statement, COBOL END-RETURN Statement, COBOL END-SEARCH Statement, COBOL END-IF repeated, COBOL END-STRING Statement, COBOL END-UNSTRING Statement, COBOL END-INSPECT Statement, COBOL END-ACCEPT Statement, COBOL END-DISPLAY Statement, COBOL In-Line PERFORM, COBOL Nested Programs, COBOL END PROGRAM Header, COBOL CALL BY CONTENT, COBOL CALL BY REFERENCE, COBOL CALL BY VALUE, COBOL INITIAL Program Attribute, COBOL RECURSIVE Program Attribute, COBOL EXPORT and IMPORT (Some compilers support, COBOL ENTRY POINTS in Program, COBOL Debugging Lines (D in col 7), COBOL Comment Lines (*) in col 7, COBOL Continuation Lines (- in col 7), COBOL Fixed Format Source Columns, COBOL Column 7 Indicators, COBOL Column 72 Limit, COBOL Free Format (COBOL 2002+) , COBOL *CONTROL Compiler Directive, COBOL *CBL Compiler Directive, COBOL $ SET Compiler Directive (IBM), COBOL ADV Compiler Option, COBOL SSRANGE Compiler Option, COBOL APOST Compiler Option, COBOL RENT Compiler Option, COBOL MAP Compiler Option, COBOL OPTIMIZE Compiler Option, COBOL NOOPTIMIZE Compiler Option, COBOL INSPECT TALLYING, COBOL INSPECT REPLACING, COBOL INSPECT CONVERTING, COBOL STRING DELIMITED BY, COBOL UNSTRING DELIMITED BY, COBOL POINTER IN STRING/UNSTRING, COBOL SUBScripting Arrays (OCCURS), COBOL OCCURS Depending On Variables, COBOL Table Handling, COBOL SEARCH VERB, COBOL SEARCH ALL VERB, COBOL SORT VERB, COBOL MERGE VERB, COBOL USE FOR DEBUGGING ON Statement, COBOL USE Global Declarative, COBOL DECLARATIVES Section, COBOL END DECLARATIVES, COBOL FILE STATUS Checking, COBOL EXTEND MODE for files, COBOL REWRITE Statement, COBOL DELETE Statement (for indexed files), COBOL START Statement (indexed file positioning), COBOL READ NEXT, COBOL READ PREVIOUS (not standard widely COBOL READ KEY Is Clause, COBOL WRITE FROM Clause, COBOL WRITE ADVANCING PAGE, COBOL WRITE AFTER ADVANCING LINES, COBOL WRITE BEFORE ADVANCING, COBOL Page-Controlled Reports (REPORT SECTION), COBOL Report Writer Feature (Obsolete in some implementations), COBOL RH, PH, PF, DE, etc. in REPORT)], [[COBOL SPECIAL-NAMES Paragraph, COBOL DECIMAL-POINT IS COMMA, COBOL CURRENCY SIGN Clause, COBOL CLASS Alphabet Name Definition, COBOL SYMBOLIC CHARACTERS, COBOL CRT STATUS Phrase (Old terminals), COBOL ADVANCING Control in WRITE, COBOL Nonnumeric Literals, COBOL Numeric Literals, COBOL PICTURE Clause (PIC), COBOL PIC 9 for digits, COBOL PIC X for alphanumeric, COBOL PIC A for alphabetic, COBOL PIC S for sign, COBOL PIC V for implied decimal, COBOL PIC P for scaling position, COBOL JUSTIFIED RIGHT Clause in PIC, COBOL BLANK WHEN ZERO Clause, COBOL ZERO SUPPRESSION, COBOL SIGN LEADING SEPARATE, COBOL SIGN TRAILING SEPARATE, COBOL USING in PROCEDURE DIVISION, COBOL GIVING/RETURNING in CALL, COBOL CANCEL Program, COBOL LINKAGE SECTION Parameters, COBOL EXTERNAL Name Clause, COBOL GLOBAL Clause for Data, COBOL COMMON Data, COBOL INITIAL Clause on Programs, COBOL IDENTIFICATION DIVISION PROGRAM-ID, COBOL AUTHOR Paragraph, COBOL INSTALLATION Paragraph, COBOL DATE-WRITTEN Paragraph, COBOL DATE-COMPILED Paragraph, COBOL SECURITY Paragraph, COBOL REMARKS Paragraph (Obsolete), COBOL Class Condition Checks, COBOL Condition-Names (88 Level), COBOL LEVEL 88 Definition, COBOL SET condition-name TO TRUE, COBOL SET condition-name TO FALSE, COBOL SET variable TO value, COBOL SET ... UP/DOWN BY value (for indexes), COBOL ACCEPT FROM DATE, COBOL ACCEPT FROM DAY, COBOL ACCEPT FROM DAY-OF-WEEK, COBOL ACCEPT FROM TIME, COBOL ACCEPT FROM COMMAND-LINE (Extension, COBOL ACCEPT FROM ENVIRONMENT (Extension, COBOL DISPLAY UPON], [COBOL DISPLAY WITH NO ADVANCING, COBOL READY TRACE (Obsolete Debug feature), COBOL USE AFTER ERROR Declarative, COBOL USE AFTER EXCEPTION Declarative, COBOL USE AFTER STANDARD Declarative, COBOL EXIT PARAGRAPH Statement, COBOL EXIT Perform CYCLE, COBOL EXIT Perform Loop
COBOL: Effective IBM Enterprise COBOL, Object-Oriented Programming for COBOL - Object-Oriented COBOL, COBOL Best Practices, COBOL FAQ, COBOL Standards (ISO COBOL-2023 - ISO/IEC 1989-2023 Standard), IBM Enterprise COBOL for z/OS, Deprecated / Defunct Micro Focus Visual COBOL - Visual COBOL - Managed COBOL from Micro Focus (JVM COBOL and dot NET COBOL | NET COBOL), COBOL Fundamentals, COBOL Inventor - COBOL Language Designer: 1959 by Howard Bromberg COBOL | Howard Bromberg, Norman Discount COBOL | Norman Discount, Vernon Reeves COBOL | Vernon Reeves, Jean E. Sammet, William Selden COBOL | William Selden, Gertrude Tierney COBOL | Gertrude Tierney, with indirect influence from Grace Hopper, CODASYL, ANSI COBOL, ISO/IEC COBOL; Modern COBOL - Legacy COBOL, IBM COBOL, COBOL keywords, COBOL data structures - COBOL algorithms, COBOL syntax, Visual COBOL, COBOL on Windows, COBOL on Linux, COBOL on UNIX, COBOL on macOS, Mainframe COBOL, IBM i COBOL, IBM Mainframe DevOps, COBOL Paradigms (Imperative COBOL, Procedural COBOL, Object-Oriented COBOL - COBOL OOP, Functional COBOL), COBOL syntax, COBOL installation, COBOL containerization, COBOL configuration, COBOL compilers, COBOL IDEs, COBOL development tools, COBOL DevOps - COBOL SRE, COBOL data science - COBOL DataOps, COBOL machine learning, COBOL deep learning, COBOL concurrency, COBOL history, COBOL bibliography, COBOL Glossary - Glossaire de COBOL - French, COBOL topics, COBOL courses, COBOL Standard Library, COBOL libraries, COBOL frameworks, COBOL research, Grace Hopper, COBOL GitHub, Written in COBOL, COBOL popularity, COBOL Awesome list, COBOL Versions. (navbar_cobol - see also navbar_mainframe, navbar_fortran)
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.