627
 IMS  Version 11  Application Programming APIs SC19-2429-01

App Prog APIs

Embed Size (px)

Citation preview

IMSVersion 11

Application Programming APIs

SC19-2429-01

IMSVersion 11

Application Programming APIs

SC19-2429-01

Note Before using this information and the product that it supports, be sure to read the general information under Notices on page 575.

This edition applies to IMS Version 11 (program number 5635-A02) and to all subsequent releases and modifications until otherwise indicated in new editions. Copyright IBM Corporation 1974, 2010. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

ContentsAbout this information . . . . . . . . viiPrerequisite knowledge . . . . . . . . IMS function names used in this information . How to read syntax diagrams . . . . . . Accessibility features for IMS Version 11 . . How to send your comments . . . . . . . vii . . viii . . viii . . . x . . . x . CHNG call . . . . . . . . . CMD call . . . . . . . . . . GCMD call . . . . . . . . . GN call . . . . . . . . . . . GU call . . . . . . . . . . . ICAL call . . . . . . . . . . ISRT call . . . . . . . . . . PURG call . . . . . . . . . . SETO call. . . . . . . . . . DL/I calls for IMS TM system services . APSB call. . . . . . . . . . CHKP (basic) call . . . . . . . CHKP (symbolic) call . . . . . . DPSB call . . . . . . . . . . GMSG call . . . . . . . . . GSCD call . . . . . . . . . ICMD call . . . . . . . . . INIT call . . . . . . . . . . INQY Call . . . . . . . . . LOG call . . . . . . . . . . RCMD call . . . . . . . . . ROLB call . . . . . . . . . ROLL call . . . . . . . . . ROLS call . . . . . . . . . SETS/SETU call . . . . . . . SYNC call . . . . . . . . . XRST call. . . . . . . . . . . 79 . 87 . 89 . 90 . 91 . 93 . 96 . 99 . . . . 102 . . . . 107 . . . . 109 . . . . 110 . . . . 111 . . . . 113 . . . . 114 . . . . 116 . . . . 117 . . . . 119 . . . . 121 . . . . 132 . . . . 134 . . . . 135 . . . . 137 . . . . 138 . . . . 139 . . . . 141 . . . . 142 . . . . . . . . . . . . . . . . . . . . . . . .

|

|

Changes to the IMS library . . . . . . xiii Chapter 1. DL/I calls for database management. . . . . . . . . . . . . 1DL/I calls for database management . . . Database management call summary . . CIMS call . . . . . . . . . . . CLSE call . . . . . . . . . . . DEQ call. . . . . . . . . . . . DLET call . . . . . . . . . . . FLD call . . . . . . . . . . . . GN/GHN call . . . . . . . . . GNP/GHNP call . . . . . . . . GU/GHU call . . . . . . . . . ISRT call . . . . . . . . . . . OPEN call . . . . . . . . . . . POS call . . . . . . . . . . . REPL call . . . . . . . . . . . RLSE call . . . . . . . . . . . DL/I calls for IMS DB system services . . System service call summary . . . . APSB call . . . . . . . . . . . CHKP (basic) call . . . . . . . . CHKP (symbolic) call . . . . . . . DPSB call . . . . . . . . . . . GMSG call. . . . . . . . . . . GSCD call . . . . . . . . . . . ICMD call . . . . . . . . . . . INIT call . . . . . . . . . . . INQY call . . . . . . . . . . . LOG call . . . . . . . . . . . PCB call (CICS online programs only) . RCMD call . . . . . . . . . . ROLB call . . . . . . . . . . . ROLL call . . . . . . . . . . . ROLS call . . . . . . . . . . . SETS/SETU call . . . . . . . . . SNAP call . . . . . . . . . . . STAT call . . . . . . . . . . . SYNC call . . . . . . . . . . . TERM call (CICS online programs only) . XRST call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 3 5 6 7 9 11 15 19 21 25 25 28 30 31 31 33 34 35 36 37 39 40 42 47 53 55 56 57 58 59 60 61 64 66 67 68

Chapter 3. EXEC DLI commands . . . 145Summary of EXEC DLI DLET command . . GN command . . . GNP command . . . GU command . . . ISRT command . . . POS command . . . REPL command . . RETRIEVE command . SCHD command . . TERM command . . ACCEPT command . CHKP command . . DEQ command . . . LOAD command . . LOG command . . . QUERY command . . REFRESH command . ROLB command . . ROLL command . . ROLS command . . SETS command. . . SETU command . . STAT command . . SYMCHKP command XRST command . . commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 147 148 154 159 165 170 171 175 177 178 179 179 181 182 183 183 184 185 186 187 188 189 190 191 193

|

Chapter 2. DL/I calls for transaction management . . . . . . . . . . . . 73DL/I calls for transaction management . AUTH call. . . . . . . . . . Copyright IBM Corp. 1974, 2010

. .

. .

. .

. 73 . 74

iii

Chapter 4. OTMA Callable Interface API calls . . . . . . . . . . . . . 197OTMA Callable Interface API calls . . . . . OTMA C/I hints and tips . . . . . . . otma_create API . . . . . . . . . . otma_open API . . . . . . . . . . . otma_openx API . . . . . . . . . . otma_alloc API . . . . . . . . . . . otma_send_receive API . . . . . . . . otma_send_receivex API. . . . . . . . otma_send_async API . . . . . . . . otma_receive_async API . . . . . . . . otma_free API . . . . . . . . . . . otma_close API . . . . . . . . . . . OTMA C/I sample programs . . . . . . . Warranty and distribution for OTMA C/I sample programs . . . . . . . . . . OTMA C/I sample program #1: synchronous processing . . . . . . . . . . . . OTMA C/I sample program #2: asynchronous processing . . . . . . . . . . . . . . . . . . . . . . . . . 197 197 199 200 202 203 204 207 208 210 212 212 213

. 213 . 213 . 225

| | | | | | | |

Chapter 5. Command code referenceC command code . . D command code . . F command code . . L command code . . N command code . . P command code . . Q command code . . U command code . . V command code . . NULL command code DEDB command codes M command code . R command code . S command code . W command code . Z command code . . . . . . . . . . . for . . . . . . . . . . . . . . . . . . . . . . . . . DL/I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

239. . . . . . . . . . . . . . . . 240 241 243 244 245 245 246 249 250 251 251 252 254 255 256 257

COMPARE statement. . . . . . . . . . COMPARE AIB statement . . . . . . . COMPARE DATA statement . . . . . . COMPARE PCB statement . . . . . . . Examples of COMPARE DATA and COMPARE PCB statements. . . . . . . . . . . IGNORE statement . . . . . . . . . . OPTION statement . . . . . . . . . . PUNCH CTL statement . . . . . . . . . STATUS statement. . . . . . . . . . . WTO statement. . . . . . . . . . . . WTOR statement . . . . . . . . . . . JCL requirements for the DL/I test program (DFSDDLT0). . . . . . . . . . . . . SYSIN DD statement . . . . . . . . . SYSIN2 DD statement . . . . . . . . PRINTDD DD statement . . . . . . . PUNCHDD DD statement . . . . . . . Using the PREINIT parameter for DFSDDLT0 input restart . . . . . . . . . . . . Execution of DFSDDLT0 in IMS regions . . . Explanation of DFSDDLT0 return codes . . . DFSDDLT0 operations . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

287 287 288 289 291 293 293 294 297 300 300 301 302 302 303 303 303 305 305 306

Chapter 8. IMS Adapter for REXX . . . 309Sample exit routine (DFSREXXU). . . . . . Addressing other environments . . . . . . REXX transaction programs . . . . . . . IMS Adapter for REXX overview diagram . . IVPREXX sample application . . . . . . REXXTDLI commands . . . . . . . . . REXXTDLI calls . . . . . . . . . . . REXXIMS extended commands . . . . . . DLIINFO . . . . . . . . . . . . . IMSRXTRC . . . . . . . . . . . . MAPDEF . . . . . . . . . . . . . MAPGET . . . . . . . . . . . . . MAPPUT. . . . . . . . . . . . . SET. . . . . . . . . . . . . . . SRRBACK and SRRCMIT . . . . . . . STORAGE . . . . . . . . . . . . WTO, WTP, and WTL . . . . . . . . WTOR. . . . . . . . . . . . . . IMSQUERY extended functions . . . . . Sample execs using REXXTDLI . . . . . . SAY exec: for expression evaluation . . . . PCBINFO exec: display available PCBs in current PSB . . . . . . . . . . . . PART execs: database access examples . . . DOCMD: IMS commands front end . . . . IVPREXX: MPP/IFP front end for general exec execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 310 311 313 313 315 315 320 321 321 322 325 325 327 328 328 330 330 331 333 333

