Linux Picture

A Backgrounder on MainFrames for Linux users
or a 3 minute intro to MainFrames


Anthony Barker

December 21, 2003

I recently saw a display of operating systems in use by a major financial company which spends several billion a year on IT. They currently have 10 operating systems in use: Tandem, OS/390/ AIX, HP/UX, Windows etc. They play to shrink that down to 3: Linux, zOS and Windows. This lead me to thinking, well I know a fair amount about 2 of those three operating systems. But what about the third?

Traveling to the land of the Mainframe is like a journey to another continent where all your assumptions may be wrong. There is a whole new vocabulary - DASD, LPARS and so forth.
This is an older culture, a land where sysadmins still miss the days when they wore white lab coats. Coming from windows or Linux your first impression is - where is all the documentation? Windows is just as proprietary as zOS but there is a ton of 3rd party information that is available on the web or from books. Where is the zOS for dummies? Welcome to the IBM MainFrame - where everything is technically excellent and very complex.

Why does zOS or Linux on the IBM 390 matter? Two words - I/O bandwidth for databases and Uptime. No other hardware platform offers Linux so much in these two areas.

The main part of understanding a new system is getting to know the vocabularly. So I'll focus on that. Please note - I am not an expert and wrote this for my own information. Corrections are appreciated!


HARDWARE

MainFrame computers are designed for extremely high reliability and high volumes of I/O (data throughput). Total I/O throughput capacity of the current z900 mainframes is no less than 24GB per second and uptime of a Parallel Sysplex close to 100% within 6 decimal places.

In IBM MainFrames each CPU die contains two complete execution pipelines that execute each instruction simultaneously. If the results of the two pipelines are not identical, the CPU state is regressed, and the instruction retried. If the retry again fails, the original CPU state is saved, and a spare CPU is activated and loaded with the saved state data. This CPU now resumes the work that was being performed by the failed chip. Memory chips, memory busses, I/O channels, power supplies, etc. all are either redundant in design, or have corresponding spares which can be can be put into use dynamically. Some of these failures may cause some marginal loss in performance, but they will not cause the failure of any unit of work in the system.

Parallel Sysplex, is a clustering technology which allows up to 32 systems to be operated as a single system image. Any work that was being performed on the failed system can be automatically restarted on a surviving system. One (or more) system(s) can be removed from the Sysplex for hardware/software maintenance (for instance during off-hours), while the remaining systems continue processing the workload. When the maintenance activity has been completed the system(s) can then be brought back into the Sysplex. One of the ways this can be exploited is the ability to upgrade the software levels on the entire Sysplex (one system at a time), without ever causing any application outage.

Most components are hot swappable; even microcode updates can often be installed while the system is running with the exception of CPUs.
IBM sells MainFrames with the spare CPUs that can be turned on later (for a hefty charge).

DASD is an acronym for "Direct Access Storage Device" aka disk storage. It acts kind of like a SAN in Windows/Linux/Unix- A single DASD can be in use by many systems concurrently. Storage in the MainFrame world refers to Memory typically.


OPERATING SYSTEMS(s)
z/OS is the latest version of S/390 operating system that runs on IBM's new z/900 servers.

LPAR (Logical Partition) is a type of virtual machine implemented by PR/SM (Processor Resource/System Manager) a hardware/firmware feature on all recent mainframes. Think of it as VMWare with complete isolation and hardware integration.

Think of Microsoft Wolfpack cluster or a Linux cluster with 2 machines and a heart beat cable. Software still takes time to fail over(15 seconds to 2 minutes). However with LPARs one session can be down and another restarted within a second or two.

A Linux for S/390 will run either on native hardware, e.g. LPAR (logical partition), or as a VM guest (virtual machine). Software has to be compiled to run on the MainFrame, you can't just use the x86 version that came precomipled with your distro.

OS/390 and z/OS have OpenEdition, which is the Unix part of the operating system. It uses HFS (hierarchical file system), which is more like the standard Unix file/directory system.

You'll usually see security handled by IBM's RACF, CA's ACF2, or CA's TopSecret.

APAR - Authorized Problem Analysis Reports - Bugs
IPL - perform an initial program load restart or /etc/init.d/appname start | reload
PTF - programming temporary fix fix pack or install a patch or update
control group and media policy - backup policy
ISPF (Interactive System Productivity Facility) is the user interface and supporting programs that come with IBM's OS/390 operating system and that allow a company to configure and manage its system, add new system or application programs and test them, and access system files (data sets). ISPF consists of the Dialog Manager (DM), the Program Development Facility (PDF), and the Software Configuration and Library Management (SCLM) facility.

CICS Customer Information Control System
an application server program of a type known as teleprocessing monitors. In effect, it provides a different environment to an application program than the base operating system, adding special functionality for interfacing with terminals, printers, etc. It also does a it's own dispatch scheduling, record level file sharing, memory management, terminal virtualization, security and a whole host of other things across a number of platforms, regardless of operating system, and virtualizes a whole load of operating system like functions. Some documentation is even starting to refer to the interface between the CICS program and applications running in it as the CICS API.


DATA

Data is stored in VSAM, DB2 and IMS/DB Databases.

VSAM - File Control
IMS - DL/1
DB2 - SQL


VSAM is an IBM *mainframe* implementation of an "indexed sequential access method" (aka ISAM). It is file based database like btreive or berkeley db.

DB2 is IBM Relational Database - similar to Oracle or Postgresql. It has a SQL interface

