This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Overview
Download & View Application Programming Database Manager as PDF for free.
Summary of Changes . . . . . . . . . Changes to the Current Edition of this Book for Changes to This Book for IMS Version 7. . . Library Changes for IMS Version 7 . . . . .
Chapter 6. Monitoring Your Position in the Database Understanding Current Position in the Database . . . Position after Retrieval Calls . . . . . . . . . Position after DLET . . . . . . . . . . . . . Position after REPL. . . . . . . . . . . . . Position after ISRT . . . . . . . . . . . . . Current Position after Unsuccessful Calls . . . . . . Position after an Unsuccessful DLET or REPL Call . Position after an Unsuccessful Retrieval or ISRT Call
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
183 183 184 185 187 187 188 188 189
Chapter 7. Using Multiple Qualification Statements . . . . . . Overview of Multiple Qualification Statements . . . . . . . . . Example using Multiple Qualification Statements . . . . . . . . Using Multiple Qualification Statements for HDAM, PHDAM, or DEDB
. . . .
. . . .
. . . .
. . . .
193 193 194 195
Chapter 8. Using Multiple Processing . . . . Multiple Positioning . . . . . . . . . . . . Advantages of Using Multiple Positioning . . . . How Multiple Positioning Affects Your Program. Resetting Position with Multiple Positioning . . Using Multiple DB PCBs . . . . . . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
197 197 200 200 202 202
Chapter 9. Using Secondary Indexing and Logical Relationships How Secondary Indexing Affects Your Program . . . . . . . . Using SSAs with Secondary Indexes . . . . . . . . . . . Using Multiple Qualification Statements with Secondary Indexes . What DL/I Returns with a Secondary Index . . . . . . . . . Status Codes for Secondary Indexes . . . . . . . . . . . Processing Segments in Logical Relationships . . . . . . . . . How Logical Relationships Affect Your Programming . . . . . Status Codes for Logical Relationships . . . . . . . . . .
Chapter 14. Sample Execs Using REXXTDLI . . . . . . . SAY Exec: For Expression Evaluation . . . . . . . . . . . PCBINFO Exec: Display PCBs Available in Current PSB . . . . PART Execs: Database Access Example . . . . . . . . . . PARTNUM Exec: Show Set of Parts Near a Specified Number . PARTNAME Exec: Show a Set of Parts with a Similar Name . DFSSAM01 Exec: Load the Parts Database. . . . . . . . DOCMD: IMS Commands Front End . . . . . . . . . . . IVPREXX: MPP/IFP Front End for General Exec Execution . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
275 275 276 279 280 281 281 282 286
Part 3. For Your Reference . . . . . . . . . . . . . . . . . . . . . . . . . 287 Chapter 15. Summary of DM and System Service Calls . . . . . . . . 289 Database Management Call Summary . . . . . . . . . . . . . . . . 289 System Service Call Summary. . . . . . . . . . . . . . . . . . . 290 Chapter 16. Command Codes Reference . . . . . . . . . . . . . . 293 Chapter 17. DL/I Status Codes . Status Code Tables . . . . . . Categories of DL/I Status Codes Status Code Explanations . . .
and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact: IBM Corporation J74/G4 555 Bailey Avenue P.O. Box 49023 San Jose, CA 95161-9023 U.S.A. Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee. The licensed program described in this information and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement, or any equivalent agreement between us. Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurement may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. All statements regarding IBM’s future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only. This information is for planning purposes only. The information herein is subject to change before the products described become available. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute
Programming Interface Information This book is intended to help the application programmer write IMS application programs. This book primarily documents General-use Programming Interface and Associated Guidance Information provided by IMS. General-use programming interfaces allow the customer to write programs that obtain the services of IMS. However, this book also documents Product-sensitive Programming Interface and Associated Guidance Information provided by IMS. Product-sensitive programming interfaces allow the customer installation to perform tasks such as diagnosing, modifying, monitoring, repairing, tailoring, or tuning of IMS. Use of such interfaces creates dependencies on the detailed design or implementation of the IBM software product. Product-sensitive programming interfaces should be used only for these specialized purposes. Because of their dependencies on detailed design and implementation, it is to be expected that programs written to such interfaces may need to be changed to run with new product releases or versions, or as a result of service. Product-sensitive Programming Interface and Associated Guidance Information is identified where it occurs, either by an introductory statement to a chapter or section, by footnotes in tables, or by the following marking: Product-sensitive programming interface Product-sensitive Programming Interface and Associated Guidance Information... End of Product-sensitive programming interface
Trademarks The following terms are trademarks of the IBM Corporation in the United States or other countries or both: AD/Cycle C/370 C/MVS C++/MVS CICS CICS/ESA
DB2 IBM IMS IMS/ESA Language Environment MVS/ESA Notices
xix
COBOL/370
RACF SAA
Other company, product, and service names, which may be denoted by a double asterisk (**), may be trademarks or service marks of others.
Product Names In v v v v
this book, the following licensed programs have shortened names: “C/C++ for MVS/ESA” is referred to as either “C/MVS” or “C++/MVS”. “COBOL for MVS & VM” is referred to as “COBOL”. “DB2 for MVS/ESA” is referred to as “DB2”. “Language Environment for MVS & VM” is referred to as “Language Environment”. v “PL/I for MVS & VM” is referred to as “PL/I”.
xx
Application Programming: Database Manager
Preface This book is a guide to application programming in an IMS Database Manager (IMS DB) environment. It covers basic information on coding DL/I calls for DB programs. The book is designed to provide guidance for application programmers who use the IMS DB environment to create and run application programs. (IMS/ESA is hereafter referred to as IMS.) Portions of this book are for programmers who use IMS from a Customer Information Control System (CICS) environment. This book also contains information on the DBCTL environment. DBCTL is generated by IMS DB, contains no data communication components, and is designed to function as a database manager for non-IMS transaction management systems. This edition is available only in PDF and BookManager formats. This book is available on the IMS Version 7 Licensed Product Kit (LK3T-2326). You can also get the most current versions of the PDF and BookManager formats by going to the IMS Web site at www.ibm.com/ims and linking to the Library page.
Summary of Contents This book has four parts: v “Part 1. Writing Application Programs” on page 1 provides basic information on coding DL/I calls for IMS DB programs. v “Part 2. IMS Adapter for REXX” on page 251 provides information that you can use to interactively develop REXX EXECs under TSO/E and execute them in IMS MPPs, BMPs, IFPs, or batch regions. v “Part 3. For Your Reference” on page 287 provides additional information you need to write your application program. v Part 4, ″Appendixes″ contains appendixes on several subjects including sample exit routines, sample applications, and use of the DL/I test program (DFSDDLT0).
Prerequisite Knowledge IBM offers a wide variety of classroom and self-study courses to help you learn IMS. For a complete list, see the IMS home page on the World Wide Web at: www.ibm.com/ims. Before using this book, you should understand the concepts of application design presented in IMS Version 7 Application Programming: Design Guide, which assumes you understand basic IMS concepts and the various environments. This book is an extension to IMS Version 7 Application Programming: Design Guide. The IMS concepts explained in this manual are limited to those concepts that are pertinent to developing and coding application programs. You should also know how to use assembler language, C language, COBOL, Pascal, or PL/I. CICS programs can be written in assembler language, C language, COBOL, PL/I, and C++.
Terminology In this manual, the term external subsystems refers to subsystems that are not CCTL subsystems, unless indicated otherwise. One example of an external subsystem is DB2. For definitions of terminology used in this manual and references to related information in other manuals, see IMS Version 7 Master Index and Glossary.
Syntax Diagrams The following rules apply to the syntax diagrams used in this book: Arrow symbols Read the syntax diagrams from left to right, from top to bottom, following the path of the line. ───
Indicates the beginning of a statement.
───
Indicates that the statement syntax is continued on the next line.
───
Indicates that a statement is continued from the previous line.
───
Indicates the end of a statement.
Diagrams of syntactical units other than complete statements start with the ─── symbol and end with the ─── symbol. Conventions v Keywords, their allowable synonyms, and reserved parameters, appear in uppercase for MVS and OS/2 operating systems, and lowercase for UNIX operating systems. These items must be entered exactly as shown. v Variables appear in lowercase italics (for example, column-name). They represent user-defined parameters or suboptions. v When entering commands, separate parameters and keywords by at least one blank if there is no intervening punctuation. v Enter punctuation marks (slashes, commas, periods, parentheses, quotation marks, equal signs) and numbers exactly as given. v Footnotes are shown by a number in parentheses, for example, (1). v A symbol indicates one blank position. Required items Required items appear on the horizontal line (the main path). REQUIRED_ITEM
Optional Items Optional items appear below the main path. REQUIRED_ITEM
optional_item
If an optional item appears above the main path, that item has no effect on the execution of the statement and is used only for readability.
xxii
Application Programming: Database Manager
optional_item REQUIRED_ITEM
Multiple required or optional items If you can choose from two or more items, they appear vertically in a stack. If you must choose one of the items, one item of the stack appears on the main path. REQUIRED_ITEM
required_choice1 required_choice2
If choosing one of the items is optional, the entire stack appears below the main path. REQUIRED_ITEM
optional_choice1 optional_choice2
Repeatable items An arrow returning to the left above the main line indicates that an item can be repeated.
REQUIRED_ITEM repeatable_item
If the repeat arrow contains a comma, you must separate repeated items with a comma. , REQUIRED_ITEM repeatable_item
A repeat arrow above a stack indicates that you can specify more than one of the choices in the stack. Default keywords IBM-supplied default keywords appear above the main path, and the remaining choices are shown below the main path. In the parameter list following the syntax diagram, the default choices are underlined. default_choice REQUIRED_ITEM
optional_choice optional_choice
IMS-specific syntax information
Preface
xxiii
Fragments Sometimes a diagram must be split into fragments. The fragments are represented by a letter or fragment name, set off like this: | A |. The fragment follows the end of the main diagram. The following example shows the use of a fragment. STATEMENT