COBOL Language Fundamentals with VSAM Quick Start
()
About this ebook
This book will teach you the basic information and skills you need to develop applications with the COBOL programming language and VSAM file management service on IBM mainframe computers running z/OS. The instruction, examples and sample programs in this book are a fast track to becoming productive with COBOL and VSAM as quickly as possible. The content of this book is easy to read and digest, well organized and focused on honing real job skills. Acquiring these skills is a key step in mastering COBOL and VSAM application development so you'll be ready to perform effectively on an application development team.
Robert Wingate
Robert Wingate is a computer services professional with over 30 years of IBM mainframe and distributed programming experience. He holds several IBM certifications, including IBM Certified Application Developer - DB2 11 for z/OS, and IBM Certified Database Administrator for LUW. He lives in Fort Worth, Texas.
Read more from Robert Wingate
Interview Questions for IBM Mainframe Developers Rating: 1 out of 5 stars1/5COBOL Basic Training Using VSAM, IMS and DB2 Rating: 5 out of 5 stars5/5DB2 11 for z/OS: SQL Basic Training for Application Developers Rating: 4 out of 5 stars4/5IMS-DB Basic Training For Application Developers Rating: 0 out of 5 stars0 ratingsInterview Questions for DB2 z/OS Application Developers Rating: 0 out of 5 stars0 ratingsCOBOL Language Fundamentals Quick Start Rating: 0 out of 5 stars0 ratingsDB2 11 for z/OS: Intermediate Training for Application Developers Rating: 0 out of 5 stars0 ratingsCOBOL Language Fundamentals with DB2 Quick Start Rating: 0 out of 5 stars0 ratingsDB2 11 for z/OS: Basic Training for Application Developers Rating: 5 out of 5 stars5/5MVS JCL Utilities Quick Reference, Third Edition Rating: 5 out of 5 stars5/5DB2 11.1 for LUW: SQL Basic Training for Application Developers Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-313 Practice Questions Rating: 0 out of 5 stars0 ratingsPLI Basic Training Using VSAM, IMS and DB2 Rating: 1 out of 5 stars1/5DB2 Exam C2090-616 Practice Questions Rating: 5 out of 5 stars5/5DB2 11.1 for LUW: Basic Training for Application Developers Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-313 Preparation Guide Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-320 Preparation Guide Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-320 Practice Questions Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-615 Practice Questions Rating: 5 out of 5 stars5/5
Related to COBOL Language Fundamentals with VSAM Quick Start
Related ebooks
COBOL Language Fundamentals Quick Start Rating: 0 out of 5 stars0 ratingsCOBOL Language Fundamentals with DB2 Quick Start Rating: 0 out of 5 stars0 ratingsPLI Basic Training Using VSAM, IMS and DB2 Rating: 1 out of 5 stars1/5Cobol Rating: 0 out of 5 stars0 ratingsMVS JCL Utilities Quick Reference, Third Edition Rating: 5 out of 5 stars5/5COBOL for the Approved Workman Rating: 0 out of 5 stars0 ratingsDB2 11 for z/OS: Intermediate Training for Application Developers Rating: 0 out of 5 stars0 ratingsDB2 11 for z/OS: Basic Training for Application Developers Rating: 5 out of 5 stars5/5Mastering IBM i: The Complete Resource for Today's IBM i System Rating: 3 out of 5 stars3/5IBM COBOL A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-320 Preparation Guide Rating: 0 out of 5 stars0 ratingsDB2 9 for Developers Rating: 0 out of 5 stars0 ratingsDB2 Exam C2090-615 Practice Questions Rating: 5 out of 5 stars5/5DB2 Exam C2090-320 Practice Questions Rating: 0 out of 5 stars0 ratingsObject-Oriented Programming in ColdFusion Rating: 5 out of 5 stars5/5DB2 11.1 for LUW: Basic Training for Application Developers Rating: 0 out of 5 stars0 ratingsFunctions in Free-Format RPG IV Rating: 0 out of 5 stars0 ratingsIBM i5/iSeries Primer: Concepts and Techniques for Programmers, Administrators, and System Operators Rating: 0 out of 5 stars0 ratingsIBM System i APIs at Work Rating: 5 out of 5 stars5/5Mainframe Interview Cases Rating: 0 out of 5 stars0 ratingsCOBOL Programming Interview Questions: COBOL Job Interview Preparation Rating: 5 out of 5 stars5/5Programming in COBOL: Library of Computer Education Rating: 5 out of 5 stars5/5zOS JCL (Job Control Language) Rating: 0 out of 5 stars0 ratingsCobol for Students Rating: 5 out of 5 stars5/5Mvs Jcl in Plain English Rating: 5 out of 5 stars5/5IBM COBOL A Complete Guide - 2021 Edition Rating: 0 out of 5 stars0 ratingsA Guide to Db2 Performance for Application Developers: Code for Performance from the Beginning Rating: 0 out of 5 stars0 ratingsDB2 Interview Questions, Answers, and Explanations: DB2 Database Certification Review Rating: 0 out of 5 stars0 ratingsIBM mainframe Second Edition Rating: 0 out of 5 stars0 ratingsIBM Db2 A Complete Guide Rating: 0 out of 5 stars0 ratings
Operating Systems For You
Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5PowerShell: A Comprehensive Guide to Windows PowerShell Rating: 4 out of 5 stars4/5The iPadOS 17: The Complete User Manual to Quick Set Up and Mastering the iPadOS 17 with New Features, Pictures, Tips, and Tricks Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5CompTIA Linux+ Study Guide: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsRaspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsLinux Bible Rating: 0 out of 5 stars0 ratingsThe Mac Terminal Reference and Scripting Primer Rating: 4 out of 5 stars4/5Learn Windows PowerShell in a Month of Lunches Rating: 0 out of 5 stars0 ratingsWindows 11 For Dummies Rating: 0 out of 5 stars0 ratingsTor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsLinux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsBash Command Line Pro Tips Rating: 5 out of 5 stars5/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Linux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Make Your PC Stable and Fast: What Microsoft Forgot to Tell You Rating: 4 out of 5 stars4/5Mastering macOS Programming Rating: 0 out of 5 stars0 ratingsiPhone Unlocked Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Mastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5Learn SQL Server Administration in a Month of Lunches Rating: 3 out of 5 stars3/5Linux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Ultimate SwiftUI Handbook for iOS Developers: A complete guide to native app development for iOS, macOS, watchOS, tvOS, and visionOS Rating: 0 out of 5 stars0 ratingsMacs All-in-One For Dummies Rating: 0 out of 5 stars0 ratings
Reviews for COBOL Language Fundamentals with VSAM Quick Start
0 ratings0 reviews
Book preview
COBOL Language Fundamentals with VSAM Quick Start - Robert Wingate
LEGAL
Disclaimer
The contents of this book are based upon the author’s understanding of and experience with the following IBM products: COBOL, VSAM. Every attempt has been made to provide correct information. However, the author and publisher do not guarantee the accuracy of every detail, nor do they assume responsibility for information included in or omitted from it. All of the information in this book should be used at your own risk.
Copyright
The contents of this book may not be copied in whole, or in part, without the explicit written permission of the author. The contents are intended for personal use only. Secondary distribution for gain is not allowed. Any alteration of the contents is absolutely forbidden.
Copyright, 2020 by Robert Wingate
LEGAL
Introduction
Welcome
Assumptions:
Approach to Learning
Chapter One : COBOL Language Basics
Introduction
COBOL Language Basics
Programming Format
Four Divisions
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
DATA DIVISION
PROCEDURE DIVISION
Optional Entries and Sections
Variables, Data Types and Assignment
Data Types
COMP Variables
Data Structures
Sample Program
Sequence, Selection, Iteration
Sequence
Selection
Iteration
File I/O
Program Listing for COBTRN3
Reporting
ANSI Carriage Control
Report Program Sample
Calculations
Calculations with GIVING
Calculations with COMPUTE
Edits and Validation
Tables
Sub Programs
Chapter One Review Questions
Chapter Two: COBOL Programming with VSAM
Introduction to VSAM
Types of VSAM Files
Key Sequence Data Set (KSDS)
Entry Sequence Data Set (ESDS)
Relative Record Data Set (RRDS)
Creating VSAM Files
Loading and Unloading VSAM Files
VSAM Updates with File Manager
Application Programming with VSAM
COBOL Program to Read Records (COBVS1)
COBOL Program to Add Records (COBVS2)
COBOL Program to Update Records (COBVS3)
COBOL Program to Delete Records (COBVS4)
COBOL Program to Retrieve Records Sequentially (COBVS5)
Creating and Accessing Alternate Indexes
COBOL Program to Read Alternate Index (COBVS6)
Other VSAM JCL
JCL to CREATE ESDS
JCL to CREATE RRDS
JCL to LIST DATASET INFORMATION
VSAM File Status Codes
Chapter Two Review Questions
Appendices
Chapter Questions and Answers
Chapter One Review Questions
Chapter Two Review Questions
Additional Resources
Other Titles by Robert Wingate
About the Author
Introduction
Welcome
Congratulations on your purchase of COBOL Language Fundamentals with VSAM. This book will teach you the basic information and skills you need to develop applications with COBOL and VSAM on IBM mainframes running z/OS. The instruction, examples and sample programs in this book are a fast track to becoming productive as quickly as possible using COBOL with VSAM. The content is easy to read and digest, well organized and focused on honing real job skills.
This is not an everything you need to know about COBOL
book. Rather, this text will teach you what you need to know to become productive quickly with COBOL and VSAM. For additional detail, you can download and reference the IBM manuals and Redbooks associated with these products.
Assumptions:
While I do not assume that you know a great deal about IBM mainframe programming, I do assume that you’ve logged into an IBM mainframe and know your way around. Also I assume that you have a working knowledge of computer programming in some language (it can be a language other than COBOL). All in all, I assume you have:
1. A working knowledge of ISPF navigation and basic operations such as creating data sets.
2. A basic understanding of structured programming concepts.
4. Access to a mainframe computer running z/OS and DB2 (with a COBOL compiler available).
Approach to Learning
I suggest you follow along and do the examples yourself in your own test environment. There’s nothing like hands-on experience. Going through the motions will help you learn faster.
If you do not have access to a mainframe system through your job, I can recommend Mathru Technologies. You can rent a mainframe account from them at a very affordable rate, and this includes access to a COBOL compiler. The URL to the Mathru web site is:
http://mathrutech.com/index.html
Besides the instruction and examples, I’ve included questions at the end of each chapter. I recommend that you answer these and then check yourself against the answers in the back of the book.
Knowledge, experience and practice questions. Will that guarantee that you’ll succeed as a COBOL and VSAM application developer? Of course, nothing is guaranteed in life. But if you put sufficient effort into this well-rounded training plan that includes all three of the above, I believe you have a very good chance of becoming productive as an IBM Application Developer using COBOL and VSAM as soon as possible. This is your chance to get a quick start!
Best of luck!
Robert Wingate
IBM Certified Application Developer – DB2 11 for z/OS
C:\Books\IBM Books\COBOL Language Fundamentals with VSAM Quick Start\D2D\COBOL Language Fundamentals with VSAM Quick Start_files\image001.jpgChapter One : COBOL Language Basics
Introduction
COBOL is an acronym for Common Business-Oriented Language. It’s a third generation procedural language that has been around since 1959. COBOL was developed primarily for business use. It generally focuses on record or database input/out, as well as calculations and reports.
You may hear that COBOL is gone or on the way out, but its demise is probably exaggerated. While lots of mainframe COBOL programming has been rewritten in other languages (or replaced by commercial packages), COBOL is still heavily used in legacy applications that run on IBM mainframe computers. This is true especially for banking and finance applications. Check out this article if you don’t believe it:
https://thenewstack.io/cobol-everywhere-will-maintain/
If you are used to programming in languages such as C or Java, you’ll find that COBOL is a bit more English-like. This can be an advantage or disadvantage depending on how you look at it. For example, a data assignment to a variable in most programming languages can be as simple as:
X = 27
In COBOL you would code this same operation as:
MOVE 27 TO X
The latter is somewhat more verbose. It also has the receiving variable on the right side of the equation which is different.
Also, in COBOL you can spell out Booleans such as > or < using English phrases, such as:
IF X IS GREATER THAN 100
Whatever your view of the verbosity, COBOL is a very usable language and worth learning. As legacy COBOL programmers retire, there is still much code to be maintained or converted. This chapter will help make you productive for these tasks quickly.
COBOL Language Basics
Programming Format
Unlike more freeform languages, COBOL is very particular about exactly where you can put executable code. Here is a summary of the formatting rules you must follow in COBOL.
image.jpgIf you do not follow these rules, you will receive compiler errors which tend to cascade (one error causes multiple others). The model programs in this book will help keep you out of trouble.
Four Divisions
A COBOL source program is grouped into the following four divisions:
1. Identification Division
2. Environment Division
3. Data Division
4. Procedure Division
Only the Identification division is required, but you can’t do much without the others.
IDENTIFICATION DIVISION
The identification division can specify the program name, author, data written and a few other pieces of information. The only mandatory element is the program name.
ENVIRONMENT DIVISION
The environment division consists of a configuration section and an input-output section.
Configuration Section.
The Configuration Section is optional. If you include it you can specify the source and object computer upon which the program was written and run, respectively. This is simply documentation and has no affect when the program is compiled.
Input-Output Section.
The Input-Output Section is used to define external input and output files, including the record description that the program requires to read and write to the files.
File Control.
We’ll get to this in the file I/O section of this text.
I/O Control.
The I/O-CONTROL paragraph is optional. It specifies the storage areas to be shared by different files. I’ve never actually