IMS/DB (Information Management System - Data Base) is a hierarchical database that is part of dates back to the late 1960's and represents data store underlying IMS/DB typically VSAM (Virtual Sequential Access Method). The API used is typically Data Language I (DL/I), There is no native SQL-based interface, and does not have a concept of procedures or triggers The data access API to IMS/DB is called DL/I, which is a function by which the IMS/DB the control of IMS/DB. Another API is DBCTL, which allows similar access to IMS/DB from CICS
transactions. A new API for IMS/DB access is called ODBA. It allows DL/I calls to IMS/DB to be invoked from any task running within the mainframe.

Also within IMS there are DEBS or "Fast Path Databases" which were originally created for Banking applications or other large db applications. There used to be an additional charge for this and it is good for batch jobs.

DL/I - Data Language / I: General purpose database control language.

VSAM record formats: fixed, variable, and spanned
VSAM supports a variety of data set organizations: ESDS, fixed-length RRDS, variable-length RRDS, KSDS, and LDS

Data is typically stored in EBCDIC format- which differs from ASCII or Unicode.
EBCDIC uses the full 8 bits available to it, so parity checking cannot be used on an 8 bit system. Also, EBCDIC has a wider range of control characters than ASCII. list of mappings.

Theoretically Postgresql and MySQL should work on a MainFrame under Linux. IBM is quietly porting their Websphere, DB2, and Lotus Domino products to Linux for the MainFrame.


PROGRAMMING

Programming on mainframes has been done in Assembler, C/C++, Cobol, Rexx, PL/1, and more recently Java. Python exists for OS390.


New development for internal company use is typically done directly in Websphere, a J2EE compliant Java server. Software vendors often use C/C++. Older apps will often be a series of COBOL programs and associated utilities with some COBOL programs running under CICS, the online transaction processing system (OLTP), to provide interactive OLTP services. Typically older applications use data stored in a VSAM database, newer ones in DB2. Other software investments might include JCL, FOCUS, EASYTRIEVE, and CoSORT programs.

Cobol

The COBOL language is a structured and powerful programming language for large-scale data processing. Micro Focus - has cobol for Linux on MainFrame. If you need to port an application from MainFrame to Linux (or Linux on a MainFrame) you probably should check out their tools.

A typical COBOL program consists of four divisions, which are subdivided into named sections and/or paragraphs. Paragraphs contain one or more statements. At least the last statement in each paragraph must end with a period.

IDENTIFICATION DIVISION
This division is used mostly for documentation. It specifyies the program name, author, date and other information.

ENVIRONMENT DIVISION
This division contains information linking the logical file and device names used in the program with their physical counterparts giving portability.

DATA DIVISION
This division contains definitions for all file, record, group and elementary item data-names, and initial values for elementary items.
All data-names referenced in the program must be defined in this division.

PROCEDURE DIVISION
The meat of the program (if statements, loops & gotos). All control and logical instructions for the program are contained in this division.

 

Hello World in Cobol:

000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "Hello world!" LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.


For converting applications to run in linux check out the Vancover utilities: http://www.uvsoftware.ca/


CICS is 30 year old software for managing transactions coming into a mainframe.
Transaction processing programs are written to execute under CICS.

It ensures transactions are:
Atomic - A unit of work that succeeds or fails.
Consistent - System restored to a constant state after completion.
Isolated - one transaction does not impact another, even if done at the same time.
Durable - A committed transaction is permanent.

CICS programs can be written in Assembler, Cobol, PL/1, Rexx, C/C++, Java

MainFrame jobs are written in JCL (job control language)(instead of bash or vbscript). The jobs are submitted to JES2 or JES3 (Job Entry System), which is the subsystem responsible for job control. Job Control Language (JCL) is very precise, one space missing an it might not run. It allows you to run programs and define data and comments.

Output of the executed jobs is often available from in a spool file.

VSAM Redirector Server is available and allows access to VSAM files from Linux on the MainFrame using Java.

Additional tools are often used for sorting and manipulating data such as: SortCL from CoSORT's

REXX is a scripting language which has a long history, It was created by Mike Cowlishaw of IBM between 1979 and 1982 and has a ANSI standard. It is used on the MainFrame and other areas.

Example:

DO I=1 BY 1 UNTIL Input=''
PARSE VAR Input Name.I'='Value.I'&'Input
Name.I=DeWeb(Name.I); Value.I=DeWeb(Value.I)
END I

DeWeb is a function to extract data from an HTML form.

Rexx for Linux
http://www-306.ibm.com/software/awdtools/obj-rexx/linux


Abend (a combining of two words, abnormal end, when operator messages were as short as possible) is an abnormal, rather than planned, end or termination of a computer program because of some problem with how it is running.


Often programmers use Screen Scrapping of 3270 terminals to manipulate data and present it to someone using a Web browser rather than change the underlying mainframe code.


PL/1

Developed as an IBM product in the mid 1960's, a

HELLO: PROCEDURE OPTIONS (MAIN);

/* A PROGRAM TO OUTPUT HELLO WORLD */
FLAG = 0;

LOOP: DO WHILE (FLAG = 0);
PUT SKIP DATA('HELLO WORLD!');
END LOOP;

END HELLO;

NETWORK

3270 - Pre PC era data was transfered from the MainFrames to Dumb Terminals or 3270 Terminals.These days users will often run 3270 emulator software. TN3270 acts much like a telnet session with additional function keys. There are two systems that allow access from Linux . One is known as tn3270, and the other is x3270. 3279 is color terminal.
http://www.linuxgazette.com/issue23/x3270.html

VTAM - Virtual Telecommunications Access Method.
Programs that use VTAM macro instructions are generally exchanging text strings (for example, online forms and the user's form input) and the most common interactive device used with VTAM programs is the 3270 Information Display System.


SNA - IBM's proprietary Networking Protocol