Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

COBOL Language Fundamentals with VSAM Quick Start
COBOL Language Fundamentals with VSAM Quick Start
COBOL Language Fundamentals with VSAM Quick Start
Ebook228 pages2 hours

COBOL Language Fundamentals with VSAM Quick Start

Rating: 0 out of 5 stars

()

Read preview

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.

LanguageEnglish
Release dateApr 16, 2020
ISBN9781393265962
COBOL Language Fundamentals with VSAM Quick Start
Author

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

Related to COBOL Language Fundamentals with VSAM Quick Start

Related ebooks

Operating Systems For You

View More

Related articles

Reviews for COBOL Language Fundamentals with VSAM Quick Start

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    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.jpg

    Chapter 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.jpg

    If 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

    Enjoying the preview?
    Page 1 of 1