[USflag] The American Programmer [USflag]
Home Programming Books for Computer Professionals Privacy Terms
           Home   > Programming   > COBOL Book

COBOL Book!


Top of Page

Model Programs for Business Applications. COBOL Programming Logic Examples.

This book contains working programs! COBOL working source code examples. From simple logic to three level control break (subtotal) and batch file update/match/merge.
You'll have programs that have been tested for validating data, table handling, SEARCH, Indexing, VSAM KSDS, and variable format files.
This is for those just beginning programming in COBOL and those with some experience.
If you want good, working, tested source code COBOL sample programs and COBOL logic examples this is the book for you.
These model programs give you good program structure for the major program types.



Model Programs for Business Applications  

in COBOL  
 
 
 
 
 
 
 
 
 

 
 


Model Programs for Business Applications in COBOL: Examples of Program Logic

Gabe is the author of several mainframe books:
REXX Quick Reference     REXX in the TSO Environment (Available new and used)     The REXX Language on TSO
MVS JCL (Out of Print)
   Mastering OS2/REXX (Available new and used)    ISPF Services: Using the Dialogue Manager, with REXX    MVS/TSO (Available new and used)


Top of Page


Top of Page

Introduction

This book is for someone who knows programming in COBOL. It contains complete, working, generic programs. They illustrate the major types of business logic that are needed. It is also a complete resource for a training coordinator who is setting up a company's training class in COBOL. In addition, it is a wonderful way to learn another programming language, if you already know one.

A well written program needs two things: good language syntax and good logic. Your COBOL must be good COBOL. Your instructions must be written correctly or they won’t do what you want. More important than that is the right approach to solving the problem, your logic.

There are enough books on COBOL language syntax on the market to sink three battleships, but one that I would particularly recommend is Murach's Structured COBOL, published by Mike Murach Associates.

There are millions of programs now running on business computers. I doubt that any two are exactly the same. But does that mean that they are all totally different? I doubt it. If you looked at all those programs you would probably find that they fall into a few select categories.

This book is about those categories. It contains general solutions to business programming problems. If you master these solutions you should be able to handle any business programming problem you encounter.

Is programming an art, something that requires a certain in-born talent? Or can it be learned? The right answer is a little bit of each. This book can’t help with the in-born talent. It can help by showing you logic solutions that have worked, that have been tried and tested, and have won acceptance in the industry.

I start with the premise that there is a small number of fundamental business programming problems, and that most concrete applications programs will fall into one or possibly a combination of these. This book will show you model programs for these programming tasks.

The logic used in this book is consistent with the logic in use at major corporations (I’ve taught at more than a few...) It is in essential agreement with the logic used in the Stern and Stern book (the differences are style differences only.) I show you structured COBOL logic that works. Don’t mess with anything that works! When you receive real programming assignments on your job, use these programs as models - I’m authorizing you to steal these programs! Don’t forget to credit the source and tell your co-workers about this book.

How to learn from this book. Study the programming problem presented in each chapter. Carefully examine the sample solution shown. If you have acquired the diskette available with this book, copy the chosen program and its data files to your computer system. If you don’t have the diskette, key in the program and data onto your computer system. Compile and run. Inspect the output, to be sure that everything is working properly.

Correct typing errors. Make the changes required by your computer system and level of COBOL. These are unpredictable. All the programs in this book have been tested on IBM MVS COBOL 2, COBOL-OS 390 and Microfocus COBOL COBOL 2.

If you are a training coordinator you can use this book to set up a COBOL II programming class. The accompanying diskette contains all the data files required as input to these programs. It also contains MVS JCL that you can use to define and load the VSAM KSDS data files that are used. It is unlikely that the JCL will work exactly as given: you’ll have to modify it for your installation’s requirements.

This book is an excellent choice for the self-taught programmer. If you have access to a computer system do all the programs that you have time for.

The style of program used in this book is consistent with COBOL II. Periods are used only where required, after each Data Division entry, after paragraph names, and after the last sentence in each paragraph. Exit paragraphs are not used. Perform THRU is not used. Procedure Division SECTIONS are not used. GOBACK is used to end the program. IF is followed by THEN, optional ELSE, END-IF.

This book does not teach IBM MVS JCL. My book on JCL does. Nevertheless I’ll show you sample JCL that you can use with each program. I won’t show you a JOB JCL statement however, since that would require knowledge of your company’s JCL standards.

This book does not teach MVS/TSO (Time Sharing Option.) My book on TSO does that.

You’ll find everything you need to learn VSAM programming with COBOL. But you will have to find out your company’s naming conventions and change some file or data set names. You’ll have to submit some JCL to create the VSAM files. None of this should take more than a half hour.

Top of Page



Top of Page

Table of Contents

1. The Simple, Single File Program 4
2. The Simple, Single File Report Program 8
3. The Simple, Single File Report Program 
with Record Count or Final Totals 11
4. The Sequence Check Program 14
5. The Record Selection Program. 18
6. The Edit or Validate Program. 21
7. The One Level Subtotal (Control Break) Program 25
8. The Three Level Subtotal (Control Break) Program 30
9. The Sequential File, Batch Update Program 36
10. The COBOL Sort 42
11. The CASE Structure: EVALUATE 46
12. Direct Subscripting 48
13. The Sequential Search 51
14. The Binary Search 55
15. Loading a Table from a Sequential File 59
16. The VSAM File Read Sequentially 66
17. The VSAM KSDS, Read Randomly 74
18. The VSAM File, Read Randomly, 
	Based on Records in a Regular Sequential File 77
19. VSAM Initial Load 80
20. VSAM File Maintenance (Add, Change, Delete) 83
21. VSAM Read Sequentially, with START 87
25. Creating a Variable Format File 90
26. Reading a Variable Format File 93
27. Creating a Variable Format File with Occurs Depending On 96
28. Creating a Variable Format File with Occurs Depending On 100
29. The Table Load with Occurs Depending On 102
30. VSAM Error Codes 106
Appendix. 108

Top of Page


Top of Page


I use these programs myself when I'm on a consulting assignment. Since they are generic, I copy them and make adjustments for the particular program requirements. I know they work because the logic has been tested already.

I use them as the basis for COBOL classes that I teach because they contain useful, generic logic and examples of COBOL techniques.
Top of Page


Links about COBOL

Top of Page

Microfocus COBOL

Compuware's Xpediter.

CA/Endevor

Kasten COBOL Page: Coding Style and Techniques

List of COBOL books with reviews and ordering information

Top of Page


Your email and other personal information will not be given to anyone and will be used only to communicate with you about your order.
[Books Computer]

Home Programming Books for Computer Professionals Privacy Terms Contact |
Site Map and Site Search Programming Manuals and Tutorials The REXX Files Top of Page |

[link page]