unisys Enterprise Database Server for ClearPath MCP Transaction Processing System (TPS) Programming Guide imagine it. done. ClearPath MCP 13.

Similar documents
unisys ClearPath Enterprise Servers Remote Database Backup Planning and Operations Guide ClearPath MCP 18.0 April

unisys Enterprise Database Server for ClearPath MCP Application Program Interfaces Programming Guide imagine it. done. ClearPath MCP 13.

unisys Clearpath Enterprise Servers ALGOL Compiler Messages Support Reference Manual ClearPath MCP 17.0 April

unisys Product Documentation Library CDLib Manager User s Guide Release Level April

Enterprise Output Manager. UCopyIt Guide UNISYS. ' 2017 Unisys Corporation. All rights reserved. Release 3.4a. Printed in USA.

Distributed Data Processing (DDP-PPC) DCA Interface C Language

unisys Agile Business Suite How to Install Visual Studio 2013 for AB Suite 5.0 Applies to: Developer 5.0

Distributed Data Processing (DDP-PPC) OSI Interface C Language

unisys Unisys Stealth(cloud) for Amazon Web Services Deployment Guide Release 2.0 May

IPS Remote Site Facility Module (VS 345-REM)

TCP/IP Application Services (TAS) Mail Processor

CROSSREF Manual. Tools and Utilities Library

Single Point Operations

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

CA IDMS Total Transparency

APPENDIX E SOLUTION TO CHAPTER SELF-TEST CHAPTER 1 TRUE-FALSE FILL-IN-THE-BLANKS

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

Chapter 1 INTRODUCTION. SYS-ED/ Computer Education Techniques, Inc.

IT 374 C# and Applications/ IT695 C# Data Structures

BASIC ELEMENTS OF A COMPUTER PROGRAM

Data Management System (DMS 2200) FORTRAN Data Manipulation Language (FDML)

UNISYS. Unisys Check Processing Enterprise Solutions. IPS/ICPS Software-Based CAR/LAR Release Notes. Release 4.0.0

Batch Versions Guide Release 9.2

CA Software Change Manager for Mainframe

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03

RETRIEVE Utility for MCP Systems

Arithmetic Operations

The PCAT Programming Language Reference Manual

Section 1. The essence of COBOL programming. Mike Murach & Associates

Decision Making using the IF Statement. Logical Control Structures

Change Management Implementation Guide Release 9.2

Copyright Network Management Forum

PRELIMINARY APPLE BASIC USERS MANUAL OCTOBER Apple Computer Company. 770 Welch Rd., Palo Alto, CA (415)

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

PracticeMaster Report Writer Guide

Tivoli Management Solution for Microsoft SQL. Rule Designer. Version 1.1

CA IDMS Using VSAM Transparency

Enterprise Output Manager

UNIT- 3 Introduction to C++

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

CA TPX Session Management

Lecture 2 Tao Wang 1

INFOIMAGE DESKTOP MANAGER

General Ledger 3000 Reference Manual Prophet 21 FASPAC 4.2

Procedure Definition Processor (PDP) Operations Reference Manual - Documentation Updates

Databridge Twin Administrator s Guide. Version 6.5

CA IDMS Schema Mapper

MATLIP: MATLAB-Like Language for Image Processing

Sun Microsystems, Inc Garcia Avenue Mountain View, CA U.S.A. SunOS Reference Manual

1 Lexical Considerations

REVIEW. The C++ Programming Language. CS 151 Review #2

Administrator's Guide Databridge Plus Guide. Version 6.5

Full file at

Bar Code Discovery. Administrator's Guide

easel LANGUAGE REFERENCE MANUAL

C++ Programming: From Problem Analysis to Program Design, Third Edition

DATA Step Debugger APPENDIX 3

Overview Guide. Mainframe Connect 15.0

SYSTEM 2000 Essentials

SPECIFICATION 2 STATEMENTS

User's Guide. Alpha Five Accounting. Accounting Made Easy. Version 3.0. Copyright BetaSoft LLC - All Rights Reserved

JME Language Reference Manual

Learning Language. Reference Manual. George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104)

9. Elementary Algebraic and Transcendental Scalar Functions

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

FRAC: Language Reference Manual

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

JD Edwards World. Electronic Burst and Bind Guide Release A9.3 E

Invoice Formatting Guide Release A9.4

InfoSphere Master Data Management Reference Data Management Hub Version 10 Release 0. User s Guide GI

Using Basic Formulas 4

unisys ClearPath Enterprise Servers TCP/IP for MCP v3 Networks Implementation and Operations Guide ClearPath MCP 18.0 April

Customizing Your SAS Session

Universal Companion Document Industry Adoption of X

Open VMS SUMSLP Utility Manual

unisys Distributed Processing Middleware Open Distributed Transaction Processing Messages imagine it. done. ClearPath OS 2200 Release 13.

2016 Autosoft, Inc. All rights reserved.

INTRODUCTION 1 AND REVIEW

3. Except for strings, double quotes, identifiers, and keywords, C++ ignores all white space.

Capital. Capital Logic Generative. v Student Workbook

Chapter 17. Fundamental Concepts Expressed in JavaScript

Chapter 2 SYSTEM OVERVIEW. SYS-ED/ Computer Education Techniques, Inc.

Printing Systems Division. Infoprint Manager for AIX NLV Release Notes

Tivoli Management Solution for Microsoft SQL. Statistics Builder. Version 1.1

DEPARTMENT OF MATHS, MJ COLLEGE

Table of Contents. Backing Up Files Getting Started. Installation of Open/A. Component for the A-Series Introduction Initial Installation

Regions Quick Deposit

Introduction. Getting Started with the Macro Facility CHAPTER 1

PeopleSoft 9.1 PeopleBook: Events and Notifications Framework

CMPT 125: Lecture 3 Data and Expressions

Siebel Application Deployment Manager Guide. Version 8.0, Rev. A April 2007

Full file at C How to Program, 6/e Multiple Choice Test Bank

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

