gtpa2m02Application Programming

Application Programming


Contents

Figures

Tables

Notices

  • Trademarks
  • About This Book

  • Who Should Read This Book
  • Conventions Used in the TPF Library
  • Related Information
  • How to Send Your Comments
  • Introduction to TPF

  • Some Fundamental Definitions
  • Language Structures and Case Guidelines
  • TPF Application Support and Environments
  • Communication Protocol Support
  • File Storage Support
  • TPF Environments
  • Functions Performed by the TPF System
  • Messages and Entries
  • Entry Control Block
  • Reentrant Programs
  • Database Support
  • Program Categories
  • C Language in the Control Program
  • ECB-Controlled Programs
  • Non-ECB Controlled Programs
  • High Performance Option
  • TPF Programming Conventions
  • Common Programming Conventions
  • Assembler Language Programming Conventions
  • C Language Programming Conventions
  • TPF Advanced Program-to-Program Communications
  • TPF Application Requester
  • Message Queue Interface (MQI) Client
  • A TPF Transaction Example
  • TPF Data Structures and System Services

  • Entry Control Block
  • Linking ECBs and Their Common Services
  • Work Areas
  • Data Levels
  • Data Event Control Blocks
  • I/O-Associated Unusual Conditions
  • Areas Used by the TPF system
  • User Register Save Area
  • Routing Control Parameter List
  • RCPL Data Area
  • RC0PL Data Macro
  • Activating the Application
  • Log Processor
  • Conditions at Activation
  • Application Message Editor
  • Input Edit and Path Selection
  • Message Recovery
  • SNA Input Messages
  • SNA Output Messages
  • Application Recovery Package
  • Terminal and Transaction Control
  • Routing Control Block
  • Agent Assembly Area
  • Scratchpad Area
  • Output Message Control
  • TPF Macros
  • Understanding High-Level Language Concepts in the TPF System

  • E-Type Program Chart and Program Attributes
  • Load Module Attributes
  • Classic TPF Segment
  • Functions and Calling Other Functions
  • Functions Calling Other Programs
  • ISO-C Linkage Performance Considerations
  • Run-Time (Nondynamic) Library Function Linkage
  • Function Stubs
  • Secondary Linkage for ISO-C Support
  • Quick Enter Directory for TARGET(TPF)
  • Secondary Directory for TARGET(TPF)
  • Storage for Static Variables
  • ISO-C Language Stack
  • TPF Header Files
  • Run-Time Libraries
  • Dynamic Load Modules
  • Creating Globals for C
  • C Language Locale
  • Character Set Support
  • C++ Support
  • Class Library Support
  • TPF Restriction
  • Dynamic Link Library (DLL) Support
  • Terminology and Concepts
  • Linkage
  • DLLs and Subsystem Dependencies
  • Summary
  • Understanding TPF MQSeries Support

  • TPF MQSeries Client Support
  • MQSeries Client
  • MQI Channel Directory
  • TPF MQSeries Local Queue Manager Support
  • Supported Queue Types
  • Starting TPF MQSeries Applications Using Triggers
  • Message Routing
  • Processor Unique Queues versus Processor Shared Queues
  • Monitoring Queue Depth
  • Channels
  • MQSeries ROUTC Bridge
  • Transmission Queues: Swinging
  • Transaction Manager
  • Browsing TPF MQSeries Processor Shared Queues
  • Trace
  • Administering Your Local Queue Manager
  • Defining the MQSeries Profile
  • Defining Processor Shared Queues
  • CPU Parameter for Channel Definitions
  • Altering Channels
  • Checkpoint
  • Sweep
  • Tuning Memory Allocation
  • Deleting Queues
  • Understanding TPF Transaction Services Concepts

  • Defining a Commit Scope
  • Commit Scope Nesting
  • Suspending a Commit Scope
  • In the Commit Scope
  • DASD
  • Pool File Addresses
  • TPF MQSeries Support
  • Ending a Commit Scope
  • Outside the Commit Scope
  • Finding Records
  • Filing Records
  • Holding Records
  • Deadlock Detection
  • Loosely Coupled and Multiple Database Function (MDBF) Considerations
  • Exceptions
  • Understanding TPF Collection Support

  • Application Characteristics
  • TPFCS Environment Block
  • Type Definitions
  • Error Handling
  • Data Store Application Dictionary
  • Application Startup Examples
  • Types of Functions
  • Returned Data Structures
  • Collection APIs
  • Creating and Deleting Collections
  • Accessing and Modifying Collections
  • Cursors
  • Initializing a Cursor
  • Using Cursors for Locating, Accessing, and Removing Elements
  • Using Cursors with Alternate Key Paths
  • Cursor Positioning
  • Iterating over Collections
  • TO2_allElementsDo
  • Using Cursors for Locking Collections
  • Concurrency Controls
  • None (Nonlocking Cursor)
  • Optimistic Concurrency (Update Sequence Counter)
  • Pessimistic Concurrency (Locking Cursor)
  • Dirty-Reader Protection
  • Key Path Support
  • Adding Key Paths
  • Removing Key Paths
  • Understanding Logical Record Caching

  • Creating a Logical Record Cache
  • System Heap and the Hash Table
  • Cache Name
  • cacheToken Value
  • Processor Unique and Processor Shared Caches
  • castOutTime Value
  • Reading an Entry from a Logical Record Cache
  • Examples
  • Adding an Entry to a Logical Record Cache
  • Primary and Secondary Keys
  • invalidateOthers Parameter
  • timeout Parameter
  • Examples
  • Updating an Entry in a Logical Record Cache
  • Primary and Secondary Keys
  • invalidateOthers Parameter
  • timeout Parameter
  • Examples
  • Deleting an Entry from a Logical Record Cache
  • Examples
  • Flushing Entries from a Logical Record Cache
  • Examples
  • Deleting a Logical Record Cache
  • Examples
  • Writing TPF Application Programs in C and C++

  • Special TPF Considerations
  • Coding main Functions
  • I/O Stream Pipes
  • Example of Calling a DLM That Contains a main Function
  • Example of Creating an ECB That Enters a DLM That Contains a main Function
  • Coding C++ Applications
  • C++ Exceptions
  • Exporting
  • Reentrant Programming
  • Standard TPF Program Sizes
  • Static Storage Considerations
  • TPF Header Files
  • Creating Your Own Header Files
  • TPF Header Files and C++
  • More Useful Information
  • TPF Application Environment
  • Accessing the ECB
  • Work Areas
  • Data Levels
  • Managing Files
  • ECBs and Entries
  • TPF Terminal Communications
  • Using TPF Globals
  • Calling Other Functions and Programs
  • Function Linkage:
  • Parameter Passing (from C to C)
  • Calling a C Program (from Assembler)
  • Calling an Assembler Program (from C)
  • Compiling and Running C/C++ Programs
  • DLL Compiler Option
  • Sample Code Written to the RENT Standard
  • C Header File with Declarations of External Linkage Objects
  • C Source File with Definitions of External Linkage Objects
  • C Source File Showing the Use of External Linkage Objects
  • Understanding TPF Internet Server Support

  • The POSIX Process Model As Implemented by the TPF System
  • A Process
  • Process Inheritance
  • POSIX-Compliant APIs for Process Control
  • TPF-Unique APIs for Process Control
  • Signals
  • File Access in the TPF File System
  • Process Attributes
  • Access Permissions
  • Rules to Determine File Accessibility
  • Internet Daemon
  • Process Models
  • Internet Daemon Configuration File (IDCF)
  • Hypertext Transfer Protocol (HTTP) Server
  • File Transfer Protocol (FTP) Server
  • Trivial File Transfer Protocol (TFTP) Server
  • Customizing the TFTP Server
  • Security
  • File Names
  • Using the TFTP Server from Another System
  • Syslog Daemon
  • TPF Internet Mail Servers
  • Internet Server Application Considerations
  • Process Models
  • Internet Server Application Interface
  • Add an Internet Server Application to the IDCF
  • Considerations for Using the Internet Daemon to Start a TPF Program
  • Interface
  • Starting a TPF Application from the Internet
  • Executable Script
  • Understanding TPF Remote Procedure Call

  • Interface Definition Language and Stub Files
  • TPF Modifications to Distributed Computing Environment (DCE) RPC
  • Creating an RPC Interface for TPF
  • TPF RPC Run-Time Library
  • RPC Calls
  • Threads
  • The Thread Environment
  • Thread Safety
  • RPC Servers
  • Starting and Stopping RPC Servers
  • Performance and Tuning for RPC
  • RPC Storage Considerations
  • RPC C Header Files
  • Understanding Virtual Storage Access Method (VSAM) Database Support

  • VSAM Concepts
  • VSAM Database Support
  • Disk Mirroring
  • VSAM Database Constraints
  • VSAM Database Support with Other Utilities
  • VSAM Database Support Request Flow Control
  • Return Codes
  • Error Recovery
  • Constructing the VSAM Cluster Data Set Names
  • Coding Your Own Library Functions

  • Coding Library Functions in C
  • Coding Library Functions in Assembler
  • Register Conventions
  • C Language Support Prologs
  • C Language Support Epilogs
  • Secondary Linkage in ISO-C Function Libraries
  • Restrictions
  • Coding Assembly Language Routines
  • User Expansion Area
  • TPF Application Program Interface Functions

  • Transferring Processor Control
  • Enter/Back Services
  • Create Macros and Functions
  • Suspend Processing Macros and Functions
  • Exit Functions
  • Transfer Vectors
  • Main Storage Allocation
  • Allocating Working Storage
  • Application Global Area
  • Global Directory
  • Common Values
  • Protected Data Records
  • Maintaining Global Areas
  • Operation of the Global Functions
  • Synchronization Considerations
  • Examples of Using the Global Functions
  • Accessing Data in Assembly Language and C Language
  • Fixed File
  • FACE, FACS, and FAC8C
  • Making a Call to FACS Using TARGET(TPF)
  • face_facs Function
  • Random Pool File Area
  • Examples of Using the Pool Storage Functions:
  • File Storage Access
  • Prerequisites for Basic Find and File Functions
  • Use of the Higher-Level C Language Find and File Functions
  • Record Hold Facility
  • Summary of File Reference Functions and Macros
  • Using Assembler Language File Reference Macros
  • Using C Language File Reference Functions
  • Determining the Status of I/O Operations
  • Standard Record Header
  • Record Identification
  • Record Code Check
  • Data Control
  • Program ID
  • Chaining Addresses
  • Tape Support
  • Real-Time Operations
  • General Tape Operations
  • General Tape Functions
  • Summary of General Tape Functions
  • Operator Control of Tape Operations
  • General Data Set and General File Support
  • General Data Set Functions
  • Input Device Support
  • System Error Processing
  • SYSRA Macro
  • Standard Error Functions
  • Using C Language Error Functions
  • Temporarily Detaching and Attaching Main Storage Blocks
  • Design Considerations

  • Program Sharing in Main Storage
  • Virtual File Access Facility
  • Program Organization
  • Modular Programming
  • Performance Considerations
  • File Access
  • Coding Techniques
  • Ease of Modification and Expansion
  • Program Commentary
  • Utility Segments and Subroutines
  • Miscellaneous Programming Tips
  • TPF Testing Environment for Assembly Language

  • Test System Characteristics
  • Testing Levels
  • Test System Components
  • System Test Compiler (STC)
  • Program Test Vehicle (PTV)
  • Real-Time Trace (RTT)
  • Selective File Dump and Trace (SFDT)
  • Diagnostic Output Formatter (DOF)
  • Debugging Programs and Diagnosing Problems in C Language

  • Run-Time Debugging
  • Function Mismatches
  • Identifying the Library Ordinal Number
  • ISO-C Dynamic Load Modules (DLMs)
  • Storage for ISO-C Static Variables
  • Layout of ISO-C Structures in a Dump
  • Brief Listing of Errors
  • Using C Function Trace
  • Using Link Map Support for C Load Modules
  • Customizing C/C++ Language Support

  • Required Customizations
  • TPF Globals
  • Optional Customizations
  • Creating and Selecting Locales
  • C Language Support User Exits
  • Customizing User Data Area in ISO-C Modules
  • Character Sets
  • Choosing a New Character Set
  • Translating Character Sets
  • Defining a Translation
  • Translating on a TPF System
  • Keeping CCSIDs Compatible
  • Creating a Translation Table
  • Installing Additional ISO-C Library Functions
  • Prelinking and Linking
  • Library Interface Tool
  • Purpose
  • Requirements and Restrictions
  • Format for the @libid Statement
  • Additional Information
  • Format for the @libfun Statement
  • Additional Information
  • Example of a Library Interface Tool Script
  • Running the Tool
  • DLM Call Stub Generator
  • Purpose
  • Requirements and Restrictions
  • Format for a DLM Stub Generator Statement
  • Running the Generator
  • ISO-C Load Module Build Tool (CBLD)
  • Purpose
  • Requirements and Restrictions
  • Format for a Load Module Build Tool Statement
  • Sample Load Module Build Scripts
  • Running the Build Tool
  • Rearrange TXT (REATXT) Tool: Sample Code Only
  • Sample JCL for Generating ISO-C Offline Tools
  • Installing Additional IBM TARGET(TPF) C Library Functions
  • Removing TARGET(TPF) Library Functions
  • Index