Chapter 6. Relationship between calls and AIB and PCBs . . . . . . . . . 259 Chapter 7. DL/I test program (DFSDDLT0) . . . . . . . . . . . . 261| Control statements . . . . . . . . . . . 261 | Control statement guidelines . . . . . . . . 262ABEND statement . . . . . . . CALL statement . . . . . . . CALL FUNCTION statement . . CALL DATA statement . . . . OPTION DATA statement . . . FEEDBACK DATA statement . . DL/I call functions . . . . . Examples of DL/I call functions . CALL FUNCTION statement with column-specific SSAs . . . . . DFSDDLT0 call functions . . . COMMENT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 263 264 268 270 270 271 274

. 334 . 337 . 339 . 344

Chapter 9. MFS message formats . . . 345Input message formats . . . . . . . . . Device-dependent input information (3270 or SLU 2). . . . . . . . . . . . . . Output message formats. . . . . . . . . Logical pages . . . . . . . . . . . Segment format . . . . . . . . . . . 345 . . . . 345 347 348 348

. 284 . 285 . 286

iv

Application Programming APIs

Field format (options 1 and 2) . . . . . . . Field format (option 3) . . . . . . . . . Device-dependent output information . . . . Dynamic attribute modification . . . . . . Dynamic modification of extended field attributes . . . . . . . . . . . . . . Dynamic modification of EGCS data . . . . Dynamic modification of DBCS/EBCDIC mixed data . . . . . . . . . . . . . . . Specification of message output descriptor name MFS bypass for the 3270 or SLU 2 . . . . . MFS message formatting functions . . . . . . Input message formatting . . . . . . . . General rules for multiple DPAGE input . . . 3270 and SLU 2 input substitution character . . Input format control for ISC (DPM-Bn) subsystems . . . . . . . . . . . . . Output message formatting. . . . . . . . Output format control for ISC (DPM-Bn) subsystems . . . . . . . . . . . . . Your control of MFS . . . . . . . . . . MFS format sets supplied by IMS . . . . . MFS formatting for the 3270 or SLU 2 master terminal . . . . . . . . . . . . . . MFS Device Characteristics table . . . . . . Version identification function for DPM formats

350 350 351 353 355 360 361 362 363 381 381 401 402 402 404 428 434 445 446 448 449

| | | | | | | | | | | | | | | | | | | | | | | | | | |

java.sql.DatabaseMetaData methods supported javax.sql.DataSource methods supported . . . java.sql.Driver methods supported . . . . . java.sql.ParameterMetaData methods supported java.sql.PreparedStatement methods supported java.sql.Statement methods supported . . . . java.sql.ResultSet methods supported . . . . java.sql.ResultSetMetaData methods supported IMS Universal drivers support for the Common Client Interface . . . . . . . . . . . . . javax.resource.cci.Connection methods supported . . . . . . . . . . . . . javax.resource.cci.ConnectionFactory methods supported . . . . . . . . . . . . . javax.resource.cci.ConnectionMetaData methods supported . . . . . . . . . . . . . javax.resource.cci.Interaction methods supported javax.resource.cci.LocalTransaction methods supported . . . . . . . . . . . . . javax.resource.cci.ResultSetInfo methods supported . . . . . . . . . . . . . javax.resource.cci.ResourceAdapterMetaData methods supported . . . . . . . . . . javax.resource.cci.RecordFactory methods supported . . . . . . . . . . . . . Java API specification for the IMS Universal drivers . . . . . . . . . . . . . . .

482 486 487 487 488 489 490 494 495 495 496 496 497 497 497 498 498 499

Chapter 10. MFS application program design . . . . . . . . . . . . . . 451Relationships between MFS control blocks. . . 3270 or SLU 2 display devices . . . . . . 3290 information panel in partitioned format mode . . . . . . . . . . . . . . 274X, Finance, 3770, SLU 1, NTO, or SLU P . Finance or SLU P workstations . . . . . ISC subsystem (DPM-Bn) . . . . . . . Format library member selection . . . . . . 3270 or SLU 2 screen formatting . . . . . . 3290 screen formatting . . . . . . . . 3180 screen formatting . . . . . . . . Device compatibility with previous versions of MFS . . . . . . . . . . . . . . . Converting MFS 3270 device formats to symbolic name formats using STACK/UNSTACK . . . . . . . . . 3270 device format conversion example . . 3270 printer and SLU 1 compatibility . . . SLU P compatibility . . . . . . . . . Performance factors . . . . . . . . . . All MFS-supported devices . . . . . . . 3270 or SLU 2 display devices . . . . . . 3270 or SLU 2 devices with large screens . . SLU P and ISC subsystems with DPM . . . Loading programmed symbol buffers . . . MFS definitions for intersystem communication . 451 . 456 . . . . . . . . 457 457 458 458 458 461 463 465

Chapter 12. SQL extensions for XML storage and retrieval . . . . . . . . 501retrieveXML UDF . storeXML UDF . . . . . . . . . . . . . . . . . . . . . . . 501 . 503

Chapter 13. XQuery support in the IMS classic JDBC driver. . . . . . . 505XQuery function and operation extensions for IMS ims:particle . . . . . . . . . . . . . ims:gn. . . . . . . . . . . . . . . ims:eq . . . . . . . . . . . . . . . ims:gt . . . . . . . . . . . . . . . ims:ge . . . . . . . . . . . . . . . ims:lt . . . . . . . . . . . . . . . ims:le . . . . . . . . . . . . . . . ims:ne . . . . . . . . . . . . . . . ims:and . . . . . . . . . . . . . . ims:or . . . . . . . . . . . . . . . Example of an expression using XQuery support in the IMS classic JDBC driver . . . . . . . . Standard XQuery features in IMS. . . . . . . XQuery functions and operators supported by IMS Restrictions for using the XQuery support in the IMS classic JDBC driver . . . . . . . . . . 505 505 505 506 507 507 507 508 508 509 509 510 510 511 514

. 465

. . . . . . . . . .

467 468 470 471 471 471 473 474 474 475 477

| |

Chapter 14. DRDA DDM command architecture . . . . . . . . . . . . 517| Overview of the syntax for DDM terms supported | by IMS . . . . . . . . . . . . . . . 517 DSSHDR syntax . . . . . . . . . . . 518 |DDM commit and rollback processing .

Chapter 11. Java reference for the IMS Universal drivers . . . . . . . . . . 481| |IMS Universal drivers support for JDBC . java.sql.Connection methods supported . . . . . 481 . 481

| DDM commands and command objects

. .

. .

. .

. 518 . 519

Contents

v

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

ACCRDB command (X'2001') . . . . . ACCSEC command (X'106D') . . . . . CLSQRY command (X'2005') . . . . . CNTQRY command (X'2006') . . . . . DEALLOCDB command (X'C801') . . . DLIFUNC command object (X'CC05') . . EXCSAT command (X'1041') . . . . . EXCSQLIMM command (X'200A') . . . FLDENTRY command object (X'CC03') . . IMSCALL command (X'C803') . . . . . INAIB command object (X'CC01') . . . OPNQRY command (X'200C') . . . . . RLSE command (X'C802') . . . . . . RTRVFLD command object (X'CC04') . . SECCHK command (X'106E') . . . . . SSALIST command object (X'CC06') . . . DDM reply messages and reply objects . . . ABNUOWRM reply message (X'220D') . . ACCRDBRM reply message (X'2201') . . ACCSECRD reply object (X'14AC') . . . AGNPRMRM reply message (X'1232') . . CMDVLTRM reply message (X'221D') . . DEALLOCDBRM reply message (X'CA01') ENDQRYRM reply message (X'220B') . . ENDUOWRM reply message (X'220C') . . EXCSATRD reply object (X'1443') . . . . IMSCALLRM reply message (X'CA04') . . OPNQFLRM reply message (X'2212') . . OPNQRYRM reply message (X'2205') . . QRYDSC reply object (X'241A') . . . . QRYDTA reply object (X'241B') . . . . QRYPOPRM reply message (X'220F') . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

519 521 522 524 525 526 527 529 531 532 533 534 537 538 539 540 541 541 542 543 544 545 546 546 548 549 550 551 552 554 554 555

| | | | | | | | | | | | |

| | | | | |

RDBAFLRM reply message (X'221A') RDBATHRM reply message (X'2203') RDBNACRM reply message (X'2204') RDBNFNRM reply message (X'2211') RDBUPDRM reply message (X'2218') RLSERM reply message (X'CA03') . RSCLMTRM reply message (X'1233') SECCHKRM reply message (X'1219') SQLERRRM reply message (X'2213') . DDM parameters used by IMS . . . AIBOALEN parameter (X'C904') . . AIBRSNM1 parameter (X'C901') . . AIBRSNM2 parameter (X'C902') . . AIBSFUNC parameter (X'C903') . . aibStream data structure. . . . . dbpcbStream data structure . . . iopcbStream data structure . . . . OUTAIBDBPCB parameter (X'CC02') OUTAIBIOPCB parameter (X'CC08') . RDBNAM parameter (X'2110') . . . SSA parameter (X'C906') . . . . . SSACOUNT parameter (X'C905') . . UPDCNT parameter (X'C90A') . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

556 557 558 559 560 561 562 563 564 565 565 566 566 566 567 567 569 570 570 571 572 572 573

