IBM Software Group: Enterprise COBOL Education Using Rational Developer For System Z z/OS Terms and Concepts
IBM Software Group: Enterprise COBOL Education Using Rational Developer For System Z z/OS Terms and Concepts
This information is based on current IBM product plans and strategy, which are
subject to change by IBM without notice. Product release dates and/or capabilities
referenced in these materials may change at any time at IBM’s sole discretion based
on market opportunities or other factors, and are not intended to be a commitment to
future product or feature availability in any way.
IBM, the IBM logo, the on-demand business logo, Rational, the Rational logo, and
other IBM Rational products and services are trademarks or registered trademarks of
the International Business Machines Corporation, in the United States, other
countries or both. Other company, product, or service names may be trademarks or
service marks of others.
2
Course Contributing Authors
Thanks to the following individuals, for assisting with this course:
David Myers/IBM, Ka Yin Lam/IBM,
3
Purpose of This Document
Course Name: COBOL Foundation Training - with RDz
Course Description: Learn the COBOL language, RDz and learn z/OS terms, concepts and development skills in this course.
Pre-requisites: Some experience in a 3rd or 4th Generation Language is expected. SQL is also recommended.
Topics (Agenda)
Getting Started - installing and configuring RDz - and the course materials, and using Eclipse to edit COBOL
z/OS Terms and Concepts
COBOL General Language Rules
Basic COBOL Statements
Data records and table handling
Debugging Programs - Note: Deep dive on using RDz for common COBOL programming errors (001, 0C4, 0C7, infinite loops, fall-thru, etc.)
Input/Output and Report Writing Patterns
Sequential File Match/Merge Patterns
COBOL Subprograms and the Linkage Section
Structured Programming Concepts and Coding Patterns
Advanced Character Manipulation, COBOL Intrinsic Functions, Date and Time coding patterns, and Language Environment calls
OS/390 Concepts and JCL
Compile/Link & Run Procs on the mainframe
Indexed file Coding Patterns
Sort/Merge and Master File Update Coding Patterns
Accessing DB2 Data and Stored Procedures
COBOL in the Real World:
– CICS - lecture only
– IMS (DL/I and TM) - ditto
– Batch processing - ditto
– Java calling COBOL
– COBOL and XML Statements
– SOA and COBOL - creating and calling Web Services
– Web 2.0 using Rich UI
4
Course Details
Audience
This course is designed for application developers who have programmed in
some language before, and who wish to learn COBOL.
Prerequisites
This course assumes that the student has the basic knowledge of IS
technologies, data processing, software and have programmed for at least
two or more years in a language such as: Java, VB, RPG, PL/1, Pascal, or
some 4th Generation Language or tool.
Knowledge of SQL (Structured Query Language) for database access is
assumed as well.
Basic PC and mouse-driven development skills is also assumed.
Finally, it is assumed that you have been following along in this course, and
have successfully completed the learning modules in sequence.
Or have the equivalent COBOL background obtained through some other form of
COBOL study or on-the-job work.
5
UNIT z/OS Terms and Concepts
Topics:
z/OS Hardware Terms and Concepts
Appendices
6
Topic objectives
After completing this topic, you should be able to:
Describe the characteristics and define the following IBM hardware:
Mainframes
3390 disk packs
LPARs
EBCDIC
Multi-tier environments
7
Why Learn About the z/OS?
1. Very difficult to re-engineer the (up to 40 years of) production business functionality
running on a mainframe (generally not cost-efficient & risky)
2. What they do for I/T shops – they do extremely well (proven & reliable):
Large-scale capacity – by every standard of measurement:
Support for 1,000s, 10,000s, 100,000s concurrent users
100,000s 1,000,000s TPS (transactions per/second)
Hosting for dozens/hundreds of databases/files, measured in terabytes
High-speed/secure/stable network access
Able to support mixed environments and workloads.
One box often hosts:
OLTP (On-Line Transaction Processing), Batch processing, Ad-hoc processing
Several testing regions
Multiple logical (virtual) "machines" split from single box
Even runs multiple operating systems concurrently (z/OS, Linux, z/VM)
Extremely stable/secure production environment:
If a mainframe box goes down once/per year it's unusual
Recovery and data integrity mechanisms unparalleled
Efficient, self-regulating operating system:
Slicing/Prioritizing CPU cycles flexible, simple, cost-effective MIPS
Prior generation names:
OS/390, s/390 (system 390) …. s/370 (system 370), MVS (Multiple Virtual Storage)
8
Terms and Concepts – Hardware
9
Logical Partition – LPAR
LPARs are the equivalent of a separate mainframe for most practical purposes
Each LPAR runs its own operating system
Devices can be shared across several LPARs
Processors can be dedicated or shared
When shared each LPAR is assigned a number of logical processors (up to the
maximum number of physical processors) and a weighting
Each LPAR is independent
LPARs
CPU CPU Physical Processors CPU CPU
READ WRITE
z/10
Main Memory
10
Disk Devices
IBM 3990
channels
Control Unit
11
EBCDIC
The IBM S/360 through to
the latest zSeries
machines use the
Extended Binary Coded
Decimal Interchange
character set for most
purposes
This was developed
before ASCII and is also
an 8 bit character set
z/OS Web Server stores
ASCII data as most
browsers run on PCs
which expect ASCII data
UNICODE is used for
JAVA on the latest
machines
12
Modern Multi-Tier Mainframe Systems
Browser
Database
Client
Server
Client
Appendices
14
Topic objectives
After completing this topic, you should be able to:
Describe the characteristics and define the following IBM software terms and
concepts:
z/OS and mainframe operating system software
Batch processing
Online applications
– Transactions
– BMS
– MFS
Mainframe file and database systems:
– VSAM/QSAM files
– DL/I (IMS) databases
– DB2 databases
Mainframe development software (traditional)
– Tools
– Development process
– Procedural languages
15
Terms and Concepts – Operating Systems
Mainframe Description Network/PC Equivalent
======== ====================================================== ======================
z/OS Latest mainframe operating system UNIX/Linux/Windows XP
"z" refers to 64-bit addressing "z-architecture" – z/OS is "Self-optimizing,
Self-configuring and Self-healing". z/OS supports Java (6), XML, DB2,
TCP/IP and can host the Linux operating system as running task.
MVS Mainframe operating system during late 70's, 80's early 90's Win95
Multiple Virtual Storage – virtually partition real storage to allow
for multiple applications – all with access to max addressable memory
z/VM Latest operating system for mid-size mainframes. VM (per se') is prior
generation of this O.S. development tools under VM include:
CMS (same as TSO) and Xedit (similar to ISPF/Edit).
VSE/ESA Operating system for small mainframes. Its predecessor was DOS/VSE.
JCL Job Control Language – a language for specifying the properties Korn shell scripts
and characteristics of batch application "jobs". .CMD files
Jobs are the basic unit of work to the mainframe operating system.
16
Traditional "Online" …vs… "Batch" Applications
Mainframe Description Network/PC Equivalent
======== ======================================================= ===================
Online Access to production applications and data from connected 3270 terminals WebSphere, Tomcat…
is done through Online systems. Characteristics: extremely high throughput, sub-second response-
time, limited data access, mix of Read/Only, Insert, Update, Delete. Access from 3270 devices to the
mainframe in is traditionally through VTAM (especially if running under SNA). Today's Online
systems often connect web pages to back-office resources.
Batch Access to production applications and data offline (after 7:00 PM) UNIX Korn Shell, .cmd files
is done through Batch systems. Characteristics: extremely high volume (process from 100,000s to
1,000,000s of transactions in a single job. The "job" is the unit of work, defined by JCL (Job Control
Language) and consists of dozens to 100s of individual programs linked together to process data.
Online
Online z/OS
Applications
Online Batch
Applications and Offline (batch)
Online Applications Batch
Jobs
Batch Files and
Files and z/10 Job
Jobs Databases
Databases CICS or IMS TM
17
z/OS Online Application Systems
Mainframe Description Network/PC Equivalent
======== ======================================================= ===================
C.I.C.S. Customer Information Control System. IBM's oldest teleprocessing monitor. WebSphere, Tomcat…
Runs as a job under the operating system. Coordinates all resources necessary for secure units of
work (transactions) – two-phase commit across multiple data sources, etc. Screens defined with BMS
maps. Other resources defined to C.I.C.S. system tables through RDO (Resource Definitions Online)
Note that screens for z/OS 3270. Screens for I/Series (AS/400) 5250
C.I.C.S. IMS/TM
C.I.C.S. IMS/TM
Application
C.I.C.S. z/OS Applications
IMS/TM
DB2 Application Applications DB2
Application and z/10 Application
DL/I DL/I
VSAM CICS Region IMS TM Region GSAM
18
Traditional Batch Processing Software
Mainframe Description Network/PC Equivalent
======== ======================================================= ===================
Tivoli Production (and Integration/Q.A. test) Job Scheduler (J.E.S.) Embarcadero
CA-7 Automates production control over: job queues, security, priority, scheduling,
schedule Ids, job (pre and post) processing requirements, documentation
Ad Hoc TSO/ISPF has facilities to create (edit) and submit JCL jobs. Korn Shell, .cmd file
Both in the background (running under the control of the Job initiator and queues) and
in the foreground (running under TSO itself – almost like dedicated online process).
REXX execs and CLISTs (same as .cmd files) can also be executed in the TSO foreground for various
reasons (usually utilities like copy/delete files, etc.)
Queue JES
JCL JOBs
Batch JOB
Jobs Initiator(s)
Batch
z/OS
Job
and box Batch
Offline (batch) Tivoli REXX execs
Files and
Jobs CA-7 CLISTs
Databases
19
Databases – DB2
Mainframe Description Network/PC Equivalent
======== ==================================================== =====================
DB2 IBM's flagship relational DBMS. Has close to 100% market share Oracle, SQLServer, etc.
on the mainframe (no significant competitors on z/xxx machines).
- Most concepts and standards of PC/UNIX relational databases apply to DB2
(tables, rows, indexes, views, stored procedures, etc.)
- DBA-level (physical) structures very different (as they are with most RDBMS products (see below)
- And on the mainframe, almost all access to data is done through static "plans" which are
bound SQL statements stored in the DB2 Catalog. DB2 supports Stored Procedures & dynamic SQL
DB2
Application Program
Database – logical artifact Catalog
…
Tablespace – physical artifact Plan Exec SQL
Plan Call 'plan'
Plan
Table Table Index …
System Tables
End-Exec.
20
Databases – IMS
Mainframe Description Network/PC Equivalent
======== ==================================================== ====================
IMS-DL/I IBM's hierarchical DBMS. Data is stored in inverted tree structures called ISAM (indexed) files
"segments". Note that IMS/ESA has two components (IMS/DB and IMS/TM – formerly IMS/DC)
- The segments (and their relationships) are defined with in a proprietary specification block (file)
known as a DBD (Data Base Descriptor).
- Applications access IMS databases through an application view defined in a specification known as a
PSB (Program Specification Block) – which is composed of 1-Many PCBs (Program Communications
Block). Each PCB is a view a single database segment. Access to IMS databases is through a call
interface (Call using format – similar to method calls passing parameters and returning data).
- IMS database technology is also referred to as: IMS DB … and DL/1 (Data Language 1 – which is
like SQL for accessing IMS databases. DL/1 (or DL/I) is a complex and sophisticated language (read
difficult) language. The business semantics of most IMS databases is shared between the
application program's DL/1 logic (sequenced access calls) and the data per se'.
23
Traditional Development Environment
Mainframe Description Network/PC Equivalent
======== ==================================================== ====================
TSO Time Sharing Option. Basically, a "job" that runs under z/OS responsible UNIX/Windows O.S.
for managing program development resources (files, Login, jobs, etc.)
ISPF Interactive Systems Programming Facility. Each individual developer's custom RDz
Development IDE, that allows programmers to: Create new source files and manage them.
- Edit source and data files, interact with common version control software,
compile/link/run/test programs (usually by submitting background "jobs")
through JCL – but often shops provide "foreground" (interactive) facilities for this common process.
- Developers are allowed a [relatively] wide margin to customize their own unique environments.
- And shops almost always created "system software" tools that snap-in to ISPF – maintaining
standards, raising productivity, and providing easier access to in-house functions – often written
in REXX or CLIST language.
- Sometimes called: SPF (for short). C.A. offers a similar facility, named: ROSCOE.
Version Many different competing version control and "library management" facilities ClearCase
Control Available on the mainframe. They all do (roughly) the same thing. Most shops use:
Software CA-Endevor, Serena-Changeman, IBM-SCLM, CA-Panvalet, CA-Librarian
24
Terms and Concepts – TSO/ISPF Development
ISPF "Main Menu" of
development options
ISPF
Utility
Allocate
Dataset
(file)
http://publibz.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ISPZEM00/CONTENTS?SHELF=&DT=20001109114810#3.1.19
25
Terms and Concepts – Compile/Link/Run Environment
26
Development File Types - Introduction
In a development environment, there are two
file types:
Files that hold application source
Files that hold application data
Both are created (allocated) using some form
of z/OS Job
JCL Utility program
ISPF panel – which creates and submits JCL as
a foreground task
Files are usually referred to as Data Sets –
and are allocated on a disk pack with a
volume serial number – that uniquely
identifies the disk in the LPAR
27
Programming Languages
Mainframe Description Network/PC Equivalent
======== ==================================================== ====================
COBOL Common Business Oriented Language BASIC
- A 50+ year-old language, that is still being heavily invested in – although not nearly at
the same rate it was, during the 60's, 70's and 80's (or even 90's). COBOL is an English-like
wordy language. That is optimal for applications with long shelf-lives – due to it's verbose (I.e.
easy-to-read) nature, universality, and it's run-time optimization.
- COBOL programs have a DATA DIVISION – analogous to a class's attributes, and a
PROCEDURE DIVISION – analogous to a class's methods.
- Data structures and files are defined through what are called copybooks – which describe the
individual fields and field definitions (data format, etc.). Copybooks are downloaded and become
RRD classes, when accessed through our mainframe integration technology.
RPG Report Program Generator. A high-level 3GL – used extensively on the Power i BASIC
Java/C/C++ All of these languages have compilers and tools available on z/OS Java/C/C++
28
Software – Programming Languages – "Hello World" Comparison
000100 IDENTIFICATION DIVISION. HELLOPRT START 0 IN THE BEGINNING...
000200 PROGRAM-ID. HELLOWORLD. PRINT NOGEN SPARE US THE MACRO EXPANSIONS
BEGIN SAVE (14,12) SAVE INPUT REGISTERS
000300*
LR 12,15 WHERE ARE WE?
000400 ENVIRONMENT DIVISION. USING HELLOPRT,12 RIGHT HERE
000500 CONFIGURATION SECTION. ST 13,SAVE+4 SAVE OLD SAVE AREA ADDRESS
000600 SOURCE-COMPUTER. IBM-COBOL. LA 11,SAVE POINT TO NEW SAVE AREA
000700 OBJECT-COMPUTER. IBM-COBOL. ST 11,8(13) IN OLD SAVE AREA
LR 13,11 MOVE SAVE AREA ADDRESS
000800
*
000900 DATA DIVISION. * WRITE "HELLO, WORLD!" ON WHATEVER HAS BEEN SET UP AS SYSPRINT
001000 FILE SECTION. IN
001100 * THE INVOKING JCL (NO, UNIX DOESN'T HAVE A MONOPOLY ON DEVICE-
001200 PROCEDURE DIVISION. * INDEPENDENT I/O!)
*
001300 DISPLAY "Hello world!".
DOPUT EQU *
001400 STOP RUN. PUT SYSPRINT,HELLOMSG WRITE THE MESSAGE
B DOPUT FOREVER...
COBOL program *
* THIS CODE WILL NEVER BE REACHED, BUT IS INCLUDED FOR
COMPLETENESS
*
L 13,SAVE+4 GET OLD SAVE AREA BACK
RETURN (14,12),RC=0 TO THE OPERATING SYSTEM
*
* FILE AND WORK AREA DEFINITIONS
*
HELLO: PROCEDURE OPTIONS (MAIN); SAVE DS 18F LOCAL SAVE AREA
HELLOMSG DC C' HELLO, WORLD!'
/* A PROGRAM TO OUTPUT HELLO WORLD */
SYSPRINT DCB DSORG=PS,MACRF=PM,DDNAME=SYSPRINT,
FLAG = 0; LOOP: X
DO WHILE (FLAG = 0); RECFM=FA,LRECL=133,BLKSIZE=133
END BEGIN HLASM program
PUT SKIP DATA('HELLO WORLD!');
END LOOP;
END HELLO; PL/I program
29
z/OS Links and
Here are some links for additional study on mainframe software terms and
concepts:
http://publib.boulder.ibm.com/infocenter/zos/basics/index.jsp
An excellent set of organized categories of info – that backstop a lot of the material in this
Unit
http://en.wikipedia.org/wiki/Z/OS
What can we say… it's Wikipedia
http://www.trainersfriend.com/Papers/Future_of_Mainframe.pdf
A somewhat advanced but excellent next-level-down dive on the technology terms and
concepts in this Unit
http://www-03.ibm.com/systems/z/destinationz/
IBM's site for mainframe – and z/topic communities
Knowledge
30
UNIT z/OS Terms and Concepts
Topics:
Hardware Terms and Concepts
Appendices
31
Topic objectives
After completing this topic, you should be able to:
Describe how COBOL programs:
Are executed at run-time by operating system
Attach to and read/write data from external data
Interface with other business logic
32
Review – Online and Batch
Recall from the previous slide that there are two "modes" of z/OS
applications:
Batch: Where "Jobs" are executed through "JCL" (Job Control Language) cards that are
read and understood by z/OS
//EXEC PGM=MYPROG,…
J LOADLIB
//JOB JOBNAME=MYJOB,…
E z/OS Compiled
Programs
JCL S
Online: Where transactions ("trancodes") are entered into a z/OS sub-system that "listens"
for them. These sub-systems (either IMS/TM or CICS) are responsible for:
– Security – ensuring authentication and authorization from those entering the TRANCODE and
connecting to the online system
– Attaching the proper initial process (COBOL program) responsible for handling the transaction
– More…
C
LOADLIB
TRANCODE
I
C
z/OS Compiled
Online
Programs
S
33
Batch Processing (only slightly) Deeper Dive
There are only a few places in a batch COBOL program that interface with
z/OS. It's easiest to understand by studying a little (!) JCL
JCL is an operating system language that has three major keywords (aka "cards")
35
COBOL and Online Transactions
Online applications run under the supervision of a transaction management system (in z/OS
either: CICS or IMS TM).
The transaction manager connects to a series of system tables with entries defined for
resources necessary to fulfill run-time transaction requests:
C I
I M
TRANCODE C
S
S z/OS
T
M
Appendices
37
z/OS – COBOL Java - Equivalence Chart
Mainframe/COBOL/z/OS I-Net/Java
=================================== ===============================================
Program field or variable Class or Local method Attribute
Paragraph Method
Program (source) Class Definition (.java file)
Load Module (.EXE file) Compiled Class (.class file)
Execute or run a Load Module Object instance of a Class, running in Java/VM
Load Modules in a Load Library Classes defined in Packages
Program passed/returned parameters Method passed/returned parameters
JCL .cmd/.shell script (UNIX)
Requirements-Based Vocabulary(OO COBOL) User Defined Datatype (Class)
REDEFINES clause Class and Datatype Casting/conversion
Program/sub-routine calls Java method calls
Call to System/Utility program Java or NeuVis API method calls
RDBMS/Database RDBMS/Database
Table Persisted Class data
Table row Single object persisted data
SQL statement/Stored Procedure same … but all dynamic SQL using JDBC
CICS/IMS DC Application Server
BMS Map/MFS Java Servlet/HTML Page
CICS Queue/IMS DC Scratch Pad EJB Session Object
CICS In/Out Maps, IMS MFS MID/MOD EJB Request/Response Objects
38