Page
1
Tom Taulli Foreword by John McKenny Modern Mainframe Development COBOL, Databases, and Next-Generation Approaches
Page
2
(This page has no text content)
Page
3
Praise for Modern Mainframe Development This book is a comprehensive treatment of modern mainframe software development. It is masterfully written and thoroughly researched. —Cameron Seay, mainframe evangelist Every chapter speaks in practical terms on how to leverage the strengths of the mainframe platform. —Russ Teubner, cofounder and CEO of HostBridge Technology Tom’s clearly done his homework on the current and future state of the mainframe. His conviction that hybrid cloud architectures will rule the future lays the foundation for an important and insightful breakdown of the exciting opportunities mainframe modernization presents for enterprise organizations. —Gil Peleg, CEO and founder of Model9 This book is evidence that as the mainframe is modernizing, it will be critical for the next (and some of the current) generation of “mainframers” to level up faster and cover more ground. This book fast-tracks some of that ground that used to take years. —Paul Gamble, z/OS Systems Programmer—Automation, Shared Services Canada The term mainframe has had negative connotations for years. But Tom has done a great job in explaining the technology and how it is a solid option for businesses. —Lionel Dyck, z/OS enthusiast and cofounder of the Zigi open source project
Page
4
(This page has no text content)
Page
5
Tom Taulli Foreword by John McKenny Modern Mainframe Development COBOL, Databases, and Next-Generation Approaches Boston Farnham Sebastopol TokyoBeijing
Page
6
978-1-098-10702-4 [LSI] Modern Mainframe Development by Tom Taulli Copyright © 2022 Tom Taulli. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (https://oreilly.com). For more information, contact our corporate/institu‐ tional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Suzanne McQuade Development Editor: Michele Cronin Production Editor: Gregory Hyman Copyeditor: Sharon Wilkey Proofreader: Piper Editorial Consulting, LLC Indexer: Ellen Troutman-Zaig Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Kate Dullea March 2022: First Edition Revision History for the First Edition 2022-03-16: First Release See https://oreilly.com/catalog/errata.csp?isbn=9781098107024 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Modern Mainframe Development, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the author, and do not represent the publisher’s views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. This work is part of a collaboration between O’Reilly and BMC. See our statement of editorial independ‐ ence.
Page
7
Table of Contents Foreword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Part I. Fundamentals of the Mainframe 1. Why Be a Mainframe Developer?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Fear of Disruption 4 Software Is Eating the World 5 COVID-19 7 Government Modernization 8 Future of Mainframe Development 9 Career Opportunities 10 Conclusion 11 2. World of the Mainframe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 What Does “Mainframe” Mean Anyway? 14 A Brief History 14 What Are Punch Cards? 15 Growth of the Mainframe 15 Mainframe Innovation 18 The Terminal 18 Mainframe Challenges 19 Why Have a Mainframe? 20 The OS 21 z/VSE 22 z/TPF 23 iii
Page
8
z/VM 23 Linux 23 KVM 24 Processor Architecture 24 LPAR 24 Disks 25 Batch and Online Transaction Processing 26 Mainframe Trends 27 The Mainframe “Shop” 27 Conclusion 28 3. The Development Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Accessing a Mainframe 29 TSO 32 ISPF 32 Datasets 34 Main Types of Datasets 35 Sequential File 35 Partitioned Dataset 35 Virtual Storage Access Method 36 Catalogs 37 ISPF and Datasets 38 Creating a File with ISPF 40 System Display and Search Facility 44 Job Control Language 46 Unix System Services 48 Mainframe Tools 48 Modern IDEs 49 IBM Developer for z/OS 49 BMC Compuware Topaz Workbench 50 Che4z 50 Visual Studio Code 51 Standardizing on Visual Studio 56 Simple IDEs 57 Web-Based Editors 57 Development Process 58 Conclusion 59 4. The COBOL Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 COBOL’s Background, in Brief 61 COBOL Versions 62 Why Use COBOL? 63 iv | Table of Contents
Page
9
COBOL Program Structure: Columns 64 COBOL Program Structure: Divisions 65 IDENTIFICATION DIVISION 66 ENVIRONMENT DIVISION 66 DATA DIVISION 67 PROCEDURE DIVISION 73 Conclusion 88 5. File Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Records and Files 89 Sequential File 90 File Errors 94 WRITE to a File 95 JCL for File-Handling Programs 96 Inventory Update Program 98 File with Multiple Records 102 Variable-Length Records 104 Indexed Files 106 Updating an Indexed File 108 VSAM Files 110 Conclusion 113 6. COBOL Tables and Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Introduction to Tables 115 Tables and Reading Files 118 Multilevel Tables 120 Indexes 124 Searching a Table 124 Binary Search 128 Reports 129 The PROCEDURE DIVISION for Reports 132 Testing a Report 132 Reporting Tools 133 Working with Characters and Strings 134 STRING 136 UNSTRING 137 INSPECT 139 Conclusion 140 7. Other Languages and Programming Techniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 What Language to Use? 141 Assembler Language 142 Table of Contents | v
Page
10
Memory 143 Registers 145 Base Displacement Addressing 146 Sample Assembler Language Code 147 Java 147 C and C++ 148 PL/I 149 CLIST and REXX 150 REXX Variables 151 REXX Comparisons 152 Control Structures 153 Calling Functions 155 Arrays 157 Object-Oriented COBOL 158 Programming Techniques 158 Copy Member 159 Subprograms 160 Conclusion 161 8. Databases and Transaction Managers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Information Management System 163 IMS Database Manager 165 IMS Transaction Manager 167 IMS Services and Tools 168 IMS Programming Language 170 Db2 and the Relational Database 173 Benefits of Relational Databases 175 Using Db2 176 Structured Query Language 178 Joins 180 Database Administrator 181 Application Development with Db2 182 Db2 Ecosystem 184 Customer Information Control System 185 Working with the CICS Platform 186 Programming in CICS 187 Conclusion 189 vi | Table of Contents
Page
11
Part II. Modern Topics 9. DevOps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Advantages of DevOps 193 Waterfall Method Model 195 Agile Method 196 Scrum 198 Kanban 199 Lean 201 Agile: It’s Not All About Speed 202 Mainframes and the Challenges for DevOps 203 DevOps Best Practices 204 Configuration Management 205 Issues with DevOps 207 Metrics 208 Mainframe DevOps Tooling 208 Automation 209 CI/CD 210 Zowe 213 BMC Jenkins Plug-ins 215 Zigi 219 Conclusion 222 10. Artificial Intelligence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 What Is AI? 224 Why Use AI? 225 Downsides of AI 226 Machine Learning 228 Binary Classification 229 Multiclass Classification 230 Multilabel Classification 230 Imbalanced Classification 230 Types of Machine Learning 230 Supervised Learning 231 Unsupervised Learning 231 Reinforcement Learning 232 Deep Learning 233 Data 234 Big Data 235 Data Management 236 Log Data 238 Data Wrangling 239 Table of Contents | vii
Page
12
The AI Process 241 Accuracy 243 An AI Demo 244 AI on Z 247 AIOps 248 Conclusion 249 11. Robotic Process Automation, and Low-Code and No-Code Systems. . . . . . . . . . . . . . 251 What Is RPA? 252 The Disadvantages of RPA 254 Macros, Scripts, and APIs 254 Types of RPA 255 Process Methodologies 256 RPA Roles 257 Evaluating RPA Software 258 Process Mining 259 How to Create a Bot 261 Creating a UiPath Bot 261 Creating a Bot for the Mainframe 266 RPA Issues with Mainframes 268 Low-Code and No-Code Systems 269 Conclusion 271 12. Mainframe Modernization Strategies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Why Modernize? 273 Using a Hybrid Cloud 275 Setting Goals 276 Encapsulating 278 Rehosting or Replatforming 278 Refactoring or Rearchitecting 279 Replacing or Rebuilding 281 Working with the Hyperscalers 282 Amazon Web Services 283 Microsoft 284 Google Cloud 286 Automation Tools 287 Heirloom Computing 288 EvolveWare 289 Advanced’s Automated COBOL Refactoring 290 Astadia 290 Data Migration 290 Conclusion 291 viii | Table of Contents
Page
13
13. The Future. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 Innovation of the Mainframe 293 Enterprise Integration 295 The Hybrid Model 297 Mainframe as a Service 298 Conclusion 299 Additional Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 Table of Contents | ix
Page
14
(This page has no text content)
Page
15
Foreword For over 60 years, the mainframe has been the system of record for leading busi‐ nesses, governmental agencies, and institutions of learning. Today, the vast majority of the world’s largest banks, insurance companies, airlines, and retailers continue to rely on the mainframe. If you’ve shopped, planned a vacation, or done banking online or through a mobile app, your transaction was almost certainly processed by a mainframe. The mainframe’s reliability, consistency, security, and performance have cemented its role as the workhorse of the digital economy, and reliance on the platform shows no signs of letting up. In fact, 92% of respondents to the 2021 BMC Mainframe Survey see it as a platform for long-term growth. As new technologies arise and demand for better, faster services and applications intensifies, the mainframe continues to evolve to meet changing market needs and power innovation. The programming environment has advanced from punched cards to ISPF green screens to modern integrated development environments in which developers can edit, debug, and deploy source code from one interface. Meanwhile, modern develop‐ ment solutions have enabled the use of automation throughout the software delivery life cycle and opened the mainframe to integration with cross-platform development tools, monitoring and security software, and modern frontend applications. These advanced automation capabilities and an “open-borders” approach go hand in hand with increased adoption of DevOps and Agile development on the platform. Modern processes, and the tools that support them, help increase the quality of applications and the speed and efficiency with which they are developed. In short, it is an exciting time for the mainframe, as it continues to build upon its reputation of reliability, security, and scalability and expand its integration with other platforms in support of continuous innovation. This bright future also presents wonderful career opportunities on the mainframe. DevOps and Agile development open the door to greater collaboration with develop‐ ers on other platforms, spurring the creation of applications and services that have xi
Page
16
the potential to change the digital landscape. Modern tools and an ever-expanding list of cross-platform integrations enable developers to do meaningful work on the platform that drives the world economy. Across a wide range of industries and organizations, from financial services to medical, insurance, retail, and the public sector, the need for skilled mainframe developers is boundless. In this book, Tom Taulli introduces the mainframe and the systems behind it, cover‐ ing the history of the platform, its unique role in the modern digital economy, and the architecture, processes, and people that make it such a powerhouse. In exploring its most commonly used programming language (COBOL) and examining database and transaction management on the platform, Tom provides the foundation upon which readers can build a working knowledge of mainframe development. Modern Mainframe Development serves as a valuable overview of the platform’s his‐ tory and future while also thoroughly explaining its systems and processes. As experi‐ enced mainframe developers retire, taking with them decades of accrued knowledge, and the industry shifts toward a new generation of mainframe professionals, the importance of this resource cannot be overstated. I hope that you, the reader, will use this book to lay the groundwork for further exploration of the platform and the opportunities it presents. Once you’ve experi‐ enced its power and capability for innovation, I’m confident you’ll develop the same passion for the mainframe that has inspired my career. — John McKenny Senior vice president and general manager Intelligent Z Optimization and Transformation at BMC xii | Foreword
Page
17
Preface Digital transformation is the main driver for global enterprises. According to soft‐ ware company ServiceNow, businesses will spend a staggering $7.4 trillion on digital transformation during the next three years. A key reason is that larger enterprises need to remain competitive and relevant. Otherwise, relentless disruption will occur. Yet true digital transformation does not mean ripping out mainframes and other legacy systems. This would be extremely expensive and risky. Besides, mainframes have major advantages. They can process huge amounts of information and allow for highly secure processing, which are essential for large enterprises. Many of these transactions are mission-critical, such as those for banking, insurance, and energy. In the years ahead, the main strategy for digital transformation will be to pursue a hybrid approach. Traditional mainframes and applications will integrate with modern systems. Developers will need to have a solid understanding of mainframe architec‐ tures and ecosystems. This will allow for creating systems that get results and make an impact on the organization. What’s Covered The topic of mainframe development is expansive. To help readers better understand this, I divided the book into two parts: Part I This part covers traditional aspects of mainframe development. We’ll delve into details of the COBOL language as well as how to run programs with Job Control Language (JCL). We’ll also look at the main databases for the mainframe—Db2 and IMS—as well as CICS transaction systems. The book then covers traditional tools for development, such as ISPF and TSO. xiii
Page
18
Part II Since mainframes run many critical operations for businesses, these machines have become increasingly important for next-generation technologies. So this book looks at categories including artificial intelligence, DevOps, and robotic process automation. We’ll also cover various strategies for migrating mainframe environments to cloud platforms. These approaches are still in the early phases but represent great opportunities for developers. Who Is This Book For? The book is focused at the beginner level. The good news is that mainframe devel‐ opment concepts are not necessarily complicated—although they can be somewhat tedious. In light of this, the book’s intended audience includes the following: Newbie Someone who does not have much technical experience but is looking at a new career as a mainframe developer. This book provides the fundamentals. Experienced developer Someone who has a background in Java, Python, or another language. This book highlights the major differences between these modern languages and those for the mainframe (like COBOL). Systems programmer Someone who works on configuration but may not understand how mainframe development works. This book is a helpful guide for someone who wants to make a transition to being a coder. Mainframe developer Since the book covers many areas, even experienced developers can glean insights from it. Business manager Some chapters provide nontechnical content about mainframes (Chapter 2), languages (Chapter 4), and emerging trends like DevOps (Chapter 9), artificial intelligence (Chapter 10), robotic process automation (Chapter 11), and main‐ frame modernization strategies (Chapter 12). The Approach to This Book Mainframe topics can be dry. The coding can easily become wordy, and lots of configuration is required. However, I have tried to spice up the material by using real-life use cases, fun facts, and humor. I have also interviewed numerous executives, founders, and experts at companies like BMC, Broadcom, IBM, Rocket Software, Model9, Heirloom Computing, and Advanced, just to name a few. xiv | Preface
Page
19
Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. Constant width bold Shows commands or other text that should be typed literally by the user. Constant width italic Shows text that should be replaced with user-supplied values or by values deter‐ mined by context. This element signifies a general note. Using Code Examples Supplemental material (code examples, exercises, etc.) is available for download at https://oreil.ly/modern-mainframe-development-code. If you have a technical question or a problem using the code examples, please send email to bookquestions@oreilly.com. This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. Preface | xv
Page
20
We appreciate, but generally do not require, attribution. An attribution usu‐ ally includes the title, author, publisher, and ISBN. For example: “Modern Mainframe Development by Tom Taulli (O’Reilly). Copyright 2022 Tom Taulli, 978-1-098-10702-4.” If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. O’Reilly Online Learning For more than 40 years, O’Reilly Media has provided technol‐ ogy and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit https://oreilly.com. How to Contact Us Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) 707-829-0515 (international or local) 707-829-0104 (fax) We have a web page for this book, where we list errata, examples, and any addi‐ tional information. You can access this page at https://oreil.ly/modern-mainframe- development. Email bookquestions@oreilly.com to comment or ask technical questions about this book. For news and information about our books and courses, visit https://oreilly.com. Find us on Facebook: https://facebook.com/oreilly Follow us on Twitter: https://twitter.com/oreillymedia Watch us on YouTube: https://www.youtube.com/oreillymedia xvi | Preface