Notices . . . . . . . . . . . . . . 575Programming interface information . Trademarks . . . . . . . . . . . . . . . . . . 577 . 577

Bibliography . . . . . . . . . . . . 579 Index . . . . . . . . . . . . . . . 581

vi

Application Programming APIs

About this informationThese topics provide reference information for the IMS application programming interfaces (APIs), including DL/I, EXEC DL/I, the classic Java APIs for IMS, the IMS Universal drivers, and the Java dependent region resource adapter. The topics also provide reference information for the IMS Adapter for REXX, the DL/I test program (DFSDDLT0), and the IMS Message Format Service (MFS). Guidance information for writing IMS application programs is in IMS Version 11 Application Programming. This information is available as part of the Information Management Software for z/OS Solutions Information Center at http://publib.boulder.ibm.com/infocenter/ imzic. A PDF version of this information is available in the information center.

Prerequisite knowledgeThis book is an API (application programming interface) reference for IMS application programming in any of the following environments: v v v v IMS Database Manager (IMS DB), including IMS Database Control (DBCTL) IMS Transaction Manager (IMS TM) CICS EXEC DLI WebSphere Application Server for z/OS v WebSphere Application Server for distributed platforms v Java dependent regions (JMP and JBP) v Any environment for stand-alone Java application development This book provides reference information for the IMS application programming interfaces (APIs), including DL/I, EXEC DLI, the IMS Universal drivers, and the Java class libraries for IMS. It also provides reference information for the IMS Adapter for REXX, the DL/I test program (DFSDDLT0), and the IMS Message Format Service (MFS). Guidance information for writing IMS application programs is in IMS Version 11 Application Programming. Before using this book, you should understand the concepts of application design described in IMS Version 11 Application Programming, which assumes that you understand basic IMS concepts and the IMS environments. 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++. To write Java applications, you must thoroughly understand the Java language and JDBC. This book assumes that you know Java and JDBC. It does not explain any Java or JDBC concepts. To create the Java database metadata class, which is a required step in writing Java applications for IMS using the IMS Universal drivers or the Java class libraries, you must understand IMS databases. IMS database concepts are described in IMS Version 11 Database Administration.

Copyright IBM Corp. 1974, 2010

vii

To write applications that store or retrieve XML, you must understand XML and its related technologies, such as XML schemas. You can gain an understanding of basic IMS concepts by reading An Introduction to IMS, an IBM Press publication written by Dean H. Meltz, Rick Long, Mark Harrington, Robert Hain, and Geoff Nicholls (ISBN number 0-13-185671-5). An excerpt from this publication is available in the Information Management Software for z/OS Solutions Information Center. IBM offers a wide variety of classroom and self-study courses to help you learn IMS. For a complete list of courses available, go to the IMS home page at www.ibm.com/ims and link to the Training and Certification page.

IMS function names used in this informationIn this information, the term HALDB Online Reorganization refers to the integrated HALDB Online Reorganization function that is part of IMS Version 11, unless otherwise indicated. IMS provides an integrated IMS Connect function, which offers a functional replacement for the IMS Connect tool (program number 5655-K52). In this information, the term IMS Connect refers to the integrated IMS Connect function that is part of IMS Version 11, unless otherwise indicated.

How to read syntax diagramsThe following rules apply to the syntax diagrams that are used in this information: v Read the syntax diagrams from left to right, from top to bottom, following the path of the line. The following conventions are used: The >>--- symbol indicates the beginning of a syntax diagram. The ---> symbol indicates that the syntax diagram is continued on the next line. The >--- symbol indicates that a syntax diagram is continued from the previous line. The --->< symbol indicates the end of a syntax diagram. v Required items appear on the horizontal line (the main path).required_item

v 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 syntax element and is used only for readability.optional_item required_item

v If you can choose from two or more items, they appear vertically, in a stack.

viii

Application Programming APIs

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

If one of the items is the default, it appears above the main path, and the remaining choices are shown below.default_choice required_item optional_choice optional_choice

v An arrow returning to the left, above the main line, indicates an item that 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 repeat the items in the stack. v Sometimes a diagram must be split into fragments. The syntax fragment is shown separately from the main syntax diagram, but the contents of the fragment should be read as if they are on the main path of the diagram.required_item fragment-name

fragment-name:required_item optional_item

v In IMS, a b symbol indicates one blank position. v Keywords, and their minimum abbreviations if applicable, appear in uppercase. They must be spelled exactly as shown. Variables appear in all lowercase italic letters (for example, column-name). They represent user-supplied names or values.About this information

ix

v Separate keywords and parameters by at least one space if no intervening punctuation is shown in the diagram. v Enter punctuation marks, parentheses, arithmetic operators, and other symbols, exactly as shown in the diagram. v Footnotes are shown by a number in parentheses, for example (1).

Accessibility features for IMS Version 11Accessibility features help a user who has a physical disability, such as restricted mobility or limited vision, to use information technology products successfully.

Accessibility featuresThe following list includes the major accessibility features in z/OS products, including IMS Version 11. These features support: v Keyboard-only operation. v Interfaces that are commonly used by screen readers and screen magnifiers. v Customization of display attributes such as color, contrast, and font size. Note: The Information Management Software for z/OS Solutions Information Center (which includes information for IMS Version 11) and its related publications are accessibility-enabled for the IBM Home Page Reader. You can operate all features by using the keyboard instead of the mouse.

Keyboard navigationYou can access IMS Version 11 ISPF panel functions by using a keyboard or keyboard shortcut keys. For information about navigating the IMS Version 11 ISPF panels using TSO/E or ISPF, refer to the z/OS V1R8 TSO/E Primer, the z/OS V1R5 TSO/E User's Guide, and the z/OS V1R9 ISPF User's Guide Volume 1. These guides describe how to navigate each interface, including the use of keyboard shortcuts or function keys (PF keys). Each guide includes the default settings for the PF keys and explains how to modify their functions.

Related accessibility informationOnline documentation for IMS Version 11 is available in the Information Management Software for z/OS Solutions Information Center.

IBM and accessibilitySee the IBM Accessibility Center at www.ibm.com/able for more information about the commitment that IBM has to accessibility.

How to send your commentsYour feedback is important in helping us provide the most accurate and highest quality information. If you have any comments about this or any other IMS information, you can take one of the following actions:

x

Application Programming APIs

v From any topic in the information center at http://publib.boulder.ibm.com/ infocenter/imzic, click the Feedback link at the bottom of the topic and complete the Feedback form. v Send your comments by e-mail to [email protected]. Be sure to include the title, the part number of the title, the version of IMS, and, if applicable, the specific location of the text on which you are commenting (for example, a page number in the PDF or a heading in the information center).

About this information

xi

xii

Application Programming APIs

|

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Changes to the IMS libraryChanges to the IMS library for IMS Version 11 include minor title changes to all the publications, merging four sets of publications, a change to how IMS Messages and Codes are delivered, and a change to the number of formats in which the information is provided. The titles of all PDF publications in the IMS Version 11 library have been changed so that the publication titles match the contents view (navigation tree) titles in the information center. For example, the IMS Diagnosis Guide has been renamed to IMS Diagnosis. In addition, the titles for the three IMS Command Reference PDF volumes have been renamed so that their titles better reflect the contents of each publication, as follows: v IMS Version 11 Commands, Volume 1: IMS Commands A-M v IMS Version 11 Commands, Volume 2: IMS Commands N-V v IMS Version 11 Commands, Volume 3: IMS Component and z/OS Commands Four sets of publications have been streamlined so that information is grouped in a more intuitive, retrievable organization: v To eliminate redundancy and group relevant application programming planning information with associated application programming tasks, the IMS Application Programming Planning Guide has been merged with the IMS Application Programming Guide, in a new title: IMS Version 11 Application Programming. v To group diagnosis reference information with associated diagnosis tasks, the IMS Diagnosis Reference has been merged with the IMS Diagnosis Guide, in a new title: IMS Version 11 Diagnosis. v To group all system administration tasks, regardless of whether the tasks relate to using a single IMS or an IMSplex, the IMS IMSplex Administration Guide has been merged with the IMS System Administration Guide, in a new title: IMS Version 11 System Administration. v To group system definition reference information with associated system definition tasks, the IMS System Definition Reference has been merged with the IMS System Definition Guide, in a new title: IMS Version 11 System Definition. IBM's strategy is to deliver product information in Web-based information centers. Therefore, the IMS Version 11 information is optimized for viewing in the information center (which also includes PDF versions of books) and, except for messages and codes, is not provided in BookManager format. Information centers provide many advantages over PDF and BookManager formats, including: v Improved retrievability: Users can search across the entire information center, or set filters to search categories of information (for example, search only IMS Version 11 information, or search only IMS Version 10 information). Users can also search for information center content by using a search engine such as Google, or from www.ibm.com. v Improved information currency: Users can subscribe to information updates by using RSS feeds. v Accessibility support. v Multi-language support.

Copyright IBM Corp. 1974, 2010

xiii

| | | | | | | | |

