3 Course Contributing Authors Thanks to the following individuals, for assisting with this course:David Myers/IBM, Ka Yin Lam/IBM,
4 Purpose of This Document Course Name: COBOL Foundation Training - with RDzCourse 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.Course Length: 10 daysTopics (Agenda)Getting Started - installing and configuring RDz - and the course materials, and using Eclipse to edit COBOLz/OS Terms and ConceptsCOBOL General Language RulesBasic COBOL StatementsData records and table handlingDebugging 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 PatternsSequential File Match/Merge PatternsCOBOL Subprograms and the Linkage SectionStructured Programming Concepts and Coding PatternsAdvanced Character Manipulation, COBOL Intrinsic Functions, Date and Time coding patterns, and Language Environment callsOS/390 Concepts and JCLCompile/Link & Run Procs on the mainframeIndexed file Coding PatternsSort/Merge and Master File Update Coding PatternsAccessing DB2 Data and Stored ProceduresCOBOL in the Real World:CICS - lecture onlyIMS (DL/I and TM) - dittoBatch processing - dittoJava calling COBOLCOBOL and XML StatementsSOA and COBOL - creating and calling Web ServicesWeb 2.0 using Rich UI
5 Course Details Audience Prerequisites This course is designed for application developers who have programmed in some language before, and who wish to learn COBOL.PrerequisitesThis 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.
6 z/OS Terms and Concepts UNITz/OS Terms and ConceptsTopics:z/OS Hardware Terms and Conceptsz/OS Software Terms and ConceptsCOBOL and z/OS IntegrationAppendices
7 Topic objectives After completing this topic, you should be able to: Describe the characteristics and define the following IBM hardware:Mainframes3390 disk packsLPARsEBCDICMulti-tier environments
8 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 users100,000s 1,000,000s TPS (transactions per/second)Hosting for dozens/hundreds of databases/files, measured in terabytesHigh-speed/secure/stable network accessAble to support mixed environments and workloads.One box often hosts:OLTP (On-Line Transaction Processing), Batch processing, Ad-hoc processingSeveral testing regionsMultiple logical (virtual) "machines" split from single boxEven 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 unusualRecovery and data integrity mechanisms unparalleledEfficient, self-regulating operating system:Slicing/Prioritizing CPU cycles flexible, simple, cost-effective MIPSPrior generation names:OS/390, s/390 (system 390) …. s/370 (system 370), MVS (Multiple Virtual Storage)So why don't they just reverse engineer all that old COBOL hoo-haa and rewrite it in Java? Well, that's just not very easy. There are no automated language translators, and the amount of code that runs these production systems is in the trillions of lines (Gartner) world-wide. Single programs that contain between 20,000 and 50,000 lines of code (not size, lines-of-code) are not atypical. Ford Motor Company runs 50,000 (fifty thousand) batch COBOL jobs every night. Each job is composed of between 5 and 20 steps. Each step is a "load module" (linked programs) that number between 1,000 and 50,000 lines of code. You do the math.And before you run off thinking that this is simply the product of sloppy, poorly-designed and structured development, think again. These are the primary business rules that run the world's corporations. The rules are complex (that's why 6th graders aren't coding them). And, over time (as in 30+ years) the rules change – the code gets maintained, and the inevitable result is complexity that makes eBusiness applications look like "See Spot Run" reading primers.There are many other reasons for "why mainframes" – as described. Basically, think "economies of scale".
9 Terms and Concepts – Hardware IBM z/10 seriesIBM s/90 G5/G6Smallest workloadsIBM z/990 seriesIBM z/Series 800(Linux) - smaller workloadsIBM z/900 series"The zSeries is the enterprise class e-business server optimized for integration, transactions and data of the next generation e-business world."IBM i/900 seriesMid-range MainframeFormerly: AS/400So, here are the current crop of IBM mainframe boxes. They are almost all air-cooled, and extremely powerful. Note that there are two basic machines shown: z/xxx series – capable of running the new x/64-bit operating system, and I/xxx series – which is the contemporary version of the AS/400 machines. iSeries (old AS/400 … OS/400) - comes with DB2/400, MQ Series, DataQ support can call RPG programs (roughly 90% of AS/400 applications use the RPG programming language. Currently not supported in native RRD mode – but soon to be added)The IBM TotalStorage Enterprise Storage Server (ESS) Model 800Capacity up to 56 Terabytes (that's 5,600 Gigabytes)Prior generation of technology names: DASD (Direct Access Storage Device
10 Logical Partition – LPAR LPARs are the equivalent of a separate mainframe for most practical purposesEach LPAR runs its own operating systemDevices can be shared across several LPARsProcessors can be dedicated or sharedWhen shared each LPAR is assigned a number of logical processors (up to the maximum number of physical processors) and a weightingEach LPAR is independentDevelopmentz/OSTestz/OSProductionz/OS…LinuxLinuxLinuxMany installations used to have several boxesA single larger machines running many LPARs is often more cost effective, as software licenses for multiple small machines can total more than those for a single large oneLPARsCPUPhysical ProcessorsCPUCPUCPUREADWRITEz/10Main Memory
11 Disk Devices Current mainframes use 3390 disk devices The original configuration was simple with a controller connected to the processor and strings of devices attached to the back endThe DS8000 Enterprise Storage Server is a device that can manage disk devicesIt emulates a large number of control units and 3390 disks. It can also be partitioned and connect to UNIX and other systems as SCSI devices.There are 11/196 Terra-bytes of disk space up to 32 channel interfaces, 16/256 Giga-bytes cache and 284/Mega-Bytes of non-volatile memory
12 EBCDICThe IBM S/360 through to the latest zSeries machines use the Extended Binary Coded Decimal Interchange character set for most purposesThis was developed before ASCII and is also an 8 bit character setz/OS Web Server stores ASCII data as most browsers run on PCs which expect ASCII dataUNICODE is used for JAVA on the latest machines
13 Modern Multi-Tier Mainframe Systems Client TierMiddle TierEnterprise TierBusiness Application ServerBrowser ClientLegacy SystemsPresentation LogicBusiness ObjectsBrowser ClientDatabase ServerThe middle tier employs a component based architectureThe middle tier responsibilities include:Business objectsBusiness application logicPresentation content generationOther middleware servicesConnection pooling, data caching, etc.FrameworksJava EE.NETClientSee Slide Notes
14 z/OS Terms and Concepts UNITz/OS Terms and ConceptsTopics:Hardware Terms and Conceptsz/OS Software Terms and ConceptsCOBOL Program and z/OS IntegrationAppendices
15 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 softwareBatch processingOnline applicationsTransactionsBMSMFSMainframe file and database systems:VSAM/QSAM filesDL/I (IMS) databasesDB2 databasesMainframe development software (traditional)ToolsDevelopment processProcedural languages
16 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.OS/390 Previous generation mainframe operating system Windows NT Win98MVS Mainframe operating system during late 70's, 80's early 90's Win95Multiple Virtual Storage – virtually partition real storage to allowfor multiple applications – all with access to max addressable memoryz/VM Latest operating system for mid-size mainframes. VM (per se') is priorgeneration 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.TSO Time Sharing Option – an operating system within z/OSTSO provides time slicing (access to mainframe cycles) fordevelopers coding, compiling, testing, etc.JCL Job Control Language – a language for specifying the properties Korn shell scriptsand characteristics of batch application "jobs" CMD filesJobs are the basic unit of work to the mainframe operating system.The z/OS is the latest version of IBM's mainframe operating system. 64-bit addressing, and built-in (native) support for many eBusiness technologies. This operating system was called OS/390 before z/OS was introduced… and before that MVS. MVS was IBM's break-through technology of the late 70's/80's – that multi-tasked, and provided 32-bit addressing to applications by utilizing disk storage as extended memory – no matter the size or amount of real memory.Not shown on this slide is Workload Manager – a piece of Systems Software that monitors groups of servers (I.e. mainframes), managing the machines, and moving work between them with the aid of human administrators, but based on pre-defined performance goals. Workload Manager is required for certain types of current RRD mainframe access.z/VM is a smaller version of z/OS – used often for development machines, as it is more efficient with memory and resources for developers (without providing the high level of throughput z/OS is famous for. VM/CMS machines are used in many (especially smaller) shops for development. Instead of TSO/ISPF development tools (an upcoming topic) VM/CMS uses Xedit and more of a command line interface.VSE/ESA is an even smaller version of z/OS – without the z/64-bit capability – and typically used for even smaller boxes. TSO is like an operating system within an Operating System. However, it is used almost exclusively for developers who are building and maintaining applications.JCL is not an operating system, but a language that z/OS understands. It is used to initiate tasks through what are called Jobs – basically a unit-of-work that extends through an entire cycle of processing.
17 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 themainframe in is traditionally through VTAM (especially if running under SNA). Today's Onlinesystems often connect web pages to back-office resources.Batch Access to production applications and data offline (after 7:00 PM) UNIX Korn Shell, .cmd filesis done through Batch systems. Characteristics: extremely high volume (process from 100,000s to1,000,000s of transactions in a single job. The "job" is the unit of work, defined by JCL (Job ControlLanguage) and consists of dozens to 100s of individual programs linked together to process data.Online Systems–Teleprocessing Region(s)Batch Region(s) Development3270 usersTSO usersIn the mainframe world there are two basic types of applications: Online and Batch.Online applications that execute under one of two teleprocessing software packages (C.I.C.S. - or IMS/TM) – sometimes referred to as supervisor programs, because they have the ultimate responsibility for data and transactional integrity.Batch applications that are submitted as "background" jobs to the operating system. z/OS queues and executes these jobs based on their priority (and other classifications) – and constraints (resources available, etc.). Batch applications provide no real-time human interaction (they are strictly static, offline processing jobs, submitted via JCL with the only dynamic feature being a parameter (PARM) that can be passed into the job steps)VTAM (Virtual Telecommunications Access Method – VTAM is an IBM proprietary API that controls communications in an SNA (Systems Network Architecture) network.Note that, online applications (and all the resources they require – including files and database) are often dedicated (allocated to) the online region (and by definition not available to batch jobs). This has changed over the past decade, and it is now more common to find database and file sharing among online and batch processes (in spite of the potential problems of contention, lock-out and poor response time).Most mainframe shops have enormous batch systems – that process in the millions to billions of data records each night – and prepare the online databases for customer-facing work, from 7:00 – 7:00 each day.Note that each online region is a "job" to the mainframe. And additionally, each Batch region – including TSO is a "job" as well.VTAMJCL JOBsOnline ResourceAdaptorsOnlineApplicationsOffline (batch)Files andDatabasesOnlineApplicationsz/OSandz/10OnlineFiles andDatabasesOnlineApplicationsBatchJobsBatchJobBatchJobsCICS or IMS TM
18 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 ofwork (transactions) – two-phase commit across multiple data sources, etc. Screens defined with BMSmaps. Other resources defined to C.I.C.S. system tables through RDO (Resource Definitions Online)Note that screens for z/OS Screens for I/Series (AS/400) 5250IMS/TM Information Management System/Transaction Manager. IBM's dedicated WebSphere, Tomcat… IMS TP monitor. Same functionality as C.I.C.S. – but different product. No application programaccess to native VSAM files (directly). Typically installed in "IMS shops". TP calls through 'CBLTDLI'interface.Web/REST services havefound their way into themix as well – in accessingonline data and processC.I.C.S. Region(s)IMS/TM Region(s)BMS Maps3270 – MFS MapsAs mentioned, there are basically two options for production Online systems --- CICS and IMS/TM. Fortune 1000 shops may have both installed, but typically you'll find one or the other in any given area – as the application programming skill-set, vocabulary and expertise is different (and deep) enough to warrant it.C.I.C.S. has over 70% of the IBM online market, but IMS/TM applications tend to be [significantly] bigger, and the largest (and oldest I/T) shops often use IMS/TM, because they are users of IMS/DB (the database element of the IMS package). The programming environment is similar within the IMS family.Note that C.I.C.S. screens are referred to as "maps" – more specifically as B.M.S. maps (Basic Mapping Support). These maps are source file definitions for where fields and literals are placed on the 3270 terminal – as well as how Program Function (PF) Keys are mapped (back, forward, end, refresh, enter, etc.)In the IMS/TM world, screens are referred to as MFS maps (or blocks). Similar to BMS, MFS describes physical and logical characteristics of how data is mapped to screens and then to file structures for use as parameters into and out of application programs.Products to look out for (next generation RRD)CICS/ECI – Java/JCA connector passes data-streams/COMMAREACICS/EPI - access API pass 3270-screens back and forthVTAMVTAMCICS Transaction GatewayIMS ConnectC.I.C.S.ApplicationIMS/TMApplicationsC.I.C.S.ApplicationIMS/TMApplicationsDB2DL/IVSAMDB2DL/IGSAMC.I.C.S.Applicationz/OSand z/10IMS/TMApplicationCICS RegionIMS TM Region
19 Traditional Batch Processing Software Mainframe Description Network/PC Equivalent======== ======================================================= ===================Tivoli Production (and Integration/Q.A. test) Job Scheduler (J.E.S.) EmbarcaderoCA-7 Automates production control over: job queues, security, priority, scheduling,schedule Ids, job (pre and post) processing requirements, documentationAd Hoc TSO/ISPF has facilities to create (edit) and submit JCL jobs Korn Shell, .cmd fileBoth in the background (running under the control of the Job initiator and queues) andin 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 variousreasons (usually utilities like copy/delete files, etc.)Batch Region(s) Development SubsystemJESQueueTSO/ISPF usersIn the batch programming world there is development (including various testing regions – I've seen up to 7 separate defined regions for testing in an application development area) and production.All jobs that run under z/OS are submitted via JCL (recall previous slide). The JCL job (see example below) describes the resources required the job (files, programs, etc.) – as well as the steps and sequence of the programs to executed. TSO/ISPF usually has both a panel and command line interface to compiling programs.Tivoli (IBM) and CA-7 (C.A.) are two of the most popular mainframe production job schedulers. They provide a higher level view of production jobs, tracking their workflow and providing statistics and management reporting. Jobs are still executed using JCL:Sample JCL//job card//** **//** This sample connects LOADTESR **//** send 2k byte data (total data is 40Mbyte)//** release LOADTESR **//** QUIT **//LOADTEST EXEC PGM=IBMCOBOL,REGION=1M,PARM='10CBLTESR'//** step name is loadtester's ID//** PARM='LUname'//* a=5(512byte data)//* 1(1kbyte data)//* 2(2kbyte data)//* 4(4kbyte data)//* b=not used//* LUname=LOAD Tester Receive ApplID//STEPLIB DD DSN=LOADTEST.LINKLIB,DISP=SHR//SYSUDUMP DD SYSOUT=*//SYSPRINT DD SYSOUT=*//JCL JOBsJESJOBInitiator(s)BatchJobsBatchJobz/OSand boxOffline (batch)Files andDatabasesTivoliCA-7REXX execsCLISTsBatchJobs
20 Databases – DB2 DB2 Application Program Database – logical artifact 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 arebound SQL statements stored in the DB2 Catalog. DB2 supports Stored Procedures & dynamic SQLDB2DB2 is IBM's RDBMS – or more accurately, it is a family of RDBMS products – each of which has its own unique SQL dialect. As described, mainframe DB2 is pretty much an old-fashioned AT&T style monopoly of RDBMS product (there are probably a handful of Oracle/mainframe shops world-wide, compared to thousands of DB2 shops). However, (and in spite of some relatively hard-nosed selling over the past 20+ years), not every IBM mainframe shop will have DB2. This is significant, as DB2 is required for the RDD native mainframe access software to work.For [much] more information on DB2, go to this url:Application ProgramDatabase – logical artifactCatalog…Exec SQLCall 'plan'End-Exec.Tablespace – physical artifactPlanPlanPlanTableTableIndexSystem Tables
21 Databases – IMS Other IMS technology to look out for: 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 aPSB (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 callinterface (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 (readdifficult) language. The business semantics of most IMS databases is shared between theapplication program's DL/1 logic (sequenced access calls) and the data per se'.IMS/DB is a 35 year old product (!!) that was one of the very first commercially-successful databases. It is basically a career-deep technology (I.e. mastery requires years, not months or weeks.What is important to understand about IMS databases is that the data per se' is often meaningless – without going through the process (where the "rules" about the data exist). In other words, the structures (especially in older databases) are often not normalized. And merely exposing the an IMS database segment to the Web may not be buying much.Other IMS technology to look out for:IMS Java – next generation of Java interface to IMS DB and IMS/TMIMS connect - listens to TCP/IP provides JCA connector support for IMS/TMFor much more in IMS, go to this site:From this site, see these articles: IMS Concepts and Database Administration - Part 3A high-level overview of IMS database concepts, terminology, and database design considerations.IMS Concepts and Database Administration - Part IIMS Concepts and Database Administration - Part 2Or, see attached HTML files that are tutorial and overview in nature.SuppliersPartsAddressPurchaseOrdersIMS Application Program…Call 'CBLTDLI'USING SUPP-PCB,IO-AREA,DB-SSA.
22 Files and Databases – VSAM Mainframe Description Network/PC Equivalent======== ========================================================= ===================VSAM IBM's foundation data storage system. Basically comprised of indexed ISAM (indexed) filesfiles – and applications and system utilities that access the indexed data.- Access is either direct (through primary key), sequential (read until condition),or through secondary index file (similar to a WHERE clause).- Syntax/access to VSAM (Virtual Storage Access Method) files in most IBM languages is throughdirect statements: OPEN INPUT file, check status… READ file, check status. OPEN OUTPUT FILE…UPDATE file, INSERT into file, CLOSE file. (native language access – not Call Interface).- The business semantics of almost all VSAM files is shared between the application program's dataaccess logic (sequenced calls) and the data per se'.VSAM Application ProgramVSAM provides efficient/fast keyed and alternate index access to data. The same caveats apply about VSAM as discussed about IMS (it is typically semantically poor information, in and of itself – and the meaning of the data is mainly realized through application access – which reads/writes records in a particular sequence.Products to look out for (next generation RRD):VSAM Java – a direct Java/JCA connection to mainframe VSAM filesFor much more in VSAM, go to this site:Suppliers…OPEN input SUPPLIER-FILEif SUPPLIER-STATUS = '00' subtract APPL-RESULT from APPL-RESULTelse add 12 to ZERO giving APPL-RESULT end-ifSecondaryIndex FileSupplierZip Codes
23 Files and Databases – Other Mainframe Description Network/PC Equivalent======== ==================================================== ====================QSAM Queued Sequential Access Management (aka "flat" files) Sequential files…Non-indexed files that hold (almost always) batch data for bulk processing. Often historical data,back-ups and image-copy data.IDMS Non-IBM proprietary files in "network/CODASYL" data model Indexed files…Originally offered by Cullinane software (Boston). Later purchased by Computer Associates.Many large Fortune 1000 IDMS users. IDMS-ADSO (CICS for IDMS)ADABAS Non-IBM proprietary files in "indexed/table" data model Indexed files…Originally offered by SoftwareAG, ADABAS has a large install base (especially in U.S. governmentand state offices. Coupled with the Natural programming language (a COBOL-like 3GL) there arestill lots of ADABAS installations. Natural/Adabas. EGL – Natural EGL Migration.There are other databases and file systems running on most mainframes, besides DB2, IMS and VSAM.For much more in IDMS, go to this site:For much more in ADABAS, go to this site: EBCDIC …vs… ASCII - internal data storage format It is worth noting that virtually all mainframe data is internally stored using in EBCDIC format.This means that some software will have to translate bytes transmitted, between mainframe/PCIt also means that (text) data sorted on the mainframe will sort in a different order on the PC
24 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 RDzDevelopment 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 – maintainingstandards, raising productivity, and providing easier access to in-house functions – often writtenin 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 ClearCaseControl Available on the mainframe. They all do (roughly) the same thing. Most shops use:Software CA-Endevor, Serena-Changeman, IBM-SCLM, CA-Panvalet, CA-LibrarianThe development tools on the mainframe are panel-driven. Developers fill in parameters on an interactive panel (see next slide) – and press Enter to activate some function (submit a job to the Operating System, navigate to a tool, etc.)There actually is a CUA (mouse-windows) interface to ISPF – but it is somewhat of a kludge (it's a bit cumbersome and slow) – and few developers utilize it. Basically, they get very fast using shortcuts, customizing their ISPF options (which are like preferences), and utilizing a shop's unique and often dizzying array of in-house developed system utilities and functions.
25 Terms and Concepts – TSO/ISPF Development ISPF "Main Menu" ofdevelopment optionsISPF Edit (of JCL file)ISPFUtilityAllocateDataset(file)A peek at ISPF panels.
26 Terms and Concepts – Compile/Link/Run Environment Source ModuleJES ReaderSimilar to C, C++, and other 3 and 4GLs…Source is compiled to to .OBJ (machine code)Errors are returned to the JES reader (usually visible through an option under TSO)The .OBJ format of the program is linked to a "load module" by the Link Editor – which resolves all external references and callsThe Load Module is reference in JCL – by naming the entry point of the initial program to be launched (like main() in Java)Object ModuleLoad ModuleThe development cycle or process is the same on the mainframe as it is for virtually every other language. Ultimately, compiles must be submitted to the operating system as jobs – but many shops provide "foreground" cycles to do this, as it saves developer time.//EXEC PGM=LoadModule…
27 Development File Types - Introduction In a development environment, there are two file types:Files that hold application sourceFiles that hold application dataBoth are created (allocated) using some form of z/OS JobJCL Utility programISPF panel – which creates and submits JCL as a foreground taskFiles 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 LPARApplication source files:Partitioned Data Set (PDS)A collection of like-type sequential files: COBOL, JCL, CLIST.Individual files are termed "members" of the PDS – which is the "Data Set"You can almost think of them as: records (individual members) within an array (the PDS Data Set)Sequential Data SetIndividual files – can be used for: Test data (QSAM data sets), source files (not typically, but possible),ExecutablesA specialized form of the PDS is a Load Library – which is a PDS that contains "Load Modules"Each Load Module is the compiled and linked version of program sourceTest Data SetsMany and varied types:Fixed sequentialVariable Length SequentialPrint filesLoad librariesPartitioned Data SetsSpace is allocated typically in disk pack:TracksCylindersRecords within a file:Have a length - LRECLAre aggregated into "blocks" – which become the unit of I/O transferBLKSIZE
28 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 atthe same rate it was, during the 60's, 70's and 80's (or even 90's). COBOL is an English-likewordy 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 theindividual fields and field definitions (data format, etc.). Copybooks are downloaded and becomeRRD classes, when accessed through our mainframe integration technology.HLASM High Level Assembler AssemblerHigh Level Assembler is an IBM licensed program that helps you develop programsand subroutines to provide functions not typically provided by other symboliclanguages, such as COBOL, FORTRAN, and PL/I.PL/I An elegant, 3rd generation, imperative, structured programming language BASICUsed a lot in scientific and financial shops. Not as universal as COBOL.RPG Report Program Generator. A high-level 3GL – used extensively on the Power i BASICJava/C/C++ All of these languages have compilers and tools available on z/OS Java/C/C++For much more in COBOL go to this site:
29 Software – Programming Languages – "Hello World" Comparison IDENTIFICATION DIVISION.PROGRAM-ID. HELLOWORLD.000300*ENVIRONMENT DIVISION.CONFIGURATION SECTION.SOURCE-COMPUTER. IBM-COBOL.OBJECT-COMPUTER. IBM-COBOL.000800DATA DIVISION.FILE SECTION.001100PROCEDURE DIVISION.DISPLAY "Hello world!".STOP RUN.HELLOPRT START IN THE BEGINNING...PRINT NOGEN SPARE US THE MACRO EXPANSIONSBEGIN SAVE (14,12) SAVE INPUT REGISTERSLR 12, WHERE ARE WE?USING HELLOPRT, RIGHT HEREST 13,SAVE SAVE OLD SAVE AREA ADDRESSLA 11,SAVE POINT TO NEW SAVE AREAST 11,8(13) IN OLD SAVE AREALR 13, MOVE SAVE AREA ADDRESS** WRITE "HELLO, WORLD!" ON WHATEVER HAS BEEN SET UP AS SYSPRINT IN* THE INVOKING JCL (NO, UNIX DOESN'T HAVE A MONOPOLY ON DEVICE-* INDEPENDENT I/O!)DOPUT EQU *PUT SYSPRINT,HELLOMSG WRITE THE MESSAGEB DOPUT FOREVER...* THIS CODE WILL NEVER BE REACHED, BUT IS INCLUDED FOR COMPLETENESSL ,SAVE GET OLD SAVE AREA BACKRETURN (14,12),RC= TO THE OPERATING SYSTEM* FILE AND WORK AREA DEFINITIONSSAVE DS 18F LOCAL SAVE AREAHELLOMSG DC C' HELLO, WORLD!'SYSPRINT DCB DSORG=PS,MACRF=PM,DDNAME=SYSPRINT, XRECFM=FA,LRECL=133,BLKSIZE=133END BEGINCOBOL programFor an interesting look at over 100 language "Hello World" programs, visit this site: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;HLASM programPL/I program
30 z/OS Links and Knowledge Here are some links for additional study on mainframe software terms and concepts:An excellent set of organized categories of info – that backstop a lot of the material in this UnitWhat can we say… it's WikipediaA somewhat advanced but excellent next-level-down dive on the technology terms and concepts in this UnitIBM's site for mainframe – and z/topic communitiesKnowledge
31 z/OS Terms and Concepts UNITz/OS Terms and ConceptsTopics:Hardware Terms and Conceptsz/OS Software Terms and ConceptsCOBOL Program and z/OS IntegrationAppendices
32 Topic objectives After completing this topic, you should be able to: Describe how COBOL programs:Are executed at run-time by operating systemAttach to and read/write data from external dataInterface with other business logic
33 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/OSOnline: 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 systemAttaching the proper initial process (COBOL program) responsible for handling the transactionMore…LOADLIBCompiledPrograms//EXEC PGM=MYPROG,…z/OSJES//JOB JOBNAME=MYJOB,…JCLLOADLIBCompiledOnlineProgramsCISz/OSTRANCODE
34 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 (!) JCLJCL is an operating system language that has three major keywords (aka "cards")//JOBname JOB – describes the characteristics of the batch job, including how much CPU time it is allowed. Note that the TIME= parameter will kill programs in infinite loops (although it won't solve your coding problem )//JOBname JOB,…,TIME=(1)//Stepname EXEC – tells z/OS what program to execute (like main in Java or C/C++)//STEPLIB – tells z/OS the name of the library to search for the compiled programLOADLIBCompiledPrograms//STEPNAME EXEC PGM=MYPROG,// PARM=AABBCC,…//STEPLIB DD DSN=MYLOADLIB//DDName – DD statement. Connects your program's I/O statements with z/OS datasets.DSN= "fully-qualifies" the name of the dataset (so z/OS can find it)Your program needs one //DD statement for every file it accesses. And where's the hook for that? (next slide…)Datasetz/OSQSAM, VSAMDL/I files//DDName DD DSN=MY.zOS.FILE,...// …dataset characteristics…Note – there's a LOT more to JCL. We'll cover it later onin the course, when you get to hit the mainframe.
35 COBOL and BatchIn COBOL – every QSAM and VSAM file you access will need a "SELECT/ASSIGN" statement – that essentially defines a "logical" external file name which must have a matching //DD card in the JCL that runs your code. See the pictures below.//MYFILE - is the logical file name that connects the COBOL program's I/O statements (internal file variable name) to …DSN=ABC.MYFILE – which is the physical (external) filename that lives on a 3990 disk pack attached z/OS//MYFILE DD DSN=ABC.MYFILE,...// …dataset characteristics…
36 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 II MC SSTMz/OSTRANCODECICS or IMS "System Tables"Terminals (LTERM)Device IDs allowed to hit the online regionUsers (User-ID/Password)Authentication/AuthorizationTrancode (transaction code)List of actual trancodes, and which program to load and execute for each trancodeFile (or database)Entry that acts like a batch DD card, and defines which files can be accessed online…Many other control block definitions are needed to support a production online transaction system
37 z/OS Terms and Concepts UNITz/OS Terms and ConceptsTopics:Hardware Terms and Conceptsz/OS Software Terms and ConceptsCOBOL Program and z/OS IntegrationAppendices
38 z/OS – COBOL Java - Equivalence Chart Mainframe/COBOL/z/OS I-Net/Java=================================== ===============================================Program field or variable Class or Local method AttributeParagraph MethodProgram (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/VMLoad Modules in a Load Library Classes defined in PackagesProgram passed/returned parameters Method passed/returned parametersJCL cmd/.shell script (UNIX)Requirements-Based Vocabulary(OO COBOL) User Defined Datatype (Class)REDEFINES clause Class and Datatype Casting/conversionProgram/sub-routine calls Java method callsCall to System/Utility program Java or NeuVis API method callsRDBMS/Database RDBMS/DatabaseTable Persisted Class dataTable row Single object persisted dataSQL statement/Stored Procedure same … but all dynamic SQL using JDBCCICS/IMS DC Application ServerBMS Map/MFS Java Servlet/HTML PageCICS Queue/IMS DC Scratch Pad EJB Session ObjectCICS In/Out Maps, IMS MFS MID/MOD EJB Request/Response Objects