Home >Documents >CICS for iSeries Application Programming Guide V5 · PDF fileCICS for iSeries Application...

CICS for iSeries Application Programming Guide V5 · PDF fileCICS for iSeries Application...

Date post:24-May-2018
Category:
View:225 times
Download:6 times
Share this document with a friend
Transcript:
  • iSeries

    CICS for iSeries Application Programming Guide Version 5

    SC41-5454-02

    ERserver

  • iSeries

    CICS for iSeries Application Programming Guide Version 5

    SC41-5454-02

    ERserver

  • Note Before using this information and the product it supports, be sure to read the information in Appendix F, Notices, on page 585.

    Third Edition (April 2004)

    This edition applies to version 5, release 3, modification 0 of IBM CICS Transaction Server for iSeries (product number 5722DFH) and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models.

    This edition replaces SC41-5454-01.

    Copyright International Business Machines Corporation 1998, 2004. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

    |||

    |

  • Contents

    Figures . . . . . . . . . . . . . . . ix

    Tables . . . . . . . . . . . . . . . xi

    About CICS for iSeries Application Programming Guide (SC41-5454) . . . xiii Who should read this book . . . . . . . . . xiii What you need to know to understand this book xiii Conventions and terminology used in this book xiii Prerequisite and related information . . . . . . xiv

    CICS/400 library . . . . . . . . . . . xiv Books from related libraries . . . . . . . . xiv

    How to send your comments . . . . . . . . xv

    Part 1. Introduction . . . . . . . . . 1

    Chapter 1. Introducing CICS for iSeries application programming . . . . . . . 3 If CICS is new to you . . . . . . . . . . . 3 Whats different about CICS programs? . . . . . 3 Benefits of CICS for iSeries to CICS programmers . . 3

    Chapter 2. Portability and migration considerations . . . . . . . . . . . . 5 Migrating from another CICS platform . . . . . 5

    CICS/400 . . . . . . . . . . . . . . 5 BMS . . . . . . . . . . . . . . . . 6 Terminal Control . . . . . . . . . . . . 6 COBOL . . . . . . . . . . . . . . . 6 ILE C . . . . . . . . . . . . . . . . 9 SQL . . . . . . . . . . . . . . . . 9 iSeries . . . . . . . . . . . . . . . 9 Source code . . . . . . . . . . . . . . 9

    Migrating from another CICS/400 release . . . . 10 BMS . . . . . . . . . . . . . . . . 10 Application programs . . . . . . . . . . 10 Resource definitions . . . . . . . . . . 10

    Chapter 3. Preparing and writing CICS applications in COBOL . . . . . . . . 11 Preparing a COBOL application . . . . . . . 11

    Coding CICS statements in COBOL applications 12 Preprocessing . . . . . . . . . . . . . 13 Translating a COBOL program . . . . . . . 13 Compiling an application program . . . . . 16

    Writing CICS programs in COBOL . . . . . . 17 Modular programming . . . . . . . . . 18 Pointer-based addressing . . . . . . . . . 18 Getting map set storage . . . . . . . . . 19 Source code considerations . . . . . . . . 20

    Calling programs from COBOL . . . . . . . . 22 Using CICS commands . . . . . . . . . 22 Using COBOL CALL statements . . . . . . 23

    Rules governing calling CICS COBOL programs 24 Program activation . . . . . . . . . . . 25

    Sample application programs . . . . . . . . 27 Data declarations used by the ACCT sample . . 28 Defining resources for the ACCT sample . . . 29 Running the ACCT sample . . . . . . . . 29 Displaying an account record . . . . . . . 29 Adding an account record . . . . . . . . 30 Searching by account holders name . . . . . 31 Modifying an account record . . . . . . . 31 Deleting an account record . . . . . . . . 32 Printing an account record . . . . . . . . 33

    Chapter 4. Preparing and writing CICS applications in ILE C . . . . . . . . . 35 Preparing an ILE C application . . . . . . . . 35

    Coding CICS statements in iSeries applications 37 Preprocessing . . . . . . . . . . . . . 38 Translating an ILE C program . . . . . . . 38 Compiling an application program . . . . . 40

    Writing CICS programs in ILE C . . . . . . . 41 Modular programming . . . . . . . . . 42 Pointer-based addressing . . . . . . . . . 42 Getting map set storage . . . . . . . . . 44 Passing arguments by value . . . . . . . . 44 Exception handling . . . . . . . . . . . 46 Data declarations needed for ILE C . . . . . 47 Naming EIB fields . . . . . . . . . . . 47 Source code considerations . . . . . . . . 47

    Calling programs and ILE procedures from ILE C 48 Using EXEC CICS commands . . . . . . . 48 Using C language calls . . . . . . . . . 49 Rules governing calling CICS ILE C programs . . 50 Program activation . . . . . . . . . . . 51

    Sample application programs . . . . . . . . 53 Data declarations used by the FILEA sample . . 55 Defining resources for the FILEA sample . . . 55 Running the FILEA sample . . . . . . . . 56

    Part 2. Application design . . . . . 59

    Chapter 5. Designing efficient applications . . . . . . . . . . . . 61 Program size and structure . . . . . . . . . 61 Choosing between pseudoconversational and conversational design . . . . . . . . . . . 61

    General programming techniques . . . . . . 63 Processor usage . . . . . . . . . . . . 64 Recovery design implications . . . . . . . 64 Terminal interruptibility . . . . . . . . . 66 Summary of pseudoconversational and conversational design . . . . . . . . . . 66

    Using resources effectively . . . . . . . . . 66 Processor storage . . . . . . . . . . . 66

    Copyright IBM Corp. 1998, 2004 iii

  • Processor time . . . . . . . . . . . . 67 Exclusive-use resources . . . . . . . . . 67 Line transmission capacity . . . . . . . . 67

    Other suggestions . . . . . . . . . . . . 67 Auxiliary trace . . . . . . . . . . . . 67 Unnecessary commands . . . . . . . . . 68 Resource retention . . . . . . . . . . . 68 Data definition and manipulation considerations 68

    Storing data within a transaction . . . . . . . 68 Transaction work area (TWA) . . . . . . . 69 User storage . . . . . . . . . . . . . 69 COMMAREA in EXEC CICS LINK and EXEC CICS XCTL commands . . . . . . . . . 70 Program storage . . . . . . . . . . . . 70

    Sharing data across transactions . . . . . . . 70 Common work area (CWA) . . . . . . . . 71 TCTTE user area (TCTUA) . . . . . . . . 71 COMMAREA in EXEC CICS RETURN commands . . . . . . . . . . . . . . 72 Display screen . . . . . . . . . . . . 72 Temporary storage . . . . . . . . . . . 73 Intrapartition transient data . . . . . . . . 74 Your own files . . . . . . . . . . . . 74

    Data operations . . . . . . . . . . . . . 75 Emulating VSAM files . . . . . . . . . . 75 Browsing files . . . . . . . . . . . . 76 Logging files . . . . . . . . . . . . . 76 Sequential file access . . . . . . . . . . 76

    Terminal operations . . . . . . . . . . . 77 Data stream considerations . . . . . . . . 77 BMS considerations . . . . . . . . . . . 77 Additional terminal control considerations . . . 80

    Performance considerations . . . . . . . . . 81 CICS and multiprocessor AS/400s . . . . . . 81 CICS SIT parameters . . . . . . . . . . 81 COBOL application code . . . . . . . . . 82 ILE C application code . . . . . . . . . 83 *DEBUG or *NODEBUG . . . . . . . . . 83 EXEC CICS LINK command or host language call . . . . . . . . . . . . . . . . 83 Terminal communication . . . . . . . . . 84

    Chapter 6. Dealing with exception conditions . . . . . . . . . . . . . 87 Programs in any supported language . . . . . . 87

    How to use the RESP and RESP2 options . . . 87 How to use the NOHANDLE option . . . . . 90

    COBOL programs only . . . . . . . . . . 91 How to use the EXEC CICS IGNORE CONDITION command . . . . . . . . . 91 Passing control to a specified label . . . . . 92 Relying on the system default action . . . . . 95 Mixing the methods . . . . . . . . . . 98

    How CICS keeps track of what to do . . . . . . 99

    Chapter 7. Testing your application 101 Testing applications . . . . . . . . . . . 101 Screen usage, checks and considerations . . . . 101 Types of problems . . . . . . . . . . . . 102 Levels of testing . . . . . . . . . . . . 103

    Finding a problem in application code on a production system . . . . . . . . . . . . 103

    Chapter 8. Recovery considerations 105 CICS and OS/400 commitment control recovery 105 Defining recoverable files to CICS (an overview) 105 Syncpointing . . . . . . . . . . . . . 106 User journaling . . . . . . . . . . . . . 106

    Journal records . . . . . . . . . . . . 106 Journal output synchronization . . . . . . 107

    Chapter 9. Abnormal termination recovery . . . . . . . . . . . . . 109 Creating a program-level abend exit . . . . . . 110 Restrictions on retrying operations . . . . . . 110 Trace . . . . . . . . . . . . . . . . 111

    Trace entry points . . . . . . . . . . . 112 Dump . . . . . . . . . . . . . . . . 112

    Part 3. Files and databases . . . . 113

    Chapter 10. File control . . . . . . . 115 Emulated VSAM files . . . . . . . . . . . 115

    Key-sequenced file (KSDS) . . . . . . . . 116 Entry-sequenced file (ESDS) . . . . . . . 116 Relative record file (RRDS) . . . . . . . . 116 VSAM-like logical views . . . . . . . . . 116

    Reading records . . . . . . . . . . . . 117 Direct reading (using EXEC CICS READ) . . . 118 Sequential reading (browsing) . . . . . . . 119 Skip-sequential processing . . . . . . . . 121

    Updating records . . . . . . . . . . . . 122 Specifying record length . . . . . . . . . 122

    Deleting records . . . . . . . . . . . . 123 Deleting groups of records (generic delete) . . 123

    Adding records . . . . . . . . . . . . . 123 Adding to a KSDS . . . . . . . . . . . 123 Adding to an ESDS

Click here to load reader

Embed Size (px)
Recommended