Beginning with IMS Version 10, the four volumes of IMS Messages and Codes include messages and codes from IMS Version 10 and all later versions. Individual messages and codes will include version-specific changes, if applicable. Because the same messages and codes volumes support IMS Version 10 and later, those volumes will continue to be available in BookManager format. The following figure illustrates how the IMS Version 11 library is organized in the information center, which is available at http://publib.boulder.ibm.com/ infocenter/imzic.

xiv

Application Programming APIs

|

IMS overview

Changes to the IMS library for IMS Version 11 Licensed Program Specifications Fact sheet Introduction to IMS

Release planning for IMS

Release planning

Installing IMS

Program directory Installation System definition

IMS administration

Communications and connections Database administration Operations and automation System administration

{=

Programming for IMS

Application programming Application programming APIs System programming APIs

Troubleshooting for IMS

Searching for messages and codes Diagnosis IMS messages and codes IRLM messages and codes

IMS reference information

IMS commands Exit routines Database utilities System utilities

IMS glossary Index for IMS Version 11| | | | |Figure 1. Organization of the IMS Version 11 library in the information center

The following table describes high-level user tasks (navigation tree category) and the IMS Version 11 publications that support those tasks.

Changes to the IMS library

xv

| Table 1. High-level user tasks and the IMS Version 11 publications that supports those tasks | Task | (navigation tree In the Information | category) Center | IMS overview | | | | | | | | | | | | | | | | | | | | | | | | | | | | |Release planning for IMS IMS Version 11 Licensed Program Specifications

Contents

PDF

Summarizes the functions and capabilities of IMS, lists PDF hardware and software requirements, and provides licensing and warranty details. PDF

IMS Version 11 Fact Sheet Provides an overview of the IMS Version 11 features. An Introduction to IMS: Your Complete Guide to IBM's Information Management System IMS Version 11 Release Planning Provides the first five chapters of a retail publication that introduces the IMS product and its features.

PDF These topics provide general information to help you evaluate and plan for IMS Version 11. The topics describe the new features and enhancements for IMS Version 11, the hardware and software requirements for these new features and enhancements, considerations for migration and coexistence for IMS Version 11, and an overview of the IMS Tools that are enhanced to work with IMS Version 11. Provides information about the material and procedures that PDF are associated with the installation of IMS Version 11.

Installing IMS

Program Directory for Information Management System Transaction and Database Servers IMS Version 11 Installation

These topics provide guidance information for preparing for an IMS installation process and running the IMS installation verification program (IVP). The topics also describe the sample applications that are provided with IMS.

PDF

IMS Version 11 System Definition

These topics provide guidance information for designing an PDF IMS system, including information about defining and tailoring the IMS system, IMS Common Queue Server (CQS), IMS Common Service Layer (CSL), integrated IMS Connect, and IMS Transport Manager Subsystem (TMS). The topics also include descriptions of the IMS macros, procedures, and members of the IMS PROCLIB data set.

xvi

Application Programming APIs

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Table 1. High-level user tasks and the IMS Version 11 publications that supports those tasks (continued) Task (navigation tree In the Information category) Center IMS administration IMS Version 11 Communications and Connections

Contents These topics describe how to administer IMS communications and connections: CPI Communications and APPC/IMS, facilities for attaching to external subsystems, IMS Extended Terminal Option (ETO), IMS Connect, IMS Universal driver connections, Multiple Systems Coupling (MSC), IMS Open Database Access (ODBA) and database resource adapter (DRA) interfaces, IMS Open Transaction Manager Access (OTMA), SLU P and Finance communication systems, TCP/IP communications, and VTAM networking. These topics describe IMS database types and concepts, and also describe how to design, implement, maintain, modify, back up, and recover IMS databases.

PDF PDF

IMS Version 11 Database Administration IMS Version 11 Operations and Automation

PDF

These topics provide guidance information for selecting tools PDF and options for operating an IMS system, for recovering an IMS system, and for automating IMS operations and recovery tasks. The topics also describe how to develop procedures for the master terminal operator and the end user. These topics provide guidance information for managing the PDF administration and operations of a single IMS or one or more IMS systems that work as a unit (an IMSplex). The topics describe designing, documenting, operating, maintaining, and recovering an IMS system, as well as the Database Recovery Control (DBRC) facility, Remote Site Recovery (RSR), and the Extended Recovery Facility (XRF). The topics also include conceptual information about the IMS Base Primitive Environment (BPE), IMS Common Queue Server (CQS), and IMS Common Service Layer (CSL), all of which can be part of an IMSplex, as well as task information for sharing data and message queues in an IMSplex.

IMS Version 11 System Administration

Changes to the IMS library

xvii

| Table 1. High-level user tasks and the IMS Version 11 publications that supports those tasks (continued) | Task | (navigation tree In the Information | category) Center | Programming | for IMS | | | | | | | | | | | | | | | | | | | | | | | |IMS Version 11 Application Programming

Contents These topics provide guidance information for writing application programs that access IMS databases or IMS transactions. The topics describe how to gather and analyze program requirements, and how to develop and debug IMS application programs. They also describe how to use different programming languages to issue DL/I calls, and include information about the IMS solutions for Java development. They also describe how to use different programming languages to issue EXEC DL/I calls. Application programming interface (API) information is in IMS Version 11 Application Programming APIs.

PDF PDF

IMS Version 11 Application Programming APIs

PDF These topics provide reference information for the IMS application programming interfaces (APIs), including DL/I, EXEC DL/I, the classic Java APIs for IMS, the IMS Universal drivers, and the Java dependent region resource adapter. The topics also provide reference information for the IMS Adapter for REXX, the DL/I test program (DFSDDLT0), and the IMS Message Format Service (MFS). Guidance information for writing IMS application programs is in IMS Version 11 Application Programming. These topics provide reference information for IMS system application programming interface (API) calls for IMS Common Queue Server (CQS); IMS Common Service Layer (CSL); IMS data propagation with IMS DataPropagator for z/OS; IMS Database Resource Adapter (DRA); and the IMS Database Recovery Control (DBRC) facility. PDF

IMS Version 11 System Programming APIs

xviii

Application Programming APIs

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Table 1. High-level user tasks and the IMS Version 11 publications that supports those tasks (continued) Task (navigation tree In the Information category) Center Troubleshooting for IMS

Contents

PDF PDF

IMS Version 11 Diagnosis These topics provide guidance and reference information for setting up an IMS system for diagnosis, collecting information to help diagnose IMS problems, and searching problem-reporting databases, such as the IBM Electronic Incident Submission (EIS) Web site. These topics also describe how to use keywords to develop a failure description that you can use to search problem-reporting databases and communicate with IBM Software Support. IMS Messages and Codes, These topics provide reference information for the IMS Volume 1: DFS Messages messages that have the DFS prefix, along with their associated return codes. The topics also provide diagnostic information that helps programmers, operators, and system-support personnel diagnose problems in IMS. IMS messages with other prefixes are in IMS Messages and Codes, Volume 2: Non-DFS Messages.

PDF

PDF IMS Messages and Codes, These topics provide reference information for Volume 2: Non-DFS non-DFS-prefixed IMS messages that are associated with IMS Messages Base Primitive Environment (BPE); IMS Common Queue Server (CQS); IMS Common Service Layer (CSL); Database Recovery Control (DBRC); and integrated IMS Connect. The topics also provide diagnostic reference information that helps programmers, operators, and system-support personnel diagnose problems in IMS. IMS messages that have the DFS prefix are in IMS Messages and Codes, Volume 1: DFS Messages. IMS Messages and Codes, These topics provide reference information for all IMS abnormal termination (abend) codes, including analysis, Volume 3: IMS Abend explanation, possible causes, and APAR processing Codes instructions. IMS Messages and Codes, These topics provide return, reason, sense, function, and status codes for IMS Base Primitive Environment (BPE); IMS Volume 4: IMS Common Queue Server (CQS); IMS Common Service Layer Component Codes (CSL); Database Recovery Control (DBRC) facility; and integrated IMS Connect. The topics also provide diagnostic reference information that helps programmers, operators, and system-support personnel diagnose problems in IMS. IMS abend codes are in IMS Messages and Codes, Volume 3: IMS Abend Codes. IRLM Messages and Codes for IMS and DB2 for z/OS These topics describe the IRLM messages and codes issued by the internal resource lock manager (IRLM) to IMS. PDF

PDF

PDF

Changes to the IMS library

xix

| Table 1. High-level user tasks and the IMS Version 11 publications that supports those tasks (continued) | Task | (navigation tree In the Information | category) Center | IMS reference | information | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |IMS Version 11 Commands, Volume 1: IMS Commands A-M

Contents These topics provide command syntax and usage information for the IMS type-1 and type-2 commands /ACTIVATE through /MSVERIFY. The topics also describe the IMS command language and how to send commands to IMS in different environments. Information about all non-type-1 and non-type-2 IMS commands is in IMS Version 11 Commands, Volume 3: IMS Component and z/OS Commands. These topics provide command syntax and usage information for the IMS type-1 and type-2 commands /NRESTART through /VUNLOAD. The topics also describe the IMS command language and how to send commands to IMS in different environments. Information about all non-type-1 and non-type-2 IMS commands is in IMS Version 11 Commands, Volume 3: IMS Component and z/OS Commands.

PDF PDF

IMS Version 11 Commands, Volume 2: IMS Commands N-V

PDF

IMS Version 11 Commands, Volume 3: IMS Component and z/OS Commands

PDF These topics provide command syntax and usage information for the following types of IMS commands: Base Primitive Environment (BPE); Common Service Layer (CSL); Database Recovery Control (DBRC) facility; IMS Transport Manager Subsystem (TMS); integrated IMS Connect; and the z/OS commands for IMS. Information about IMS type-1 and type-2 commands is in IMS Version 11 Commands, Volume 1: IMS Commands A-M and IMS Version 11 Commands, Volume 2: IMS Commands N-V. These topics provide reference information for the exit routines that you can use to customize IMS database, system, transaction management, IMSplex, Base Primitive Environment (BPE), Common Queue Server (CQS), and integrated IMS Connect environments. These topics provide reference information for the utilities that you can use to migrate, reorganize, and recover a database. PDF

IMS Version 11 Exit Routines

IMS Version 11 Database Utilities IMS Version 11 System Utilities

PDF

PDF These topics provide reference information for the utilities that you can use with the IMS system to generate IMS resources, analyze IMS activity, manage IMS logging, run the IMS Database Recovery Control (DBRC) facility, maintain IMS networking services, convert Security Maintenance utility (SMU) source, and maintain the resource definition data sets (RDDSs). Provides a central index for all the IMS Version 11 PDF information, as well as a glossary of IMS terms. Although the combined IMS Version 11 Master Index and Glossary is available in PDF format, the index does not include links. The IMS master index is included in the information center under IMS Version 11 Index for IMS Version 11. The information center master index provides live links to topics. The IMS glossary is included in the information center under IMS Version 11 IMS glossary.

IMS Version 11 Master Index and Glossary

xx

Application Programming APIs

|

Chapter 1. DL/I calls for database managementUse the following DL/I calls to access and administer IMS databases.

DL/I calls for database managementUse these DL/I calls with IMS DB to perform database management functions in your application program. Each call description contains: v A syntax diagram v Definitions for parameters that are available to the call v Details on how to use the call in your application program v Restrictions on call usage, where applicable Each parameter is described as an input parameter or output parameter. Input refers to input to IMS from the application program. Output refers to output from IMS to the application program. Database management calls must use either db pcb or aib parameters. The syntax diagrams for these calls begin with the function parameter. The call, call interface (xxxTDLI), and parmcount (if it is required) are not included in the syntax diagrams. Related reading: For specific information about coding your program in assembler language, C language, COBOL, Pascal, and PL/I, see the topic "Defining Application Program Elements" in IMS Version 11 Application Programming. Related reference DL/I calls for IMS TM system services on page 107 DL/I calls for transaction management on page 73 Chapter 3, EXEC DLI commands, on page 145

Database management call summaryThe following table shows the parameters that are valid for each database management call. Optional parameters are enclosed in brackets ([ ]). Restriction: Language-dependent parameters are not shown here. The variable parmcount is required for all PLITDLI calls. Either parmcount or VL is required for assembler language calls. Parmcount is optional in COBOL, C, and Pascal programs. Related reading: For more information on language-dependent application elements, see the topic "Defining Application Program Elements" in IMS Version 11 Application Programming.

Copyright IBM Corp. 1974, 2010

1

Table 2. Summary of DB calls Function Code CIMS Meaning and Use Options Initializes and terminates the ODBA interface in a z/OS application region. Close Dequeue Closes a GSAM database explicitly Releases segments reserved by Q command code Removes a segment and its dependents from the database Accesses a field within a segment Retrieves subsequent message segments Retrieves dependents sequentially Retrieves segments and establishes a starting position in the database Retrieves subsequent message segments Retrieves dependents sequentially Retrieves segments and establishes a starting position in the database Loads and adds one or more segments to the database Opens a GSAM database explicitly Retrieves the location of a specific dependent or last-inserted sequential dependent segment Changes values of one or more fields in a segment Parameters aib Valid for DB/DC, IMS DB

CLSE DEQ

function, gsam pcb or DB/DC, DBCTL, DB aib batch, ODBA function, i/o pcb (full DB batch, BMP, MPP, function only), or aib, IFP, DBCTL, ODBA i/o area (full function only) function, db pcb or aib, i/o area, [ssa] function, db pcb or aib, i/o area, rootssa function, db pcb or aib, i/o area, [ssa] function, db pcb or aib, i/o area, [ssa] function, db pcb or aib, i/o area, [ssa] DB/DC, DBCTL, DB batch, ODBA DB/DC, ODBA DB/DC, DBCTL, DB batch, ODBA DB/DC, DBCTL, DB batch, ODBA DB/DC, DBCTL, DB batch, ODBA

DLET

Delete

FLD GHN GHNP GHU

Field Get Hold Next Get Hold Next in Parent Get Hold Unique

GN

Get Next

function, db pcb or aib, i/o area, [ssa or rsa] function, db pcb or aib, i/o area, [ssa] function, db pcb or aib, i/o area, [ssa or rsa] function, db pcb or aib, i/o area, [ssa or rsa]

DB/DC, DBCTL, DB batch, ODBA DB/DC, DBCTL, DB batch, ODBA DB/DC, DBCTL, DB batch, ODBA

GNP GU

Get Hold Next in Parent Get Unique

ISRT

Insert

DB/DC, DCCTL, DB batch, ODBA

OPEN POS

Open Position

function, gsam pcb or DB/DC, DBCTL, DB aib, [i/o area] batch, ODBA function, db pcb or aib, i/o area, [ssa] DB/DC, DBCTL, DB batch, ODBA

REPL

Replace

function, db pcb or aib, i/o area, [ssa]

DB/DC, DBCTL, DB batch, ODBA DB/DC, DBCTL, DB batch, ODBA

RLSE

Release Locks

Releases all locks held function, db pcb for unmodified data

2

Application Programming APIs

CIMS callThe CIMS call is used to initialize and terminate the ODBA interface in a z/OS application region.

FormatCIMS aib

Call Name CIMS

DB/DC X

IMS DB X

DCCTL

DB Batch

TM Batch

Parametersaib Specifies the application interface block (AIB) that is used for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye-catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Character value. AIBSFUNC Subfunction code. This field must contain one of the 8-byte subfunction codes as follows: INIT AIBRSNM2. A 4-character ID of the ODBA startup table. CONNECT AIBRSA1. Address of the CONNECT parameter list. The following table shows the CIMS CONNECT parameter list format.Table 3. CIMS CONNECT parameter list format Offset X'00' X'04' Length X'04' X'04' Field Input Input Usage description Count of connect request table entries. Address of the connect request table.

TERM AIBRSNM2. A 4-character ID of the ODBA startup table that represents the IMS connection that is to be terminated. TALL Terminate all IMS connections.

UsageThe CIMS call is used by an application program that is running in an application address space to establish or terminate the ODBA environment.Chapter 1. DL/I calls for database management

3

INITbbbb The CIMS subfunction INIT must be issued by the application to establish the ODBA environment in the z/OS application address space. Optionally, AIBRSNM2 can specify the 4-character ID of the ODBA Startup table member. This member is named DFSxxxx0 where xxxx is equal to the 4-character ID. If AIBRSNM2 is specified, ODBA tries to establish a connection to the IMS specified in the DFSxxxx0 member after the ODBA environment is initialized in the z/OS application address space. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONNECTb Use the CIMS CONNECT call to establish multiple ODBA connections to IMS systems from the CSL Open Database Manager (ODBM). A CIMS CONNECT call can be issued instead of, or in addition to, a CIMS INIT call. A CIMS CONNECT call will initialize ODBA if ODBA has not already been initialized. To complete initialization only, issue a CIMS CONNECT call with AIBRSA1 set to -1 (X'FFFFFFFF'). The connect request table contains one or more connect request entries in contiguous storage. Each entry contains the following fields: v A 1- to 4-character alias name, left justified and padded on the right with blanks. The alias name is the value (cccc) taken from the startup properties table DFScccc0. This parameter is required. v A 4-byte address of the connection properties table (DFSPRP) or 0. A value of 0 indicates that ODBA must load DFScccc0 to obtain the IMS connection properties. This member is constructed by specifying the DFSPRP macro in DFScccc0, and then assembling and linking the member. This member must be in the STEPLIB or JOBLIB of the ODBA application job. A nonzero value indicates that the caller is passing the address of the connection properties parameter table. The connection properties parameters are mapped by the DFSPRP macro. v A 4-byte field to contain the connection request return code. The return code is one of the AIBRETRN codes. v A 4-byte field to contain the connection request reason code. The reason code is one of the AIBREASN codes. v A 4-byte field to contain the connection request error extension information code. The error extension contains additional diagnostic information specific to the return and reason codes. The following table summarizes the CIMS CONNECT table entry format.Table 4. CIMS CONNECT table entry format Offset X'00' Length X'04' Field Input Usage description 1- to 4-character IMS alias name (cccc) from the startup properties table DFScccc0, where cccc is the alias name.

4

Application Programming APIs

| | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Table 4. CIMS CONNECT table entry format (continued) Offset X'04' Length X'04 Field Input Usage description 0 or the address of an ODBA startup properties table. A value of 0 indicates that ODBA must load a startup properties table named DFScccc0, where cccc is the supplied alias name. An address indicates that the caller is supplying the startup properties table. The table is mapped by the DFSPRP macro. X'08' X'04' Output Connect request return code for this entry. Connect request reason code for this entry. Connect request error extension code for this entry.

X'0C'

X'04'

Output

X'10'

X'04'

Output

TERMbbbb The CIMS subfunction TERM can be issued to terminate one IMS connection. AIBRSNM2 specifies the 4-character ID of the startup table member that represents the IMS connection to be terminated. On completion of the TERM subfunction, the ODBA environment remains intact in the z/OS application address space. Note: If the application that issued CIMS INIT chooses to return to the operating system following completion of the CIMS TERM, the address space will terminate with a system abend A03. This can be avoided by issuing the CIMS TALL prior to returning to the operating system TALLbbbb The CIMS subfunction TALL must be issued to terminate all IMS connections and terminate the ODBA environment in the application address space.

CLSE callThe close (CLSE) call is used to explicitly close a GSAM database. For more information on GSAM, see the topic "Processing GSAM Databases" in IMS Version 11 Application Programming.

Chapter 1. DL/I calls for database management

5

FormatCLSE gsam pcb aib

Call Name For GSAM: CLSE

DB/DC X

DBCTL X

DCCTL X

DB Batch X

TM Batch X

Parametersgsam pcb Specifies the GSAM PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB length. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a GSAM PCB.

UsageFor information on using CLSE, see the topic "Explicit Open and Close Calls to GSAM" in IMS Version 11 Application Programming.

DEQ callThe Dequeue (DEQ) call is used to release a segment that is retrieved using the Q command code.

Format (full function)DEQ i/o pcb aib i/o area

Format (Fast Path DEDB)DEQ DEDB pcb aib

Call Name For Full-Function and DEDB: DEQ

DB/DC X

DBCTL X

DCCTL

DB Batch X

TM Batch

6

Application Programming APIs

ParametersDEDB pcb (Fast Path only) Specifies any DEDB PCB for the call. i/o pcb (full function only) Specifies the I/O PCB for the DEQ call. This is an input and output parameter. aib Specifies the AIB for the call. This is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the PCB name IOPCB . AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area (full function only) Specifies the 1-byte area containing a letter (A-J), which represents the lock class of the locks to be released. This is a mandatory input parameter.

UsageThe DEQ call releases all segments that are retrieved using the Q command code, except: v Segments modified by your program, until your program reaches a commit point v Segments required to keep your position in the hierarchy, until your program moves to another database record v A class of segments that has been locked using a different lock class If your program only reads segments, it can release them by issuing a DEQ call. If your program does not issue a DEQ call, IMS releases the reserved segments when your program reaches a commit point. By releasing the segments with a DEQ call before your program reaches a commit point, you make them available to other programs more quickly. For more information on the relationship between the DEQ call and the Q command code, see the topic "Reserving Segments for the Exclusive Use of Your Program" in IMS Version 11 Application Programming.

RestrictionsIn a CICS DL/I environment, calls made from one CICS (DBCTL) system are supported in a remote CICS DL/I environment, if the remote environment is also CICS (DBCTL).

DLET callThe Delete (DLET) call is used to remove a segment and its dependents from the database.Chapter 1. DL/I calls for database management

7

FormatDLET db pcb aib i/o area

ssa

Call Name For Full-Function: For DEDB: For MSDB: DLET DLET DLET

DB/DC X X X

DBCTL X X

DCCTL

DB Batch X

TM Batch

Parametersdb pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a DB PCB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area Specifies the I/O area in your program that communicates with IMS. This parameter is an input parameter. Before deleting a segment, you must first issue a Get Hold call to place the segment in the I/O area. You can then issue the DLET call to delete the segment and its dependents in the database. ssa Specifies the SSA, if any, to be used in the call. This parameter is an input parameter. The SSA that you supply in the call point to data areas in your program where the SSAs have been defined for the call. You can use only one SSA in the parameter. This parameter is optional for the DLET call.

UsageThe DLET call must be preceded by one of the three Get Hold calls. When you issue the DLET call, IMS deletes the held segment, along with all its physical dependents from the database, regardless of whether your program is sensitive to all of these segments. IMS rejects the DLET call if the preceding call for the PCB was not a Get Hold, REPL, or DLET call. If the DLET call is successful, the previously retrieved segment and all of its dependents are removed from the database and cannot be retrieved again.

8

Application Programming APIs

If the Get Hold call that precedes the DLET call is a path call, and you do not want to delete all the retrieved segments, you must indicate to IMS which of the retrieved segments (and its dependents, if any) you want deleted; to do this, specify an unqualified SSA for that segment. Deleting a segment this way automatically deletes all dependents of the segment. Only one SSA is allowed in the DLET call, and this is the only time a SSA is applicable in a DLET call. No command codes apply to the DLET call. If you use a command code in a DLET call, IMS disregards the command code.

FLD callThe Field (FLD) call is used to access a field within a segment for MSDBs or DEDBs.

FormatFLD db pcb aib i/o area

ssa

Call Name For MSDB: For DEDB: FLD FLD

DB/DC X X

DBCTL

DCCTL

DB Batch

TM Batch

X

Parametersdb pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a DB PCB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area Specifies your program's I/O area, which contains the field search argument (FSA) for this call. This parameter is an input parameter. ssa Specifies the SSA, if any, that you want to use in this call. You can use up to 15 SSAs in this input parameter. The SSA that you supply will point to those data areas that you have defined for the call. This parameter is optional for the FLD call.Chapter 1. DL/I calls for database management

9

UsageUse the FLD call to access and change the contents of a field within a segment. The FLD call does two things for you: it compares the value of a field to the value you supply (FLD/VERIFY), and it changes the value of the field in the way that you specify (FLD/CHANGE). All DL/I command codes are available to DEDBs, using the FLD call. The FLD call formats for DEDBs are the same as for other DL/I calls. So, if your MSDBs have been converted to DEDBs, you do not need to change application programs that use the FLD call. For more information on the FLD call, see the topic "Updating Segments: REPL, DLET, ISRT, and FLD" in IMS Version 11 Application Programming. You can also use the FLD call in application programs for DEDBs, instead of the combination of GHU, REPL, and DL/I calls.

FSAsThe field search argument (FSA) is equivalent to the I/O area that is used by other DL/I database calls. For a FLD call, data is not moved into the I/O area; rather, the FSAs are moved into the I/O area. Multiple FSAs are allowed on one FLD call. This is specified in the FSA's connector field. Each FSA can operate on either the same or different fields within the target segment. The FSA that you reference in a FLD call contains five fields. The rules for coding these fields are as follows: Field name This field must be 8 bytes long. If the field name you are using is less than 8 bytes, the name must be left-justified and padded on the right with blanks. FSA status code This field is 1 byte. After a FLD call, IMS returns one of these status codes to this area: Successful A B C D E F G H Invalid operation Operand length invalid Invalid callprogram tried to change key field Verify check was unsuccessful Packed decimal or hexadecimal field is invalid Program tried to change an unowned segment Arithmetic overflow Field not found in segment

Op code This 1-byte field contains one of these operators for a change operation: + To add the operand to the field value To subtract the operand from the field value

10

Application Programming APIs

=

To set the field value to the value of the operand

For a verify operation, this field must contain one of the following: E G H L M N Verify that the field value and the operand are equal. Verify that the field value is greater than the operand. Verify that the field value is greater than or equal to the operand. Verify that the field value is less than the operand. Verify that the field value is less than or equal to the operand. Verify that the field value is not equal to the operand.

Operand This variable length field contains the value that you want to test the field value against. The data in this field must be the same type as the data in the segment field. (You define this in the DBD.) If the data is hexadecimal, the value in the operand is twice as long as the field in the database. If the data is packed decimal, the operand does not contain leading zeros, so the operand length might be shorter than the actual field. For other types of data, the lengths must be equal. Connector This 1-byte field must contain a blank if this is the last or only FSA, or an asterisk (*) if another FSA follows this one. The format of SSA in FLD calls is the same as the format of SSA in DL/I calls. If no SSA exists, the first segment in the MSDB or DEDB is retrieved. For more information on the FLD call and some examples, see the topic "Processing MSDBs and DEDBs" in IMS Version 11 Application Programming.

GN/GHN callThe Get Next (GN) call is used to retrieve segments sequentially from the database. The Get Hold Next (GHN) is the hold form for a GN call.

FormatGN db pcb aib i/o area

ssa rsa GHN db pcb aib i/o area

ssa

Call Name For Full-Function: For GSAM: For DEDB: For MSDB: GN/GHN GN GN GN

DB/DC X X X X

DBCTL X X X

DCCTL

DB Batch X

TM Batch

X X

X

X

Chapter 1. DL/I calls for database management

11

Parametersdb pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a DB PCB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area Specifies the I/O area. This parameter is an output parameter. When you issue one of the Get calls successfully, IMS returns the requested segment to this area. If your program issues any path calls, the I/O area must be long enough to hold the longest path of concatenated segments following a path call. This area always contains left-justified segment data. The I/O area points to the first byte of this area. When you use the GN call with GSAM, the area named by the i/o area parameter contains the record you are retrieving. ssa Specifies the SSA, if any, to be used in the call. This parameter is an input parameter. The SSA that you supply in the call point to data areas in your program where the SSA have been defined for the call. You can use up to 15 SSAs in the parameter. This parameter is optional for the GN call. rsa Specifies the area in your program where the RSA for the record should be returned. This output parameter is used for GSAM only and is optional. See the topic "GSAM Data Areas" in IMS Version 11 Application Programming for more information on RSAs.

Usage: Get Next (GN)A Get Next (GN) call is a request for a segment, as described by the SSA you supply, that is linked to the call that was issued prior to the GN call. IMS starts its search at the current position. When you use the GN call: v Processing moves forward from current position (unless the call includes the F command code). v IMS uses the current position (that was set by the previous call) as the search starting point. v The segment retrieved is determined by a combination of the next sequential position in the hierarchy and the SSA included in the call.

12

Application Programming APIs

v Be careful when you use GN, because it is possible to use SSAs that force IMS to search to the end of the database without retrieving a segment. This is particularly true with the not equal or greater than relational operators. A GN call retrieves the next segment in the hierarchy that satisfies the SSA that you supplied. Because the segment retrieved by a GN call depends on the current position in the hierarchy, GN is often issued after a GU call. If no position has been established in the hierarchy, GN retrieves the first segment in the database. A GN call retrieves a segment or path of segments by moving forward from the current position in the database. As processing continues, IMS looks for segments at each level to satisfy the call. For example, sequential retrieval in a hierarchy is always top to bottom and left to right. For example, if you repeatedly issue unqualified GN calls against the hierarchy in the following figure, IMS returns the segment occurrences in the database record in this order: 1. A1 (the root segment) 2. B1 and its dependents (C1,D1,F1,D2,D3,E1,E2, and G1) 3. H1 and its dependents (I1,I2,J1, and K1). If you issue an unqualified GN again after IMS has returned K1, IMS returns the root segment occurrence whose key follows segment A1 in the database. A GN call that is qualified with the segment type can retrieve all the occurrences of a particular segment type in the database.

Figure 2. Hierarchic sequence

For example, if you issue a GN call with qualified SSAs for segments A1 and B1, and an unqualified SSA for segment type D, IMS returns segment D1 the first time you issue the call, segment D2 the second time you issue the call, and segment D3 the third time you issue the call. If you issue the call a fourth time, IMS returns a status code of GE, which means that IMS could not find the segment you requested.

Chapter 1. DL/I calls for database management

13

You can use unqualified GN calls to retrieve all of the occurrences of a segment in a hierarchy, in their hierarchic sequence, starting at the current position. Each unqualified GN call retrieves the next sequential segment forward from the current position. For example, to answer the processing request: Print out the entire medical database. You would issue an unqualified GN call repeatedly until IMS returned a GB status code, indicating that it had reached the end of the database without being able to satisfy your call. If you issued the GN again after the GB status code, IMS would return the first segment occurrence in the database. Like GU, a GN call can have as many SSAs as the hierarchy has levels. Using fully qualified SSAs with GN calls clearly identifies the hierarchic path and the segment you want, thus making it useful in documenting the call. A GN call with an unqualified SSA retrieves the next occurrence of that segment type by going forward from the current position. GN with a qualified SSA retrieves the next occurrence of the specified segment type that satisfies the SSAs. When you specify a GN that has multiple SSAs, the presence or absence of unqualified SSAs in the call has no effect on the operation unless you use command codes on the unqualified SSA. IMS uses only qualified SSAs plus the last SSA to determine the path and retrieve the segment. Unspecified or unqualified SSAs for higher-level segments in the hierarchy mean that any high-level segment that is the parent of the correct lower-level, specified or qualified segment will satisfy the call. A GN call with a SSA that is qualified on the key of the root can produce different results from a GU with the same SSA, depending on the position in the database and the sequence of keys in the database. If the current position in the database is beyond a segment that would satisfy the SSA, the segment is not retrieved by the GN. GN returns the GE status code if both of these conditions are met: v The value of the key in the SSA has an upper limit that is set, for example, to less-than-or-equal-to the value. v A segment with a key greater than the value in the SSA is found in a sequential search before the specified segment is found. GN returns the GE status code, even though the specified segment exists and would be retrieved by a GU call. Note: If you use the IMS Enterprise Suite DLIModel utility plug-in to generate an XML schema of the database, you can use XQuery support in IMS to retrieve results using SSAs.

Usage: Get Hold Next (GHN)Before your program can delete or replace a segment, it must retrieve the segment and indicate to IMS that it is going to change the segment in some way. The program does this by issuing a Get call with a hold before deleting or replacing the segment. When the program has successfully retrieved the segment with a Get Hold call, it can delete the segment or change one or more fields (except the key field) in the segment.

14

Application Programming APIs

The only difference between Get calls with a hold and Get calls without a hold is that the hold calls can be followed by REPL or DLET. The hold status on the retrieved segment is canceled and must be reestablished before you reissue the DLET or REPL call. After issuing a Get Hold call, you can issue more than one REPL or DLET call to the segment if you do not issue intervening calls to the same PCB. If you find out that you do not need to update it after issuing a Get Hold call, you can continue with other processing without releasing the segment. The segment is freed as soon as the current position changeswhen you issue another call to the same PCB that you used for the Get Hold call. In other words, a Get Hold call must precede a REPL or DLET call. However, issuing a Get Hold call does not require you to replace or delete the segment.

Usage: HDAM, PHDAM, or DEDB database with GNFor database organizations other than HDAM, PHDAM, and DEDB, processing the database sequentially using GN calls returns the root segments in ascending key sequence. However, the order of the root segments for a HDAM, PHDAM, or DEDB database depends on the randomizing routine that is specified for that database. Unless a sequential randomizing routine was specified, the order of the root segments in the database is not in ascending key sequence. For a hierarchic direct access method (HDAM, PHDAM) or a DEDB database, a series of unqualified GN calls or GN calls that are qualified only on the root segment: 1. Returns all the roots from one anchor point 2. Moves to the next anchor point 3. Returns the roots from the anchor point Unless a sequential randomizing routine was specified, the roots on successive anchor points are not in ascending key sequence. One situation to consider for HDAM, PHDAM, and DEDB organizations is when a GN call is qualified on the key field of the root segment with an equal-to operator or an equal-to-or-greaterthan operator. If IMS has an existing position in the database, it checks to ensure that the requested key is equal to or greater than the key of the current root. If it is not, a GE status code is returned. If it is equal to or greater than the current key and is not satisfied using the current position, IMS calls the randomizing routine to determine the anchor point for that key. IMS tries to satisfy the call starting with the first root of the selected anchor.

RestrictionsYou can use GN to retrieve the next record of a GSAM database, but GHN is not valid for GSAM. Related reference Chapter 13, XQuery support in the IMS classic JDBC driver, on page 505 GNP/GHNP call

GNP/GHNP callThe Get Next in Parent (GNP) call is used to retrieve dependents sequentially. The Get Hold Next in Parent (GHNP) call is the hold form for the GNP call.

Chapter 1. DL/I calls for database management

15

FormatGNP GHNP db pcb aib i/o area

ssa

Call Name For Full-Function: For DEDB: For MSDB: GNP/GHNP GNP/GHNP GNP/GHNP

DB/DC X X X

DBCTL X X

DCCTL

DB Batch X

TM Batch

X

Parametersdb pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a DB PCB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area Specifies the I/O area. This parameter is an output parameter. When you issue the Get call successfully, IMS returns the requested segment to this area. If your program issues any path calls, the I/O area must be long enough to hold the longest path of concatenated segments following a path call. The segment data that this area contains is always left-justified. The I/O area points to the first byte of this area. ssa Specifies the SSA, if any, to be used in the call. This parameter is an input parameter. The SSA you supply in the call point to data areas in your program in which you have defined the SSAs for the call. You can use up to 15 SSAs for this parameter. This parameter is optional for the GNP call.

Usage: Get Next in Parent (GNP)A GNP call retrieves segments sequentially. The difference between a GN and a GNP is that GNP limits the segments that can satisfy the call to the dependent segments of the established parent.

16

Application Programming APIs

An unqualified GNP retrieves the first dependent segment occurrence under the current parent. If your current position is already on a dependent of the current parent, an unqualified GNP retrieves the next segment occurrence. If you are moving forward in the database, even if you are not retrieving every segment in the database, you can use GNP to restrict the returned segments to only those children of a specific segment. Linking with previous DL/I calls A GNP call is linked to the previous DL/I calls that were issued by your program in two ways: v Current position: The search for the requested segment starts at the current position established by the preceding GU, GN, or GNP call. v Parentage: The search for the requested segment is limited to the dependents of the lowest-level segment most recently accessed by a GU or GN call. Parentage determines the end of the search and is in effect only following a successful GU or GN call. Processing with parentage You can set parentage in two ways: v By issuing a successful GU or GN call. When you issue a successful GU or GN call, IMS sets parentage at the lowest-level segment returned by the call. Issuing another GU or GN call (but against a different PCB) does not affect the parentage that you set using the first PCB in the previous call. An unsuccessful GU or GN call cancels parentage. v By using the P command code with a GU, GN, or GNP call, you can set parentage at any level. How DL/I calls affect parentage A GNP call does not affect parentage unless it includes the P command code. Unless you are using a secondary index, REPL does not affect parentage. If you are using a secondary index, and you replace the indexed segment, parentage is lost. For more information, see the topic "How Secondary Indexing Affects Your Program" in IMS Version 11 Application Programming. A DLET call does not affect parentage unless you delete the established parent. If you do delete the established parent, you must reset parentage before issuing a GNP call. ISRT affects parentage only when you insert a segment that is not a dependent of the established parent. In this case, ISRT cancels parentage. If the segment you are inserting is a dependent at some level of the established parent, parentage is unaffected. For example, in the topic "Hierarchy after Adding New Segments and Dependents" in IMS Version 11 Application Programming, assume segment B11 is the established parent. Neither of these two ISRT calls would affect parentage:ISRT (AKEY (BKEY = B11) CChapter 1. DL/I calls for database management

A = A1) B

17

ISRT (AKEY = A1) (BKEY = )

A

B

C (CKEY = C111) D

The following ISRT call would cancel parentage, because the F segment is not a direct dependent of B, the established parent:ISRT (AKEY = A1) A

F

You can include one or more SSAs in a GNP call. The SSA can be qualified or unqualified. Without SSAs, a GNP call retrieves the next sequential dependent of the established parent. The advantage of using SSAs with GNP is that they allow you to point IMS to a specific dependent or dependent type of the established parent. A GNP with an unqualified SSA sequentially retrieves the dependent segment occurrences of the segment type you have specified under the established parent. A GNP with a qualified SSA describes to IMS the segment you want retrieved or the segment that is to become part of the hierarchic path to the segment you want retrieved. A qualified GNP describes a unique segment only if it is qualified on a unique key field and not a data field or a non-unique key field. A GNP with multiple SSAs defines the hierarchic path to the segment you want. If you specify SSAs for segments at levels above the established parent level, those SSAs must be satisfied by the current position at that level. If they cannot be satisfied using the current position, a GE status code is returned and the existing position remains unchanged. The last SSA must be for a segment that is below the established parent level. If it is not, a GP status code is returned. Multiple unqualified SSAs establish the first occurrence of the specified segment type as part of the path you want. If some SSAs between the parent and the requested segment in a GNP call are missing, they are generated internally as unqualified SSAs. This means that IMS includes the first occurrence of the segment from the missing SSAs as part of the hierarchic path to the segment you have requested.

Usage: Get Hold Next in Parent (GHNP)Retrieval for the GHNP call is the same as for the GHN call.

18

Application Programming APIs

Related reference GN/GHN call on page 11

GU/GHU callThe Get Unique (GU) call is used to directly retrieve segments and to establish a starting position in the database for sequential processing. The Get Hold Unique (GHU) is the hold form for a GU call.

FormatGU db pcb aib i/o area

ssa rsa GHU db pcb aib i/o area

ssa

Call Name For Full-Function: For GSAM: For DEDB: For MSDB: GU/GHU GU GU GU

DB/DC X X X X

DBCTL X X X

DCCTL

DB Batch X

TM Batch

X X

X

X

Parametersdb pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a DB PCB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area Specifies the I/O area. This parameter is an output parameter. When you issue one of the Get calls successfully, IMS returns the requested segment to this area. If your program issues any path calls, the I/O area must be long enough

Chapter 1. DL/I calls for database management

19

to hold the longest path of concatenated segments following a path call. The segment data that this area contains is always left-justified. The I/O area points to the first byte of this area. When you use the GU call with GSAM, the area named by the i/o area parameter contains the record you are retrieving. ssa Specifies the SSA, if any, to be used in the call. This parameter is an input parameter. The SSA you supply in the call point to data areas in your program where you have defined the SSAs for the call. You can use up to 15 SSAs for the parameter. This parameter is optional for the GU call. rsa Specifies the area in your program that contains the record search argument. This required input parameter is only used for GSAM. See the topic "GSAM Data Areas" in IMS Version 11 Application Programming for more information on RSAs.

Usage: Get Unique (GU)GU is a request for a segment, as described by the SSAs you supply. You use it when you want a specific segment. You can also use it to establish your position in the database. The GU call is the only call that can establish position backward in the database. (The GN and GNP calls, when used with the F command code, can back up in the database, but with limitations. Unlike GN and GNP, a GU call does not move forward in the database automatically. If you issue the same GU call repeatedly, IMS retrieves the same segment each time you issue the call. If you want to retrieve only particular segments, use fully qualified GUs for these segments instead of GNs. If you want to retrieve a specific segment occurrence or obtain a specific position within the database, use GU. If you want to retrieve a specific segment or to set your position in the database to a specific place, you generally use qualified GU calls. A GU call can have the same number of SSAs as the hierarchy has levels, as defined by the DB PCB. If the segment you want is on the fourth level of the hierarchy, you can use four SSAs to retrieve the segment. (No reason would ever exist to use more SSAs than levels in the hierarchy. If your hierarchy has only three levels, you would never need to locate a segment lower than the third level.) The following is additional information for using the GU call with SSAs: v A GU call with an unqualified SSA at the root level attempts to satisfy the call by starting at the beginning of the database. If the SSA at the root level is the only SSA, IMS retrieves the first segment in the database. v A GU call with a qualified SSA can retrieve the segment described in the SSA, regardless of that segment's location relative to current position. v When you issue a GU that mixes qualified and unqualified SSAs at each level, IMS retrieves the first occurrence of the segment type that satisfies the call. v If you leave out an SSA for one of the levels in a GU call that has multiple SSAs, IMS assumes an SSA for that level. The SSA that IMS assumes depends on current position: If IMS has a position established at the missing level, the SSA that IMS uses is derived from that position, as reflected in the DB PCB. If IMS does not have a position established at the missing level, IMS assumes an unqualified SSA for that level.

20

Application Programming APIs

If IMS moves forward from a position established at a higher level, IMS assumes an unqualified SSA for that level. If the SSA for the root level is missing, and IMS has position established on a root, IMS does not move from that root when trying to satisfy the call.

Usage: Get Hold Unique (GHU)Before your program can delete or replace a segment, it must retrieve the segment and indicate to IMS that it is going to change the segment in some way. The program does this by issuing a Get call with a hold before deleting or replacing the segment. Once the program has successfully retrieved the segment with a Get Hold call, it can delete the segment or change one or more fields (except the key field) in the segment. The only difference between Get calls with a hold and without a hold is that the hold calls can be followed by a REPL or DLET call. The hold status on the retrieved segment is canceled and must be reestablished before you reissue the DLET or REPL call. After issuing a Get Hold call, you can issue more than one REPL or DLET call to the segment if you do not issue intervening calls to the same PCB. If you find out that you do not need to update it after issuing a Get Hold call, you can continue with other processing without releasing the segment. The segment is freed as soon as the current position changeswhen you issue another call to the same PCB you used for the Get Hold call. In other words, a Get Hold call must precede a REPL or DLET call. However, issuing a Get Hold call does not require you to replace or delete the segment.

RestrictionsYou can use GU to retrieve the record with the RSA you provide with a GSAM database, but GHU is not valid for GSAM. Related concepts F command code on page 243

ISRT callThe Insert (ISRT) call is used to load a database and to add one or more segments to the database. You can use ISRT to add a record to the end of a GSAM database or for an alternate PCB that is set up for IAFP processing.

Format|ISRT db pcb aib i/o area ssa rsa

|Call Name For Full-Function: For GSAM: For DEDB: ISRT ISRT ISRT DB/DC X X X DBCTL X X X X X DCCTL DB Batch X X X TM Batch

Chapter 1. DL/I calls for database management

21

Call Name For MSDB: ISRT

DB/DC X

DBCTL

DCCTL

DB Batch

TM Batch

Parametersdb pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. aib Specifies the AIB for the call. This parameter is an input and output parameter. These fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .

AIBLEN AIB lengths. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of a DB PCB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. i/o area Specifies the I/O area. This parameter is an input parameter. When you want to add a new segment to the database, you place the new se