Introduction to QuickCalc BASIC. QUICKCALC Sample Programs. QUICKCALC BASIC vs IBM BASIC. Note: Please read the User License Agreement, below.

Basics of Java Programming

)454 : 4(% #(!2!#4%2 3%4!.$ "!3)# %,%-%.43 -!.-!#().%,!.'5!'% )454 Recommendation : INTERNATIONAL TELECOMMUNICATION UNION

2 nd Week Lecture Notes

Sage Financial Reporter User's Guide

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

Transcription:

unisys imagine it. done. Enterprise Database Server for ClearPath MCP Transaction Processing System (TPS) Programming Guide ClearPath MCP 13.1 April 2011 8807 6138 004

NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related information described herein is only furnished pursuant and subject to the terms and conditions of a duly executed agreement to purchase or lease equipment or to license software. The only warranties made by Unisys, if any, with respect to the products described in this document are set forth in such agreement. Unisys cannot accept any financial or other responsibility that may be the result of your use of the information in this document or software material, including direct, special, or consequential damages. You should be very careful to ensure that the use of this information and/or software material complies with the laws, rules, and regulations of the jurisdictions with respect to which it is used. The information contained herein is subject to change without notice. Revisions may be issued to advise of such changes and/or additions. Notice to U.S. Government End Users: This is commercial computer software or hardware documentation developed at private expense. Use, reproduction, or disclosure by the Government is subject to the terms of Unisys standard commercial license for the products, and where applicable, the restricted/limited rights provisions of the contract data rights clauses. Unisys and ClearPath are registered trademarks of Unisys Corporation in the United States and other countries. All other brands and products referenced in this document are acknowledged to be the trademarks or registered trademarks of their respective holders.

Contents Section 1. Introduction Documentation Updates... 1 1 What s New?... 1 2 Overview... 1 2 Transactions and Transaction Records... 1 5 The Update Library... 1 6 The Transaction Library... 1 6 The Transaction Journals... 1 8 The Remote Library... 1 8 The HOSTINTERFACE Program... 1 10 TPS Software Components... 1 10 Section 2. Transaction Formatting Language (TFL) TFL Basic Constructs... 2 2 Character Set... 2 2 Digit... 2 2 Letter... 2 2 Comment... 2 3 Family Name... 2 3 Simple Identifier... 2 3 Integer... 2 4 Number... 2 4 Remark... 2 5 String... 2 5 Expression... 2 5 Arithmetic Expression... 2 6 Boolean Expression... 2 7 TFL Description of Transaction Base...2 8 Parameters... 2 10 Defaults... 2 12 Transaction Record Format... 2 13 Transaction Subbase... 2 15 Transaction Journal... 2 17 Items... 2 19 Alpha Item...2 22 Boolean Item... 2 24 Number Item... 2 24 Real Item... 2 25 Field Item... 2 26 Updating Transaction Bases...2 27 SYSTEM/TFL... 2 28 8807 6138 004 iii

Contents Input Files... 2 28 Compiler Control Options... 2 29 Section 3. User Language Interface to TPS Invoking the Transaction Base... 3 1 Declaring Transaction Record Variables... 3 2 Creating Transaction Records... 3 2 Accessing Transaction Record Items... 3 3 Transaction Record Control Items... 3 3 Transaction Compile-Time Functions... 3 6 Transaction Record Variables as Parameters... 3 7 Transaction Record Variable Assignment... 3 7 Transaction Record Use Restrictions... 3 8 Compiler Checks... 3 8 Section 4. Transaction Library Compiling the Transaction Library... 4 1 Library Initiation... 4 3 Defining the Transaction User... 4 8 Entry Points... 4 9 Transaction Library Diagnostic Messages... 4 16 TPS Statistics... 4 16 Section 5. Update Library Programming the Update Library... 5 1 Structuring the Update Library...5 3 Invoking the Entire Database Using a Single Library...5 3 Invoking Part of the Database Using a Single Library...5 3 Invoking Parts of the Database Using Multiple Libraries...5 5 Enterprise Database Server User Language Syntax for Transaction Processing... 5 6 BEGIN-, MID-, ENDTRANSACTION Statements... 5 6 OPEN Statement: TRUPDATE Option... 5 6 Database Consistency and Update Library Programming... 5 6 Using Two-Phase Transactions in Update Library Routines... 5 7 Characteristics of Two-Phase Transactions... 5 8 Alternatives to Two-Phase Transactions... 5 10 Making Update Library Routines Independent... 5 11 Structuring Update Library Routines... 5 12 Reproducibility... 5 12 Reproducibility Problems... 5 13 Avoiding Reproducibility Problems... 5 13 Importance of Two-Phase Programming... 5 14 iv 8807 6138 004

Contents Section 6. Remote Library and HOSTINTERFACE Compiling the Remote Library... 6 1 How the Remote Library Works... 6 4 Error Conditions... 6 5 Sample Remote Library Stack Configuration... 6 6 Section 7. Exception Handling Exception Reporting... 7 1 Fatal Errors... 7 2 Exceptions... 7 5 DMS Exception Handling... 7 11 Exception Handling Mechanism... 7 14 Section 8. Security Section 9. TPS Recovery Transaction Recovery Design Features... 9 2 Recovery after a Halt/Load... 9 3 Recovery after an Abort... 9 3 Recovery after Rebuild/Rollback or Initialization... 9 4 After Rebuild/Rollback... 9 4 After Reinitialization... 9 4 Restarting User-Written Programs... 9 5 Issuing Discontinue Commands to User-Written Programs... 9 5 Section 10. TRUTILITY Compiling TRUTILITY... 10 1 Running TRUTILITY... 10 3 TRUTILITY Statements... 10 3 INITIALIZE Statement... 10 4 SEARCH Statement... 10 4 USERS <user option>... 10 5 SELECT <tr options>... 10 6 RANGE <range options>... 10 8 RECOVERCF Statement... 10 9 CONTROLINFO Statement...10 11 Section 11. Converting to TPS Converting to Mixed Mode... 11 1 Mixed Mode Restrictions That Ensure Reproducibility... 11 2 Appendix A. A TFL Description of a Transaction Base 8807 6138 004 v

Contents Appendix B. SYSTEMTR Transaction Format Appendix C. Understanding Railroad Diagrams Railroad Diagram Concepts... C 1 Paths... C 1 Constants and Variables... C 2 Constraints... C 3 Vertical Bar... C 3 Percent Sign... C 3 Right Arrow... C 3 Required Item... C 4 User-Selected Item... C 4 Loop... C 5 Bridge... C 5 Following the Paths of a Railroad Diagram... C 6 Railroad Diagram Examples with Sample Input... C 7 Index... 1 vi 8807 6138 004

Figures 1 1. Conventional Enterprise Database Server Environment... 1 3 1 2. Converting to the TPS Environment... 1 4 1 3. TPS Naming Conventions... 1 7 1 4. Remote Real-Time Transaction Processing with TPS... 1 9 2 1. Generating the Description of a Transaction Base... 2 1 4 1. Compilation of the Transaction Library... 4 2 4 2. Stack Structure Resulting after Program P1 s First Call on a Transaction Library Entry Point... 4 4 4 3. Stack Structure Resulting after Program P2 s First Call on a Transaction Library Entry Point... 4 5 4 4. Stack Structure Resulting after Program P3 Is Initiated to Tank Transactions to the Transaction Journal TANKJOURNAL... 4 6 4 5. Stack Structure Resulting after Program P3 Invokes the TRHISTORY Transaction Journal... 4 7 6 1. Compilation of the Remote Library... 6 2 6 2. Compilation of the HOSTINTERFACE Program... 6 3 6 3. Typical Stack Configuration... 6 6 10 1. Compilation of the TRUTILITY Program... 10 2 8807 6138 004 vii

Figures viii 8807 6138 004

Tables 4 1. USEROPTION Parameter Values... 4 11 5 1. Function Flag Values... 5 2 7 1. Fatal Errors... 7 2 7 2. Fatal Errors Associated with the Accessroutines... 7 4 7 3. Category 1: 001 099 (Attention)... 7 5 7 4. Category 2: 100 199 (Remote-Host Interface)... 7 6 7 5. Category 3: 200 209 (Bad Parameter Values)... 7 6 7 6. Category 4: 300 399 (Function Not Permitted)... 7 7 7 7. Category 5: 400 499 (Transaction Rejected)... 7 9 7 8. Category 6: 500 599 (Transaction Failed)... 7 10 7 9. Category 7: 900 999 (Software/Hardware/Procedural)... 7 10 C 1. Elements of a Railroad Diagram... C 2 8807 6138 004 ix

Tables x 8807 6138 004

Section 1 Introduction Purpose The purpose of this guide is to describe the uses of the Transaction Processing System (TPS). Using TPS is an economical way to carry out a large volume of transactions against an Enterprise Database Server data base. TPS separates into modules the various functions needed to perform data base processing and provides you with a library of transaction processing procedures, thereby minimizing the amount of program coding and maintenance required. Audience and Scope This guide is intended primarily for experienced large-systems programmers who are using TPS with their Enterprise Database Server software. However, parts of the manual are useful to programmers who write programs that collect input and output data for specific transactions. Though not a tutorial, this manual gives details and examples for all essential areas of TPS use. You can obtain information on how to code TPS user-written programs from the appropriate language reference manual. Documentation Updates This document contains all the information that was available at the time of publication. Changes identified after release of this document are included in problem list entry (PLE) 18774321. To obtain a copy of the PLE, contact your Unisys representative or access the current PLE from the Unisys Product Support Web site: http://www.support.unisys.com/all/ple/18774321 Note: If you are not logged into the Product Support site, you will be asked to do so. 8807 6138 004 1 1

Introduction What s New? New or Revised Information Replaced all the references to DMSII with Enterprise Database Server. Removed references to Operations Control Manager. Removed Operations Control Manager appendix. Location Throughout the document. Throughout the document. Previously Appendix C. Overview For users of Enterprise Database Server software, the Transaction Processing System (TPS) provides improved methods for processing a high volume of transactions. TPS separates into modules the various functions needed to perform database processing and provides you with a library of transaction processing procedures, thereby minimizing the program coding and maintenance required. With TPS, coding programs that perform on-line collection of input and output data for specific transactions is less complicated than in a conventional Enterprise Database Server environment. It is not necessary to understand the structure of the database, nor how to program for interruptions in processing. Only one TPS module accesses the database, so that changes to the structure of the database usually do not affect other TPS modules. TPS keeps track of all input transactions that access the database. If an interruption in processing occurs, TPS determines which transactions have been processed against the database and which have not, and automatically resubmits transactions that have not yet been processed. In addition, TPS enables you to batch data for later processing, and to perform processing on a database that resides in a remote system. You can submit transactions to a centralized database from any number of remote systems in a data communications network, without having to rewrite any TPS programs. To summarize the main advantages of this product, using TPS Minimizes the amount of program coding and required maintenance. Eliminates much of the complexity that normally afflicts programming for database processing. Provides a central definition of all transactions to be performed against a database. Provides comprehensive recovery capabilities. Helps reduce your expenses in a number of other ways that are explained in later sections of this manual. 1 2 8807 6138 004

Introduction This section introduces the most basic components of TPS and explains how they interact. Figure 1 1 illustrates the conventional method of performing database processing, where a user-coded program communicates directly with the database through the standard Enterprise Database Server user language interface. TPS improves on the conventional method of database processing by partitioning the Enterprise Database Server user-written program into two logical pieces. One of these pieces is simply called the user-written program, and the other is a module containing routines that communicate directly with the database through the Enterprise Database Server user language interface. Figure 1 1. Conventional Enterprise Database Server Environment 8807 6138 004 1 3

Introduction Figure 1 2 illustrates the conversion of an existing Enterprise Database Server environment to a TPS environment, where the user-written program communicates only with TPS, which in turn communicates with the module that invokes the database. (The user-written program in Figure 1 2 does not invoke the database.) With TPS you can take advantage of special functions regarding recovery, automatic transaction reprocessing, and other features that are further explained in the following paragraphs. Figure 1 2. Converting to the TPS Environment 1 4 8807 6138 004

Introduction When developing a system that uses TPS, you must first define each update routine and inquiry routine to be performed against the database. You must also define each routine's input and output. A typical routine for a banking application might involve depositing a specified amount of money into a customer's account. For this routine, define the following three items: 1. The input data required by the routine, such as an account number and deposit amount. 2. The output data generated by the routine, such as an updated account balance. 3. The database manipulation required to perform the deposit. As shown in Figure 1 2, the user-written program collects and sends the input data to the module that invokes the database through TPS. Based on the input data, the module that invokes the database selects the appropriate database update or inquiry routine and performs the required action against the database. After completing the action, the routine sends the output data back to the user-written program through TPS. Transactions and Transaction Records In TPS terms, the following three entities are collectively referred to as a transaction: 1. The input data. 2. The routine that performs the desired processing against the database. 3. The output data. Usually, many transactions are defined for a single database, but all transactions are subject to the following four limitations: 1. A transaction should be a relatively small unit of processing, involving at most one action (update or inquiry, as explained in later sections of this manual) against the database. Therefore, a single transaction should not make sweeping changes to a database. 2. A transaction should not use any results of previous transactions, and should depend only on the state of the database and its input data. This is the only sense in which a transaction depends on previous transactions. 3. Each update transaction must be programmed to ensure its independence from all other transactions. 4. While TPS is being used to update a database, no conventional update programs can run (though a method is provided to ease this restriction when converting existing Enterprise Database Server update programs to use TPS). However, conventional inquiry programs can run in parallel with TPS. Limitations are described in greater detail in later sections of this manual. 8807 6138 004 1 5

Introduction In the TPS environment, the vehicle for sending the input data to the module that invokes the database and receiving the output data from this module is known as a transaction record. A transaction record is a structured variable that contains user-defined data items and system-defined control items. The user-defined data items are similar to the data items in an Enterprise Database Server data set record or a COBOL 01-level variable. To define the formats for the particular transaction records, a special language called the Transaction Formatting Language (TFL) is used. A format is a definition of the data items to be contained within a particular transaction record. The transaction record formats defined with TFL are processed by the TFL processor to produce a description file for the entire transaction base. (A transaction base includes the software and files that constitute a TPS interface to a database.) The Update Library To define the routines that perform database processing, use standard Enterprise Database Server user language statements. These routines are contained in the module that invokes the database. In the TPS environment, this module is known as the update library. After defining the update routines with user language statements, you can write update programs that communicate with these routines through TPS instead of updating the database directly. Because the database-knowledgeable code is isolated in the update library, user-written programs need only do the following: 1. Collect input data from terminals, files, or other input sources. 2. Assemble a transaction input record from the input data. 3. Access the appropriate routine in the update library. 4. Disassemble the transaction output record and send the result to a terminal, a file, a printer, or another appropriate medium. The Transaction Library To access an appropriate routine in the update library, user-written programs do not call the update library directly. Instead, they call procedures in the main software component of TPS, known as the transaction library. The transaction library is a collection of procedures or entry points that accept input transaction records for processing. You tailor the transaction library to suit particular processing needs by compiling a transaction base description file with other source files. 1 6 8807 6138 004

Introduction The transaction library, in turn, calls the update library, which selects an appropriate routine for processing the transactions against the database. The transaction library returns the resulting output transaction records to the user-written program. Figure 1 3 displays the TPS naming conventions. Figure 1 3. TPS Naming Conventions 8807 6138 004 1 7

Introduction The Transaction Journals In addition to routing transaction records to the update library, the transaction library enables you to collect or save transaction records in special TPS files called transaction journals. In the TPS environment, a transaction journal is composed of a control file and one or more data files. Tank journals allow the user to tank, or batch, transaction records. The tanked transaction records are not processed against the database until you make a specific request for the processing. The TRHISTORY journal saves or audits a history of all transaction records that have been applied to the database. Auditing a history of all transactions that have been applied to the database allows TPS to automatically resubmit transactions that were backed out by an Enterprise Database Server recovery procedure. By coding the update library routines in a specific way, you can reproduce previous results after TPS has submitted transactions. One important distinction between tank journals and the TRHISTORY journal relates to communication with the update library. Transaction records that are saved in the TRHISTORY journal are sent from the user-written program to the transaction library, and from there to the update library for processing. After processing, output transaction records are sent back to the transaction library, and from there back to the user-written program. However, transaction records that are stored in tank journals are never sent to the update library; no processing of tanked transactions occurs. The Remote Library Another TPS feature is its distributed processing capability, illustrated by Figure 1 4. You can process transactions from both a host system (the system where the database resides) and any number of remote systems, which are connected through a BNA data communications network, without having to change user-written programs. The portability of TPS user-written programs results from the fact that they always call the same entry points to process transactions, regardless of where the programs are executed. Except for speed, the fact that the database might be on another system is transparent to the user-written program. 1 8 8807 6138 004

Introduction A special module called the remote library (shown in Figure 1 4) is used to enable remote-host communications. To compile the remote library on the host system, use the transaction base description file; then copy it over to the remote system. Thus, a program on the remote system calls the same entry points that a program on the host system calls, except that the program on the remote system is actually calling the remote library. Figure 1 4. Remote Real-Time Transaction Processing with TPS 8807 6138 004 1 9

Introduction The HOSTINTERFACE Program The remote library does not directly call the update library on the host system in the same way that the transaction library does. Instead, the remote library sends input transaction records to the HOSTINTERFACE program, a TPS module that resides on the host system. (A BNA port file interface is used to send transaction records from the remote system to the host system.) The HOSTINTERFACE program substitutes for the remote user-written program on the host system, and its job is to call the appropriate entry point in the transaction library for the input transaction record that was sent. After processing, the HOSTINTERFACE program sends the output transaction record back to the remote library which, in turn, returns the transaction record to the remote user-written program. TPS Software Components SYMBOL/TFL SYSTEM/TFL The following software components are provided to the TPS user. SYMBOL/TFL is the source file for the TFL processor, named SYSTEM/TFL. The user defines transaction record formats using TFL and creates a transaction base description file by running SYSTEM/TFL (described in the following paragraph). The data submitted to SYSTEM/TFL is usually referred to as the TFL source, and the transaction base description file is usually referred to as the TRDESCRIPTION file. SYSTEM/TFL is a program that functions as a processor. SYSTEM/TFL reads the symbolic description of transaction record formats written in TFL and produces a TRDESCRIPTION file. Depending on the TFL processor options you specify, SYSTEM/TFL can perform other functions as well. For example SYSTEM/TFL can do the following: 1. Produce a printer listing of the TFL source file, including errors that have been detected. 2. Create an updated TRDESCRIPTION file if you specify UPDATE in the TFL source. 3. Initiate compilation of all TPS tailored software if you specify the TFL compiler control option ZIP. SYSTEM/TRINTERFACE SYSTEM/TRINTERFACE is an external coroutine that communicates with the user language compilers to invoke and compile references to the user language interfaces for TPS. These references include user-defined transaction record formats, transaction journals, subbases, and other information related to transaction processing. 1 10 8807 6138 004

Introduction TRBASE/HOSTINTERFACE TRBASE/HOSTINTERFACE is a source file that is compiled to create an interface between the host system in a network and a user-written program running on a remote system. One such interface program runs for each user-written program on a remote system. When a user-written program attempts to call a transaction library entry point on the remote system, the interface program actually makes the entry point call for the user-written program on the host system. TRBASE/HOSTLIB TRBASE/HOSTLIB is a source file compiled to produce the transaction library. The transaction library is a collection of procedures or entry points called by user-written programs to process or tank transactions and read them back from transaction journals. TRBASE/PROPERTIES TRBASE/PROPERTIES is a compiler file that is made up of ALGOL defines and procedures and is compiled with other TPS software to provide information about the format of the TRDESCRIPTION file and the system format. For example, TRBASE/PROPERTIES is compiled with the TRDESCRIPTION file and the source file TRBASE/HOSTLIB to produce a user-tailored transaction library. TRBASE/REMOTELIB TRBASE/REMOTELIB is a source file that is used in a distributed processing environment. It is compiled on the host system and then copied over to the remote system, where it is known as the remote library. It runs with the user-written programs, and is analogous to the transaction library that runs on the host system, but does not perform all the functions of the transaction library. The remote library has the same entry points as and appears identical to the transaction library. TRBASE/UTILITY You can tailor the TRBASE/UTILITY program to meet your specific transaction processing needs. This program has four major functions: 1. Initializing transaction journal control files 2. Searching and printing portions of transaction records in transaction journal data files 3. Printing information in transaction journal control files 4. Recovering transaction journal control files 8807 6138 004 1 11

Introduction 1 12 8807 6138 004

Section 2 Transaction Formatting Language (TFL) Transaction Formatting Language (TFL) is a symbolic language used to define transaction record formats, subformats, journals, subbases, and other information related to transaction processing. TFL is similar in several respects to the Data and Structure Definition Language (DASDL), which is used, among other things, to define the formats of data set records. The symbolic description of transaction record formats, journals, and other related structures is collectively referred to as a transaction base. A transaction base is analogous to a database, and can be defined for at most one database. The TFL source file describing a transaction base is processed with the TFL Processor, which is called SYSTEM/TFL, as shown in Figure 2 1. SYSTEM/TFL produces a transaction base description file, referred to as the TRDESCRIPTION file. The user language compilers use the TRDESCRIPTION file when compiling user-written programs that invoke a transaction base and when compiling tailored TPS software. Figure 2 1. Generating the Description of a Transaction Base 8807 6138 004 2 1

Transaction Formatting Language (TFL) TFL Basic Constructs The following paragraphs give brief descriptions of the most basic TFL constructs that commonly appear in TFL descriptive statements. Character Set TFL uses the following EBCDIC characters: Character Description Character Description 0 9 Space or blank A Z Uppercase only, Comma Hyphen or minus ; Semicolon + Plus sign : Colon * Asterisk. Period or decimal point / Slash " Quotation mark = Equal sign $ Dollar sign > Greater than symbol % Percent sign < Less than symbol ( Left parenthesis ) Right parenthesis Although TFL uses only the characters in the preceding list, a string can contain any EBCDIC character. Digit Syntax 0 1 2 3 4 5 6 7 8 9 Letter Syntax one of the EBCDIC characters, A Z 2 2 8807 6138 004

Transaction Formatting Language (TFL) Comment The comments are TFL descriptive information about a transaction base; they are stored in the TRDESCRIPTION file. The format for listing comments depends upon which programming language you are using. For further information regarding these formats, refer to the individual language reference manuals. Syntax Family Name <string> A family name identifies a disk or disk pack family. Syntax DISK PACK <letter> /16\ <letter> <digit> Simple Identifier A simple identifier consists of uppercase alphanumeric characters and single embedded hyphens. The first character must be an alphabetic character. A simple identifier can be at most 17 characters in length. Examples of Legal Identifiers ABC ABC-EF-HIJKLMNOPQ STEP-1 Examples of Illegal Identifiers 3DE abc ABCDEFGHIJKLMNOPQR -ABC ABC- For information on the use of hyphenated identifier capabilities for COBOL languages, refer to the appropriate language reference manual. 8807 6138 004 2 3

Transaction Formatting Language (TFL) Integer Number Syntax <letter> <letter> <digit> /15\ <letter> <digit> <hyphen> An integer represents a signed or unsigned whole value. A plus sign (+) or a minus sign ( ) immediately followed by an unsigned integer with no intervening space is always taken as a sign, never an operator. An unsigned integer represents an unsigned whole value. Syntax <unsigned integer> + <unsigned integer> <digit> A number represents a signed or unsigned fractional or whole value. A plus sign (+) or minus sign ( ) immediately followed by an unsigned number with no intervening space is always taken as a sign, never an operator. An unsigned number represents an unsigned fractional or whole value. Syntax <unsigned number> + unsigned number <unsigned integer>. <unsigned integer>. <unsigned integer> 2 4 8807 6138 004

Transaction Formatting Language (TFL) Remark String A remark is preceded by a percent sign and can appear anywhere, except within a string. When a remark is encountered, the remainder of the input record is ignored and processing of the next record begins. Syntax % <EBCDIC character> You must enclose a string within quotes. If a string extends beyond column 72 of a record, the record boundary acts as an implicit quote. The string must be continued on the next record and must begin with a quote. To represent a quote in a string, place two adjacent quotes on the same record. Two adjacent strings separated only by blanks, remarks, or record boundaries are automatically concatenated. A string can contain at most 255 characters. Syntax Expression <one or more blanks> " <any EBCDIC character except quote> " <two adjacent quotes> Syntax <arithmetic expression> <Boolean expression> 8807 6138 004 2 5

Transaction Formatting Language (TFL) Arithmetic Expression An arithmetic expression yields a numeric value. To form the arithmetic expression, combine data items and constants using arithmetic operators. The following arithmetic operators are provided: Operator Description + Add Subtract * Multiply / Divide DIV MOD Integer divide Remainder divide The sequence in which operations are performed is determined by the precedence of the operators involved. The order of precedence is as follows: Operators to Use First *,/, DIV, MOD Operators to Use Second +,- When operators have the same precedence, the operations are performed in order from left to right. You can use parentheses in standard mathematical fashion to override the usual evaluation order. When occurring data items are referenced, all subscripts must be specified. Subscripts must be unsigned integer constants. When negative numbers follow operators, you must enclose them within parentheses. Syntax <arithmetic primary> + + <arithmetic primary> * / DIV MOD 2 6 8807 6138 004

Transaction Formatting Language (TFL) <arithmetic primary> <unsigned number> <unsigned integer> (<arithmetic expression>) <field item name> <numeric item name> (<subscript list>) <real item name> <subscript list>, <unsigned integer> Boolean Expression A Boolean expression yields a value of either TRUE or FALSE. It is formed by combining data items, arithmetic expressions, and strings using relational and logical operators. The following rules of precedence control the sequence in which to evaluate a Boolean expression: 1. <arithmetic expression> 2. <arithmetic compare>, <string compare> 3. NOT 4. AND 5. OR When operators have the same precedence, the operations are performed in order from left to right. Use parentheses to override the usual evaluation order. Occurring data items must be fully subscripted. Subscripts must be unsigned integer constants. When comparing alpha items, the comparison is based on the number of characters contained in the alpha item or string having the shorter length. Syntax <Boolean primary> NOT AND <Boolean primary> OR NOT <Boolean primary> TRUE FALSE <arithmetic compare> <string compare> ( <Boolean expression> ) <Boolean item name> <field bit name> <subscript list> 8807 6138 004 2 7

Transaction Formatting Language (TFL) <subscript list>, <unsigned integer> <arithmetic compare> <arithmetic expression> LSS <arithmetic expression> < <= LEQ EQL = NEQ >= GEQ GTR > <string compare> <alpha item name> LSS <alpha item name> < <string> <= LEQ EQL = NEQ >= GEQ GTR > TFL Description of Transaction Base Use TFL to define a transaction base. A transaction base consists of several components, which are described later in this section. Syntax <base name> TRANSACTION BASE ; UPDATE ; ; /1\ <parameters> ; /1\ <defaults> ; /4094\ <transaction format> /4094\ <transaction subbase> <transaction journal> <base name> <simple identifier> 2 8 8807 6138 004

Transaction Formatting Language (TFL) Explanation The following text explains the elements of the syntax diagrams. <base name> TRANSACTION BASE Assigns the base name as the name of the new transaction base. The file that is created using this description is named <base name>/trdescription UPDATE Updates a previous TRDESCRIPTION file with the correct input. When an update is performed, the entire transaction base must be redescribed. TFL processes the new source file and then compares it to the old TRDESCRIPTION file to ensure that all changes are valid. <parameters> Defines values for the global transaction base properties. <defaults> Assigns default values to control file specifications, data file specifications, and items. <transaction record format> Defines the format that a single transaction can assume and defines the data items and group items that can be contained within a particular transaction record. There can be at most 4095 transaction record formats in a transaction base. <transaction subbase> Defines a list of transaction record formats and transaction subformats that are invoked together by a user-written program. There can be at most 4095 transaction subbases in a transaction base. A transaction subbase is similar in many respects to a DASDL logical database. <transaction journal> Defines the values of the <control file specs> construct and <data file specs> construct for a transaction journal. <simple identifier> See Simple Identifier earlier in this section. See also Updating Transaction Bases, Parameters, Defaults, Transaction Record Format, and Transaction Journal in this section. 8807 6138 004 2 9

Transaction Formatting Language (TFL) Parameters The parameters define values for the global transaction base properties. Syntax, PARAMETERS ( <parameter spec> ) <parameter spec> <Boolean parameter> SET RESET /1\ <database parameter>, <restart data set parameter> <restart data set parameter>, <database parameter> /1\ <host system parameter> <Boolean parameter> STATISTICS <database parameter> DATABASE = <database name> (<usercode>) * ON <family name> <database name> <simple identifier> <restart data set parameter> RESTARTDATASET = <restart data set name> <restart data set name> <simple identifier> <host system parameter> HOSTSYSTEM = <host system name> Explanation The following text explains the elements of the syntax diagrams. <Boolean Parameter> Defines a parameter that has a value of TRUE (if SET is specified) or FALSE (if RESET is specified). If neither SET nor RESET is specified, SET is assumed. The Boolean parameter STATISTICS can be used. 2 10 8807 6138 004

Transaction Formatting Language (TFL) STATISTICS When set, the STATISTICS option causes the transaction library to gather statistics concerning system operation. A report summarizing these statistics is produced on a printer file when the last user calls the transaction library entry point CLOSETRBASE. <database parameter> <restart data set parameter> <restart data set parameter> <database parameter> If the transaction base is to access a database, it must have access to the control file and restart data set of that database. The database parameter gives the name of the database to be accessed and specifies where to find its control file. If no database parameter is specified, database-related code is omitted from the transaction library. Only audited databases can be used in conjunction with TPS. The restart data set parameter names the restart data set within the database, which is used by the Enterprise Database Server recovery procedure during the Halt/Load recovery process. <host system parameter> Specifies the name of the system with which a remote system communicates. This parameter must be included if a remote version of the transaction library (in other words, the remote library) is to be compiled. By definition, the system that contains the database is the host system; all other systems are referred to as remote systems. DATABASE = <database name> Associates the transaction base with the specified database. (<usercode>) * Specifies the usercode where the database control file resides. An asterisk (*) indicates that the control file is a system file. If neither usercode nor * is given, the usercode is assumed to be that of a user-written program invoking the transaction base. ON <family name> Specifies the family (disk or pack) on which the database control file resides. If this option does not appear, DISK is assumed. RESTARTDATASET = <restart data set name> Specifies the name of the restart data set declared in the DASDL for the database named database name. HOSTSYSTEM = <host system name> Specifies the name of the system with which all remote systems communicate, that is, the system on which the database resides. 8807 6138 004 2 11

Transaction Formatting Language (TFL) Defaults The defaults assign default values for control file specifications, data file specifications, and items. Specifying the value of an attribute using defaults is equivalent to specifying the value for each item or journal file attribute in the transaction base for which the value is appropriate. The specifications in the defaults apply to every element of the transaction base unless they are explicitly overridden for a particular element. Syntax, DEFAULTS ( /1\ CONTROL FILE (<control file specs>) /1\ DATA FILE (<data file specs>) /1\ <item defaults> ) <control file specs>, /1\ AREAS = <unsigned integer> /1\ AREASIZE = <unsigned integer> BLOCKS /1\ BLOCKSIZE = <unsigned integer> SEGMENTS WORDS /1\ FAMILY = <family name> /1\ USERCODE = <usercode> * /1\ CHECKSUM = TRUE = FALSE, <data file specs>, /1\ AREAS = <unsigned integer> /1\ AREASIZE = <unsigned integer> BLOCKS /1\ BLOCKSIZE = <unsigned integer> SEGMENTS WORDS /1\ FAMILY = <family name> /1\ USERCODE = <usercode> * /1\ DUPLICATED ON <family name> /1\ CHECKSUM = TRUE = FALSE, <item defaults>, /1\ ALPHA (<initial value option>) /1\ BOOLEAN /1\ NUMBER /1\ REAL 2 12 8807 6138 004

Transaction Formatting Language (TFL) Explanation The following text explains the elements of the syntax diagrams. <control file specs> Assigns particular default values to file attributes and other specifications of transaction journal control files. These default values are used instead of system default values whenever individual specifications are not provided in the TFL source. <data file specs> Assigns particular default values to file attributes and other specifications of transaction journal data files. These default values are used instead of system default values whenever individual specifications are not provided in the TFL source. <item defaults> Specifies default initial value options to be used for items of any of the indicated data types. These initial values are used instead of system default values whenever individual initial value specifications are not provided in the description of data items contained within a transaction record format. <initial value option> Substitutes for a system default value for an item whenever an individual initial value specification is not provided in the description of a data item contained within a transaction record format. Transaction Record Format A transaction record format defines the format or data layout a transaction record can assume. Syntax <format name> FORMAT TRANSACTION <comment> <record description> <record description> <common part>, <subformat part> <common part> <subrecord description> <subformat part> <subformat name> : <subrecord description> <subrecord description> ( <item list> ) VERIFY <Boolean expression> 8807 6138 004 2 13

Transaction Formatting Language (TFL) <item list> ; <data item> <group item> ; <format name> <simple identifier> <subformat name> <simple identifier> Explanation The following text explains the elements of the syntax diagrams. <format name> FORMAT <format name> TRANSACTION FORMAT Identifies the description of a particular transaction format. Each format name is assigned a unique integer value, which is stored in the control portion of the transaction record. You can use the format name in certain contexts in a user-written program to refer to this value. <record description> Defines the data items and associated specifications for a particular transaction format. <common part> Defines the portion of a transaction record that contains data items common to all transaction records of a given format. <subformat part>, <subformat part>... Defines the variable portion of a transaction record. Transaction records created in a specific transaction format and subformat contain the data items common to the format, as well as the data items defined within the specified subformat. Data items with the same name that are contained within different subformats of the same format must be declared with the same type and size. Such items must also occupy the same position within their respective subformats. <subformat name> Identifies the description of a particular transaction subformat. Each subformat name is assigned an integer value, which is stored in the control part of the transaction record. You can use the subformat name in certain contexts in a user-written program to refer to this value. Though transaction record format names must be unique, transaction subformat names need not be unique. That is, two different transaction record formats can contain transaction subformats having the same name. 2 14 8807 6138 004

Transaction Formatting Language (TFL) <subrecord description> Defines a list of item descriptions, optionally followed by a VERIFY condition. For any transaction record, the applicable VERIFY condition(s) must yield the value TRUE when evaluated using the items of that record. A Boolean expression is used to ensure that only valid transaction records are accepted by the transaction library. Each time a user program calls a transaction library entry point to either process or tank a transaction record, the Boolean expression is applied to the record. If the Boolean expression is not satisfied (in other words, the value returned is FALSE), the record is not accepted and the user program is notified of the error. You can specify a Boolean expression for the common part of a transaction format, and specify separate Boolean expressions for each subformat of a transaction format. The Boolean expression for the common part can only refer to items in the common part. The Boolean expression for a subformat can refer to items in both the common part and the subformat to which the condition is attached. If separate Boolean expressions are specified for the common part and a subformat, then both must be satisfied before the record is stored. <data item> <group item> See Data Item and Group Item later in this section. <simple identifier> <Boolean expression> See Simple Identifier and Boolean Expression earlier in this section. Transaction Subbase A transaction subbase lists transaction formats that a user-written program invokes together. Such formats are usually related in some way. For example, each subbase may correspond to a logical database, so that a program invoking a subbase opens only a specific portion of the database. Syntax <subbase name> SUBBASE TRANSACTION, ( <subbase format> ), <guard file name> <subbase format> <format name> <new format name> =, ( <subbase subformat> ) <subbase subformat> <subformat name> <new subformat name> = 8807 6138 004 2 15

Transaction Formatting Language (TFL) <subbase name> <simple identifier> <new format name> <simple identifier> <new subformat name> <simple identifier> Explanation The following text explains the elements of the syntax diagrams. <subbase name> SUBBASE <subbase name> TRANSACTION SUBBASE Identify the description of particular transaction subbases. Each subbase name is assigned a unique integer value, which is stored in the control portion of the transaction record. <format name> Identifies a transaction record format that is invoked as part of a particular transaction subbase. <new format name> = <format name> Gives an internal name to a transaction record format. User-written programs then refer to the new format name rather than the format name. (<subbase subformat>, <subbase subformat>,... ) Restricts the invoked subformats to those listed. If this list does not appear, all subformats are invoked. <guard file name> Associates the specified guard file with a subbase. The guard file restricts the use of particular transaction record formats and transaction subformats to a specific set of usercodes or programs, or both. In other words, unauthorized usercodes and programs are not allowed to process transactions contained within a subbase that is protected by a guard file. By checking with the guard file, the system verifies that the usercode and program name are authorized to access the subbase. <subbase subformat> <subbase subformat> = <new subformat name> Identifies one of several subformats to be invoked along with a transaction subbase format. The new subformat name, if present, gives an internal name to a transaction subformat. User-written programs then refer to the new subformat name rather than the subformat name. 2 16 8807 6138 004

Transaction Formatting Language (TFL) Transaction Journal There are two types of transaction journals: a history journal and one or more tank journals. A tank journal contains transaction records that have been accumulated during a tanking operation but not yet processed (applied to the database). A transaction base can have several tank journals with any name of the user s choice except TRHISTORY. A history journal contains transaction records that have been processed against the database. The transaction records are written in the order in which they must be reprocessed during a recovery operation. A transaction base can have only one history journal, and its journal name must be TRHISTORY. Each transaction journal contains the following physical files: 1. Transaction journal data files These files contain variable-length transaction records in variable-length blocks. Each file has a title of the following form: <base name>/<journal name>/<file number> The file number can range from 1 through 9999, wrapping around from 9999 to 1. 2. Transaction journal control file This file contains control information, including a Halt/Load flag to indicate that recovery is required. For each user known to a transaction journal, the control file contains the most recent response transaction record. This response record, in turn, contains a reference to either the user s last processed input transaction record or the user s last good restart transaction record. The control file has a title of the following form: <base name>/<journal name>/control The TFL definition of a transaction journal gives the values of file attributes and other specifications for the control and data files that make up a particular transaction journal. For any transaction journal that is not explicitly defined, these specifications are given default values. Syntax <journal name> JOURNAL TRANSACTION, /1\ CONTROL FILE (<control file specs>) /1\ DATA FILE (<data file specs>) <journal name> <simple identifier> 8807 6138 004 2 17

Transaction Formatting Language (TFL) <control file specs>, /1\ AREAS = <unsigned integer> /1\ AREASIZE = <unsigned integer> BLOCKS /1\ BLOCKSIZE = <unsigned integer> SEGMENTS WORDS /1\ FAMILY = <family name> /1\ USERCODE = <usercode> * /1\ CHECKSUM = TRUE = FALSE, <data file specs>, /1\ AREAS = <unsigned integer> /1\ AREASIZE = <unsigned integer> BLOCKS /1\ BLOCKSIZE = <unsigned integer> SEGMENTS WORDS /1\ FAMILY = <family name> /1\ USERCODE = <usercode> * /1\ DUPLICATED ON <family name> /1\ CHECKSUM = TRUE = FALSE, Explanation The following text explains the elements of the syntax diagrams. <journal name> JOURNAL <journal name> TRANSACTION JOURNAL Identify the definition of transaction journals. A journal name can be any valid simple identifier, except that if you use the journal for tanking, you cannot name it TRHISTORY. AREAS = <unsigned integer> AREASIZE = <unsigned integer> BLOCKS BLOCKSIZE = <unsigned integer> SEGMENTS BLOCKSIZE = <unsigned integer> WORDS Assign the specified values to control file or data file attributes. For more information on these attributes, refer to the File Attributes Programming Reference Manual. The default value for the AREAS attribute is 100. The default value for the AREASIZE attribute is 30 blocks. The default value for the BLOCKSIZE attribute is 900 words. 2 18 8807 6138 004

Transaction Formatting Language (TFL) FAMILY = <family name> Causes the control or data file to be created on the specified family. If no FAMILY specification is given, DISK is the default. USERCODE = <usercode> USERCODE = * Cause the control or data file to be created under either the specified usercode or the system usercode (*). If no USERCODE specification is given, the system attempts to locate the appropriate file under the usercode associated with the user-written program. DUPLICATED ON <family name> Causes a data file to be duplicated on the specified family. If no DUPLICATED specification is given, the file is not duplicated. Only data files can be duplicated. This provision is made because data files contain original data that cannot otherwise be recovered if lost, whereas a journal control file can be recovered by the TRUTILITY program. The duplicated file is stored under the same usercode as the primary file. CHECKSUM = TRUE CHECKSUM = FALSE Cause blocks of data in control files and data files to be checksummed. Use the CHECKSUM specification to detect I/O errors, and thus ensure the integrity of journal files. A CHECKSUM is a value computed for each block by applying an equivalence operator to each word in the block. When the block is physically written, the CHECKSUM value is stored in a reserved word with the block. When the block is read, the CHECKSUM value is recomputed, and the result is compared to the stored value. A CHECKSUM error occurs if the two values are not equal. CHECKSUM is set to TRUE by default. Items You can define two types of items for a transaction record format, group items, or data items. The following paragraphs explain the types of items. Syntax <group item> <data item> 8807 6138 004 2 19