IMS Appl Prog
IMS Appl Prog
SC18-7809-04
IMS
SC18-7809-04
Note Before using this information and the product it supports, read the information in Notices on page 379.
| |
This edition applies to IMS Version 9 (program number 5655-J38) and to all subsequent releases and modifications until otherwise indicated in new editions. This edition replaces SC18-7809-03. Copyright IBM Corporation 1974, 2011. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Contents
Figures . . . . . . . . . . . . . . . v Tables . . . . . . . . . . . . . . . vii About This Book. . . . . . . . . . . ix
Summary of Contents . . . . . . . . . Prerequisite Knowledge . . . . . . . . IBM Product Names Used in This Information . How to Read Syntax Diagrams . . . . . . Accessibility Features for IMS Version 9 . . . How to Send Your Comments . . . . . . . . . . ix . ix . . x . . xi . xiii . xiii Specifying the AIB Mask for ODBA Applications . Specifying the UIB (CICS Online Programs Only). Specifying the I/O Areas . . . . . . . . . Formatting Segment Search Arguments (SSAs). . GSAM Databases . . . . . . . . . . . The AIBTDLI Interface. . . . . . . . . . Language Specific Entry Points . . . . . . . Program Communication Block (PCB) Lists. . . The AERTLDI interface . . . . . . . . . Language Environments . . . . . . . . . Special DL/I Situations . . . . . . . . . . . . . . . . . . . . 74 77 80 80 85 85 86 89 91 91 93
Summary of Changes . . . . . . . . xv
| |
Changes to the Current Edition of This Book IMS Version 9 . . . . . . . . . . Changes to This Book for IMS Version 9. . Library Changes for IMS Version 9 . . . for . . . . . . . xv . xv . xv
. . . . . . . . .
. . . . . . . . .
53 54 56 59 62 64 67 70 73
iii
GSAM Status Codes . . . . . . . Symbolic CHKP and XRST with GSAM GSAM Coding Considerations. . . . Origin of GSAM Data Set Characteristics
. . . .
. . . .
. . . .
. . . .
ROLL Call . . ROLS Call . . SETS/SETU Call SNAP Call . . STAT Call . . SYNC Call . . TERM Call (CICS XRST Call . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Online Programs . . . . . .
. . . . . . . . . . . . Only) . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
Chapter 13. Relationship Between Calls and AIB and PCBs. . . . . . . 295 Chapter 14. DL/I Test Program (DFSDDLT0) . . . . . . . . . . . . 297
Control Statements . . . . . . . Planning the Control Statement Order . ABEND Statement. . . . . . . . CALL Statement . . . . . . . . COMMENT Statement . . . . . . COMPARE Statement . . . . . . IGNORE Statement . . . . . . . OPTION Statement . . . . . . . PUNCH CTL Statement . . . . . . STATUS Statement . . . . . . . WTO Statement . . . . . . . . WTOR Statement . . . . . . . . JCL Requirements . . . . . . . . Execution of DFSDDLT0 in IMS Regions Explanation of DFSDDLT0 Return Codes DFSDDLT0 Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 299 300 300 320 321 327 327 328 331 334 335 335 339 339 339
Notices . . . . . . . . . . . . . . 379
Programming Interface Information . Trademarks . . . . . . . . . . . . . . . . . . 381 . 381
Bibliography . . . . . . . . . . . . 383
IMS Version 9 Library . . . Supplementary Publications . Publication Collections . . . Accessibility Titles Cited in This . . . . . . . . . Library . . . . . . . . . . . . . . . . 383 384 384 384
Index . . . . . . . . . . . . . . . 385
iv
Figures
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. DL/I Program Elements. . . . . . . . . 6 Normal Relationship between Programs, PSBs, PCBs, DBDs, and Databases . . . . . . . 10 Relationship between Programs and Multiple PCBs (Concurrent Processing) . . . . . . 10 The Structure of a Call-Level CICS Online Program. . . . . . . . . . . . . . 11 Medical Hierarchy . . . . . . . . . . 13 Segment with a Noncontiguous Sequence Field 23 D Command Code Example . . . . . . . 27 Sample Assembler Language Program . . . 30 Sample Call-Level Assembler Language Program (CICS Online) . . . . . . . . 32 Sample C Language Program . . . . . . 34 Sample COBOL Program . . . . . . . . 37 Sample Call-Level OS/V COBOL program (CICS Online) . . . . . . . . . . . . 42 Sample Pascal Program . . . . . . . . 45 Sample PL/I Program . . . . . . . . . 47 Sample Call-Level PL/I Program (CICS Online) . . . . . . . . . . . . . . 51 Defining the UIB, PCB Address List, and the PCB Mask for VS COBOL II . . . . . . . 78 Defining the UIB, PCB Address List, and the PCB Mask for OS/VS COBOL . . . . . . 78 The COBOL COPY DLIUIB Copy Book 79 Defining the UIB, PCB Address List, and the PCB Mask for PL/I . . . . . . . . . . 80 Defining the UIB, PCB Address List, and the PCB Mask for Assembler Language . . . . 80 Example Code: * CONSTANT AREA . . . . 82 Qualified SSA without Command Codes 84 Current Position Hierarchy . . . . . . . 96 Example Code: Deleting Segment C11. . . . 97 Hierarchy after Deleting a Segment . . . . 98 Hierarchy after Deleting a Segment and Dependents . . . . . . . . . . . . 98 Hierarchy after Adding New Segments and Dependents . . . . . . . . . . . . 100 DL/I Positions . . . . . . . . . . . 101 Multiple Processing . . . . . . . . . 104 Multiple Positioning Hierarchy . . . . . 105 Single and Multiple Positioning Hierarchy 106 SETS and ROLS Calls Working Together 116 ODBA Two-Phase Sync Point Processing 127 DRA Component Structure with the ODBA Interface . . . . . . . . . . . . . 131 Example of Using the Dependent AND 151 Example of Using the Independent AND 151 Patient and Item Hierarchies . . . . . . 154 Concatenated Segment . . . . . . . . 154 //IMS DD Statement Example . . . . . . 168 Sample PCB Specifying View=MSDB 177 Processing a Long Chain of Segment Occurrences with Subset Pointers . . . . . 179 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. Examples of Setting Subset Pointers . . . . Additional Examples of Setting Subset Pointers . . . . . . . . . . . . . How Subset Pointers Divide a Chain into Subsets . . . . . . . . . . . . . U Command Code Example . . . . . . Processing for the Passbook Example Moving the Subset Pointer to the Next Segment after Your Current Position . . . . Retrieving the First Segment in a Chain of Segments . . . . . . . . . . . . . Unconditionally Setting the Subset Pointer to Your Current Position . . . . . . . . . Conditionally Setting the Subset Pointer to Your Current Position . . . . . . . . . Hierarchic Sequence . . . . . . . . . Sample PL/I Program to retrieve database status values . . . . . . . . . . . . I/O Area for SNAP Operation Parameters Example JCL Code for DD Statement Definition . . . . . . . . . . . . . Example JCL Code for DFSDDLT0 in a BMP Using the Binder to Copy the Name IVPREXX . . . . . . . . . . . . . JCL Code Used to Run the IVPREXX Sample Exec . . . . . . . . . . . . . . IMS Adapter for REXX Logical Overview Diagram . . . . . . . . . . . . . Exec To Do Calculations . . . . . . . . PDF EDIT Session on the SAY Exec . . . . Example Output from the SAY Exec . . . . Example Output of PCBINFO Exec on a PSB without Database PCBs. . . . . . . . . Example Output of PCBINFO Exec on a PSB with a Database PCB. . . . . . . . . . PCBINFO Exec Listing . . . . . . . . Example Output of PARTNUM Exec Example Output of PARTNAME Exec PARTNUM Exec: Show Set of Parts Near a Specified Number . . . . . . . . . . PARTNAME Exec: Show Parts with Similar Names . . . . . . . . . . . . . . Output from = > DOCMD . . . . . . . Output from = > DOCMD /DIS NODE ALL;? Output from = > DOCMD /DIS NODE ALL;CID>0 . . . . . . . . . . . . Output from = > DOCMD /DIS NODE ALL;TYPE=SLU2 . . . . . . . . . . Output from = > DOCMD /DIS TRAN ALL;ENQCT>0 & RECTYPE='T02' . . . . Output from = > DOCMD /DIS LTERM ALL;ENQCT>0 . . . . . . . . . . . DOCMD Exec: Process an IMS Command 179 180 180 211 214 215 216 217 218 231 272 285 335 336 345 346 347 365 365 365 366 366 367 368 368 369 370 371 371 371 372 372 372 373
| |
| 75.
vi
Tables
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. Licensed Program Full Names and Short Names x PATIENT Segment . . . . . . . . . . 14 ILLNESS Segment . . . . . . . . . . 14 TREATMNT Segment . . . . . . . . . 15 BILLING Segment . . . . . . . . . . 15 PAYMENT Segment . . . . . . . . . . 15 HOUSEHOLD Segment . . . . . . . . 15 Teller Segment in a Fixed Related MSDB 16 Branch Summary Segment in a Dynamic Related MSDB . . . . . . . . . . . 17 Account Segment in a Nonrelated MSDB 17 Qualified SSA Structure . . . . . . . . 21 Unqualified SSA with Command Code 27 Qualified SSA with Command Code . . . . 27 I/O PCB Mask . . . . . . . . . . . 67 DB PCB Mask. . . . . . . . . . . . 71 AIB Fields . . . . . . . . . . . . . 73 AIB Fields for Use of ODBA Applications 74 Relational Operators . . . . . . . . . 81 I/O PCB and Alternate PCB Information Summary . . . . . . . . . . . . . 90 Using LANG= Option in a Language Environment for PL/I Compatibility . . . . 92 Results of Single and Multiple Positioning with DL/I Calls. . . . . . . . . . . 106 Comparison of ROLB, ROLL, and ROLS 113 Example of Events in a Multithreading System . . . . . . . . . . . . . . 123 CCTL Single-Phase Sync Point Processing 126 CCTL Two-Phase Sync Point Processing 126 Information Provided for the Schedule Process: . . . . . . . . . . . . . 143 Information Provided at UOR Termination: 144 GSAM DB PCB Mask . . . . . . . . . 158 Format of the RSA . . . . . . . . . . 160 Summary of GSAM Calls . . . . . . . 163 Summary of Fast Path Database Calls 170 Subset Pointer Command Codes and Calls 171 FSA Structure . . . . . . . . . . . 172 Unqualified SSA with Subset Pointer Command Code . . . . . . . . . . 181 Qualified SSA with Subset Pointer Command Code . . . . . . . . . . . . . . 181 Qualified POS Call: Keywords and Map of I/O Area Returned. . . . . . . . . . 184 DEDB DL/I Calls . . . . . . . . . . 188 Field initialization for DEDB DL/I calls 189 Fields initialized for specific DEDB DL/I calls 190 Fields updated by IMS for all DL/I call types 190 Fields updated by specific DL/I calls 190 Status codes for specific DEDB DL/I calls 194 Summary of Command Codes . . . . . . 201 Command Codes and Related Calls . . . . 202 Command Codes for DL/I Calls . . . . . 202 Summary of DB Calls . . . . . . . . . 220 CIMS CONNECT parameter list format 221
| 48.
49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62.
63.
64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88.
| | | | | |
37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47.
CIMS CONNECT table entry format . . . . Unqualified POS Call: Keywords and Map of the I/O Area Return Output . . . . . . Summary of System Service Calls . . . . . GMSG Support by Application Region Type ICMD Support by Application Region Type INIT DBQUERY: Examples for ASMTDLI, CBLTDLI, CTDLI, and PASTDLI . . . . . INIT DBQUERY: I/O Area Example for PLITDLI . . . . . . . . . . . . . INIT I/O Area Examples for ASMTDLI, CBLTDLI, CTDLI, and PASTDLI . . . . . INIT I/O Area Examples for PLITDLI INIT I/O Area Examples for ASMTDLI, CBLTDLI, CTDLI, and PASTDLI . . . . . INIT I/O Area Examples for PLITDLI INQY ENVIRON Data Output . . . . . . INQY MSGINFO data output . . . . . . Subfunction, PCB, and I/O Area Combinations for the INQY Call . . . . . Log Record Formats for COBOL, C, Assembler, Pascal, and PL/I Programs for the AIBTDLI, ASMTDLI, CBLTDLI, CEETDLI, CTDLI, and PASTDLI Interfaces . . . . . Log Record Formats for COBOL, C, Assembler, Pascal, and PL/I Programs for the PLITDLI Interface . . . . . . . . . . RCMD Support by Application Region Type SNAP Operation Parameters . . . . . . Call Relationship to PCBs . . . . . . . Summary of DFSDDLT0 Control Statements ABEND Statement . . . . . . . . . . CALL FUNCTION Statement . . . . . . CALL DATA Statement . . . . . . . . OPTION DATA Statement . . . . . . . FEEDBACK DATA Statement . . . . . . DL/I Call Functions . . . . . . . . . CALL FUNCTION Statement (Column-Specific SSAs) . . . . . . . . CALL FUNCTION Statement with DFSDDLT0 Call Functions . . . . . . . COMMENT Statement . . . . . . . . COMPARE DATA Statement . . . . . . COMPARE AIB Statement . . . . . . . COMPARE PCB Statement . . . . . . . IGNORE Statement . . . . . . . . . OPTION Statement . . . . . . . . . PUNCH CTL Statement . . . . . . . . STATUS Statement . . . . . . . . . . WTO Statement . . . . . . . . . . . WTOR Statement . . . . . . . . . . IMS Adapter for REXX Parameter Types and Definitions . . . . . . . . . . . . REXXIMS Extended Commands . . . . . Return Codes in UIBFCTR . . . . . . .
222 243 250 258 260 262 262 263 263 264 264 268 270 275
276
276 279 285 295 298 300 300 303 305 305 306 318 319 321 322 323 324 327 328 329 331 334 335 351 353 377
vii
89.
90.
. 377
viii
Summary of Contents
This book has two parts: v Part 1, Writing Application Programs, on page 1 provides basic information on coding DL/I calls for IMS DB programs, 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 2, Reference, on page 197 provides additional information that you need to write and test your application programs.
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 9: Application Programming: Design Guide, which assumes you understand basic IMS concepts and the various environments. This book is an extension to IMS Version 9: 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++.
ix
Licensed program short name Application Recovery Tool CICS CICS DB2 Universal Database DB2 UDB for z/OS Enterprise COBOL Enterprise COBOL Enterprise PL/I High Level Assembler IMS Advanced ACB Generator IMS Batch Backout Manager IMS Batch Terminal Simulator IMS Buffer Pool Analyzer IMS Command Control Facility IMS Connect IMS Connector for Java IMS Database Control Suite IMS Database Recovery Facility IMS Database Repair Facility IMS DataPropagator IMS DEDB Fast Recovery IMS ETO Support IMS Fast Path Basic Tools IMS Fast Path Online Tools IMS Hardware Data Compression-Extended IBM IMS HALDB Conversion Aid IMS High Performance Change Accumulation Utility IMS HP Load IMS HP Pointer Checker
IBM DB2 Universal Database for z/OS IBM Enterprise COBOL for z/OS IBM Enterprise COBOL for z/OS and OS/390 IBM Enterprise PL/I for z/OS and OS/390 IBM High Level Assembler for MVS & VM & VSE IBM IMS Advanced ACB Generator IBM IMS Batch Backout Manager IBM IMS Batch Terminal Simulator IBM IMS Buffer Pool Analyzer IBM IMS Command Control Facility for z/OS IBM IMS Connect for z/OS IBM IMS Connector for Java IBM IMS Database Control Suite IBM IMS Database Recovery Facility for z/OS IBM IMS Database Repair Facility IBM IMS DataPropagator for z/OS IBM IMS DEDB Fast Recovery IBM IMS Extended Terminal Option Support IBM IMS Fast Path Basic Tools IBM IMS Fast Path Online Tools IBM IMS Hardware Data Compression-Extended IBM IMS High Availability Large Database (HALDB) Conversion Aid for z/OS IBM IMS High Performance Change Accumulation Utility for z/OS IBM IMS High Performance Load for z/OS IBM IMS High Performance Pointer Checker for OS/390
Table 1. Licensed Program Full Names and Short Names (continued) Licensed program full name Licensed program short name
IBM IMS High Performance Prefix Resolution IMS HP Prefix Resolution for z/OS IBM Tivoli NetView for z/OS IBM WebSphere Application Server for z/OS and OS/390 IBM WebSphere MQ for z/OS IBM WebSphere Studio Application Developer Integration Edition IBM z/OS
Tivoli NetView for z/OS WebSphere Application Server for z/OS WebSphere MQ WebSphere Studio z/OS
Additionally, this information might contain references to the following IBM product names: v "IBM C/C++ for MVS" or "IBM C/C++ for MVS/ESA" is referred to as either "C/MVS" or "C++/MVS." v "IBM CICS for MVS" is referred to as "CICS." v "IBM DataAtlas for OS/2" is referred to as "DataAtlas." v "IBM Language Environment for MVS & VM" or "IBM z/OS Language Environment" is referred to as "Language Environment." v "IBM PL/I for MVS & VM" or "IBM PL/I for OS/390 & VM" is referred to as "PL/I."
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
xi
v 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
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
xii
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. 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
The following list includes the major accessibility features in z/OS products, including IMS Version 9. 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. | | The information center is accessibility-enabled for the IBM Home Page Reader. You can operate all features by using the keyboard instead of the mouse.
Keyboard Navigation
You can access IMS Version 9 ISPF panel functions by using a keyboard or keyboard shortcut keys. For information about navigating the IMS Version 9 ISPF panels using TSO/E or ISPF, refer to the z/OS TSO/E Primer, the z/OS TSO/E Users Guide, and the z/OS ISPF Users Guide. 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.
xiii
xiv
Summary of Changes
| |
Technical Changes
New information on the following enhancements is included: v The sample PL/I code in Coding a Batch Program in PL/I on page 46 has been modified. v The sample CICS PL/I code in Coding a CICS Online Program in PL/I on page 50 has been modified. v Coding a batch program in COBOL includes new information . For more information, see Coding a Batch Program in COBOL on page 36. v Issuing a POS call includes new information. For more information, see POS Call on page 242. v AIB has been added to Table 66 on page 295. For more information, see Chapter 13, Relationship Between Calls and AIB and PCBs, on page 295. v Issuing a INQY call includes new information. For more information, see INQY Call on page 266.
Editorial Changes
The following organizational changes have been made to this book: v Segment Search Arguments (SSAs) on page 20 has been moved from Chapter 1, How Application Programs Work with Database Manager, on page 5 to Chapter 2, Writing Your Application Programs, on page 19. v Multiple Qualification Statements on page 24 has been added to Segment Search Arguments (SSAs) on page 20. For detailed information about technical enhancements for IMS Version 9, see the IMS Version 9: Release Planning Guide.
xv
| | | |
There are known limitations with BookManager output. If you encounter problems in the BookManager information with Web addresses, syntax diagrams, wide examples, or tables, refer to the information in the information center or in a PDF book.
Organizational Changes
Organization changes to the IMS Version 9 library include changes to: v IMS Version 9: Customization Guide v IMS Version 9: IMS Connect Guide and Reference v IMS Version 9: IMS Java Guide and Reference v IMS Version 9: Messages and Codes, Volume 1 v IMS Version 9: Utilities Reference: System | | | | | | A new appendix has been added to the IMS Version 9: Customization Guide that describes the contents of the ADFSSMPL (also known as SDFSSMPL) data set. The IMS Connect messages that were in IMS Version 9: IMS Connect Guide and Reference have moved to IMS Version 9: Messages and Codes, Volume 1. The IMS Connect commands that were in IMS Version 9: IMS Connect Guide and Reference have moved to IMS Version 9: Command Reference. The chapter titled "DLIModel Utility" has moved from IMS Version 9: IMS Java Guide and Reference to IMS Version 9: Utilities Reference: System. The DLIModel utility messages that were in IMS Version 9: IMS Java Guide and Reference have moved to IMS Version 9: Messages and Codes, Volume 1. | | | | To ease the transition of your security support from the Security Maintenance Utility (SMU) to RACF, new SMU to RACF conversion utilities have been introduced. These utilities are documented in a new part in the IMS Version 9: Utilities Reference: System.
xvi
Terminology Changes
IMS Version 9 introduces new terminology for IMS commands: type-1 command A command, generally preceded by a leading slash character, that can be entered from any valid IMS command source. In IMS Version 8, these commands were called classic commands. type-2 command A command that is entered only through the OM API. Type-2 commands are more flexible than type-2 commands and can have a broader scope. In IMS Version 8, these commands were called IMSplex commands or enhanced commands.
Summary of Changes
xvii
xviii
. . . . .
. 9 10 12 13 13 15 19 19 20 21 21 23 24 26 28 29 29 29 32 34 36 39 44 46 50
Chapter 2. Writing Your Application Programs . . Programming Guidelines . . . . . . . . . . Segment Search Arguments (SSAs) . . . . . . Unqualified SSAs . . . . . . . . . . . Qualified SSAs . . . . . . . . . . . . SSA Guidelines . . . . . . . . . . . . Multiple Qualification Statements . . . . . . SSAs and Command Codes . . . . . . . . Considerations for Coding DL/I Calls and Data Areas . . . . . . . . . . . . . . . . Preparing to Run Your CICS DL/I Call Program . . Examples of How to Code DL/I Calls and Data Areas . . . . . . . . . . . . . . . . Coding a Batch Program in Assembler Language Coding a CICS Online Program in Assembler Language . . . . . . . . . . . . . . Coding a Batch Program in C Language . . . . Coding a Batch Program in COBOL . . . . . Coding a CICS Online Program in COBOL . . . Coding a Batch Program in Pascal . . . . . . Coding a Batch Program in PL/I . . . . . . Coding a CICS Online Program in PL/I . . . . Chapter 3. Defining Application Program Elements . . . . . . . . . . . . . Formatting DL/I Calls for Language Interfaces Assembler Language Application Programming Format . . . . . . . . . . . . . Parameters . . . . . . . . . . . Example of a DL/I Call Format. . . . . C Language Application Programming . . . Format . . . . . . . . . . . . . Parameters . . . . . . . . . . . I/O Area . . . . . . . . . . . . Example of a DL/I Call Format. . . . . COBOL Application Programming. . . . .
Copyright IBM Corp. 1974, 2011
. 92 . 93 . . . . . 93 93 94 94 94
. . 53 . . 53 . . 54 . . 54 . . 55 . . 56 . . 56 . . 56 . . 57 . . 59 . . 59 . . 59
Chapter 4. Current Position in the Database After Each Call . . . . . . . . . . . . . . . 95 Current Position after Successful Calls . . . . . 95 Position after Retrieval Calls. . . . . . . . 97 Position after DLET. . . . . . . . . . . 97 Position after REPL . . . . . . . . . . . 99 Position after ISRT . . . . . . . . . . . 99 Current Position after Unsuccessful Calls . . . . 100
Position after an Unsuccessful DLET or REPL Call . . . . . . . . . . . . . . . Position after an Unsuccessful Retrieval or ISRT Call . . . . . . . . . . . . . . . Multiple Processing . . . . . . . . . . . Multiple Positioning . . . . . . . . . . Advantages of Using Multiple Positioning. . . Multiple DB PCBs . . . . . . . . . . . Chapter 5. Recovering Databases and Maintaining Database Integrity . . . . . . Issuing Checkpoints . . . . . . . . . . Restarting Your Program From the Latest Checkpoint . . . . . . . . . . . . . Maintaining Database Integrity (IMS Batch, BMP, and IMS Online Regions) . . . . . . . . Backing Out to a Prior Commit Point: ROLL, ROLB, and ROLS . . . . . . . . . . Backing Out to an Intermediate Backout Point: SETS, SETU, and ROLS . . . . . . . . Reserving Segments for the Exclusive Use of Your Program . . . . . . . . . . . . . .
Status Codes for Secondary Indexes . . . Processing Segments in Logical Relationships How Logical Relationships Affect Your Programming . . . . . . . . . . Status Codes for Logical Relationships . .
. . . .
. 152 . 152 . 154 . 155 157 157 157 159 160 161 161 162 162 163 163 164 165 165 166 166 167 167 167 169 169 170 170 171 171 176 177 177 178 178 178 183 185 186 186 187 187 187 187 188 188 191 191 191 192 192 193
Chapter 6. The Database Resource Adapter (DRA). . . . . . . . . . . . . . . . Thread Concepts . . . . . . . . . . . . Processing Threads . . . . . . . . . . Processing Multiple Threads . . . . . . . CCTL Multithread Example . . . . . . . Sync Points . . . . . . . . . . . . . . The Two-Phase Commit Protocol . . . . . . In-Doubt State During Two-Phase Sync. . . . DRA Startup Table . . . . . . . . . . . Sample DFSPZP00 Source Code . . . . . . DFSPRP Macro Keywords . . . . . . . . Enabling the DRA for a CCTL . . . . . . . . Enabling the DRA for the ODBA Interface . . . . Processing CCTL DRA Requests . . . . . . . Processing ODBA Calls . . . . . . . . . . CCTL-Initiated DRA Function Requests . . . . INIT Request . . . . . . . . . . . . RESYNC Request . . . . . . . . . . . TERM Request . . . . . . . . . . . . Thread Function Requests . . . . . . . . PAPL Mapping Format . . . . . . . . . . Terminating the DRA. . . . . . . . . . . Designing the CCTL Recovery Process . . . . . CCTL Performance: Monitoring DRA Thread TCBs DRA Thread Statistics . . . . . . . . . DRA Statistics . . . . . . . . . . . . Tracing . . . . . . . . . . . . . . Sending Commands to IMS DB . . . . . . Problem Diagnosis . . . . . . . . . .
| | | | | |
121 121 121 122 122 124 125 127 128 128 128 129 130 131 132 132 132 134 135 135 141 141 142 143 143 145 146 146 146
Chapter 8. Processing GSAM Databases . . . Accessing GSAM Databases . . . . . . . . PCB Masks for GSAM Databases . . . . . . Retrieving and Inserting GSAM Records . . . Resetting the Position in a GSAM Database . . Explicit Open and Close Calls to GSAM . . . GSAM Record Formats . . . . . . . . . . GSAM I/O Areas . . . . . . . . . . . . GSAM Status Codes . . . . . . . . . . . Symbolic CHKP and XRST with GSAM . . . . GSAM Coding Considerations. . . . . . . . Origin of GSAM Data Set Characteristics . . . . DD Statement DISP Parameter for GSAM Data Sets . . . . . . . . . . . . . . . Extended Checkpoint Restart for GSAM Data Sets . . . . . . . . . . . . . . . Copying GSAM Data Sets Between Checkpoint and Restart . . . . . . . . . . . . . Converting Data Sets From Non-Striped Data Sets to Striped Data Sets. . . . . . . . . Concatenated Data Sets Used by GSAM . . . Suggested Method for Specifying GSAM Data Set Attributes . . . . . . . . . . . . DLI, DBB, and BMP Region Types and GSAM Chapter 9. Processing Fast Path Databases . . Main Storage Databases (MSDBs). . . . . . . Data Entry Databases (DEDBs) . . . . . . . Fast Path Database Calls . . . . . . . . . Processing MSDBs and DEDBs . . . . . . . Updating Segments: REPL, DLET, ISRT, and FLD . . . . . . . . . . . . . . . Commit-Point Processing in MSDBs and DEDBs VSO Considerations . . . . . . . . . . Data Locking for MSDBs and DEDBs . . . . Restrictions on Using Calls for MSDBs . . . . . Processing DEDBs (IMS and CICS with DBCTL) Processing DEDBs with Subset Pointers . . . Retrieving Location with the POS Call (for DEDB Only) . . . . . . . . . . . . . Commit-Point Processing in a DEDB . . . . P Processing Option . . . . . . . . . . H Processing Option . . . . . . . . . . Data Locking . . . . . . . . . . . . Calls with Dependent Segments for DEDBs . . . Direct Dependent Segments . . . . . . . Sequential Dependent Segments . . . . . . DEDB DL/I calls to extract DEDB information . . IOAI structure . . . . . . . . . . . . AL_LEN Call . . . . . . . . . . . . DI_LEN Call . . . . . . . . . . . . DS_LEN Call . . . . . . . . . . . . AREALIST Call. . . . . . . . . . . . DEDBINFO Call . . . . . . . . . . . DEDSTR Call . . . . . . . . . . . .
Chapter 7. Secondary Indexing and Logical Relationships . . . . . . . . . . . . . 149 How Secondary Indexing Affects Your Program 149 SSAs with Secondary Indexes . . . . . . . 149 Multiple Qualification Statements with Secondary Indexes. . . . . . . . . . . 150 DL/I Returns with Secondary Indexes . . . . 152
| | | | | | | |
. 195
| | |
IMS Environments
| | | | Your application program can execute in different IMS environments. The three online environments are DB/DC, DBCTL, and DCCTL. The two batch environments are DB batch and TM batch. Related Reading: For information on these environments, see IMS Version 9: Administration Guide: System. The information in this section applies to all application programs that run in IMS. The main elements in an IMS application program are: v Program entry v Program communication block (PCB) or application interface block (AIB) definition v I/O (input/output) area definition v DL/I calls v Program termination Figure 1 on page 6 shows how these elements relate to each other. The numbers on the right in Figure 1 on page 6 refer to the notes that follow.
Notes for Figure 1: 1. Program entry. IMS passes control to the application program with a list of associated PCBs. 2. PCB or AIB. IMS describes the results of each DL/I call using the AIBTDLI interface in the application interface block (AIB) and, when applicable, the program communication block (PCB). To find the results of a DL/I call, your program must use the PCB that is referenced in the call. To find the results of the call using the AIBTDLI interface, your program must use the AIB. Your application program can use the PCB address that is returned in the AIB to find the results of the call. To use the PCB, the program defines a mask of the PCB and can then reference the PCB after each call to determine the success or failure of the call. An application program cannot change the fields in a PCB; it can only check the PCB to determine what happened when the call was completed. 3. I/O area. IMS passes segments to and from the program in the program's I/O area. 4. DL/I calls. The program issues DL/I calls to perform the requested function. 5. Program termination. The program returns control to IMS DB when it has finished processing. In a batch program, your program can set the return code and pass it to the next step in the job. | | | | | Recommendation: If your program does not use the return code in this way, set the return code to 0 as a programming convention. Your program can use the return code for this same purpose in Batch Message Processing (BMP) regions. Message Processing Programs (MPPs) cannot pass return codes.
DL/I Calls
A DL/I call consists of a call statement and a list of parameters. The parameters provide information that IMS needs to execute the call. This information consists of the call function, the name of the data structure that IMS uses for the call, the data area in the program into which IMS returns data, and any condition that the retrieved data must meet. You can issue calls to perform database management calls (DB calls) and to obtain IMS DB system service (system service calls).
DB Call Functions
The DL/I calls for database management are: CLSE DEQ DLET FLD GHN GHNP GHU GN GNP GU ISRT OPEN POS REPL GSAM Close Dequeue Delete Field Get Hold Next Get Hold Next in Parent Get Hold Unique Get Next Get Next in Parent Get Unique Insert GSAM Open Position Replace
Related Reading: The DL/I calls are described in detail in Chapter 11, DL/I Calls for Database Management, on page 219.
DL/I Calls
GMSG GSCD ICMD INIT INQY LOG PCB RCMD ROLB ROLL ROLS SETS SETU SNAP STAT SYNC TERM XRST Get Message Get Address of System Contents Directory Issue Command Initialize Inquiry Log Specify and Schedule a PCB Retrieve Command Roll Back Roll Roll Back to SETS Set a Backout Point SET Unconditional Collects diagnostic information Statistics Synchronization Terminate Extended Restart
Related Reading: The DL/I calls for system services are described in detail in Chapter 12, DL/I Calls for System Services, on page 249. |
DL/I Codes
This section contains information about the different DL/I codes that you will encounter when working with IMS Database Manager Application Programs.
DL/I Codes
Error Routines
If your program detects an error after checking for blanks and exceptional conditions in the status code, it should branch to an error routine and print as much information as possible about the error before terminating. Determining which call was being executed when the error occurred, what parameters were on the IMS call, and the contents of the PCB will be helpful in understanding the error. Print the status code to help with problem determination. Two kinds of errors can occur in your program: programming errors and system or I/O errors. Programming errors, are usually your responsibility to find and fix. These errors are caused by things like an invalid parameter, an invalid call, or an I/O area that is too long. System or I/O errors are usually resolved by the system programmer or the equivalent specialist at your installation. Because every application program should have an error routine, and because each installation has its own ways of finding and debugging program errors, you probably have your own standard error routines.
Figure 2. Normal Relationship between Programs, PSBs, PCBs, DBDs, and Databases
Figure 3 shows concurrent processing, which uses multiple PCBs for the same database.
10
Notes to Figure 4: 1. I/O area. IMS passes segments to and from the program in the program's I/O area. 2. PCB. IMS describes the results of each DL/I call in the database PCB mask. | | | | | | | | | | 3. One of the following: v Application interface block (AIB). If you chose to use the AIB, the AIB provides the program with addresses of the PCBs and return codes from the CICS-DL/I interface. v User interface block (UIB). If you chose not to use AIB, the UIB provides the program with addresses of the PCBs and return codes from the CICS-DL/I interface. The horizontal line between number 3 (UIB) and number 4 (Program entry) in Figure 4, represents the end of the declarations section and the start of the executable code section of the program.
Chapter 1. How Application Programs Work with Database Manager
11
12
The tables that follow show the layouts of each segment in the hierarchy. The segments field names are in the first row of each table. The number below each field name is the length in bytes that has been defined for that field.
Chapter 1. How Application Programs Work with Database Manager
13
v ILLNESS Segment Table 3 shows the ILLNESS segment. It has two fields: The date when the patient came to the clinic with the illness (ILLDATE) The name of the illness (ILLNAME) The key field is ILLDATE. Because it is possible for a patient to come to the clinic with more than one illness on the same date, this key field is non unique, that is, there may be more than one ILLNESS segment with the same (an equal) key field value. Usually during installation, the database administrator (DBA) decides the order in which to place the database segments with equal or no keys. The DBA can use the RULES keyword of the SEGM statement of the DBD to specify the order of the segments. For segments with equal keys or no keys, RULES determines where the segment is inserted. Where RULES=LAST, ILLNESS segments that have equal keys are stored on a first-in-first-out basis among those with equal keys. ILLNESS segments with unique keys are stored in ascending order on the date field, regardless of RULES. ILLDATE is specified in the format YYYYMMDD.
Table 3. ILLNESS Segment Field Name ILLDATE ILLNAME Field Length 8 10
v TREATMNT Segment Table 4 on page 15 shows the TREATMNT segment. It contains four fields: The date of the treatment (DATE) The medicine that was given to the patient (MEDICINE) The quantity of the medicine that the patient received (QUANTITY) The name of the doctor who prescribed the treatment (DOCTOR) The TREATMNT segments key field is DATE. Because a patient may receive more than one treatment on the same date, DATE is a non unique key field.
14
v BILLING Segment Table 5 shows the BILLING segment. It has only one field: the amount of the current bill. BILLING has no key field.
Table 5. BILLING Segment Field Name BILLING Field Length 6
v PAYMENT Segment Table 6 shows the PAYMENT segment. It has only one field: the amount of payments for the month. The PAYMENT segment has no key field.
Table 6. PAYMENT Segment Field Name PAYMENT Field Length 6
v HOUSHOLD Segment Table 7 shows the HOUSHOLD segment. It contains two fields: The names of the members of the patient's household (RELNAME) How each member of the household is related to the patient (RELATN) The HOUSEHOLD segments key field is RELNAME.
Table 7. HOUSEHOLD Segment Field Name RELNAME RELATN Field Length 10 8
15
Related MSDBs
Related MSDBs can be fixed or dynamic. In a fixed related MSDB, you can store summary data about a particular teller at a bank. For example, you can have an identification code for the teller's terminal. Then you can keep a count of that teller's transactions and balance for the day. This type of application requires a segment with three fields: TELLERID TRANCNT TELLBAL A two-character code that identifies the teller The number of transactions the teller has processed The balance for the teller
Table 8 shows what the segment for this type of application program looks like.
Table 8. Teller Segment in a Fixed Related MSDB TELLERID TRANCNT TELLBAL
Some of the characteristics of fixed related MSDBs include: v You can only read and replace segments. You cannot delete or insert segments. In the bank teller example, the teller can change the number of transactions processed, but you cannot add or delete any segments. You never need to add or delete segments. v Each segment is assigned to one logical terminal. Only the owning terminal can change a segment, but other terminals can read the segment. In the bank teller example, you do not want tellers to update the information about other tellers, but you allow the tellers to view each others information. Tellers are responsible for their own transactions. v The name of the logical terminal that owns the segment is the segment's key. Unlike non-MSDB segments, the MSDB key is not a field of the segment. It is used as a means of storing and accessing segments. v A logical terminal can only own one segment in any one MSDB. In a dynamic related MSDB, you can store data summarizing the activity of all bank tellers at a single branch. For example, this segment contains: BRANCHNO The identification number for the branch TOTAL TRANCNT DEPBAL WTHBAL The bank branch's current balance The number of transactions for the branch on that day The deposit balance, giving the total dollar amount of deposits for the branch The withdrawal balance, giving the dollar amount of the withdrawals for the branch
Table 9 on page 17 shows what the branch summary segment looks like in a dynamic related MSDB.
16
How dynamic related MSDBs differ from fixed related MSDBs: v The owning logical terminal can delete and insert segments in a dynamic related MSDB. v The MSDB can have a pool of unassigned segments. This kind of segment is assigned to a logical terminal when the logical terminal inserts it, and is returned to the pool when the logical terminal deletes it.
Nonrelated MSDBs
A nonrelated MSDB is used to store data that is updated by several terminals during the same time period. For example, you might store data about an individuals' bank accounts in a nonrelated MSDB segment, so that the information can be updated by a teller at any terminal. Your program might need to access the data in the following segment fields: ACCNTNO BRANCH TRANCNT BALANCE The account number The name of the branch where the account is The number of transactions for this account this month The current balance
Table 10 shows what the account segment in a nonrelated MSDB application program looks like.
Table 10. Account Segment in a Nonrelated MSDB ACCNTNO BRANCH TRANCNT BALANCE
The characteristics of nonrelated MSDBs include: v Segments are not owned by terminals as they are in related MSDBs. Therefore, IMS programs and Fast Path programs can update these segments. Updating segments is not restricted to the owning logical terminal. v Your program cannot delete or insert segments. v Segment keys can be the name of a logical terminal. A nonrelated MSDB exists with terminal-related keys. The segments are not owned by the logical terminals, and the logical terminal name is used to identify the segment. v If the key is not the name of a logical terminal, it can be any value, and it is in the first field of the segment. Segments are loaded in key sequence.
17
18
Programming Guidelines
The number, type, and sequence of the IMS requests your program issues affects the efficiency of your program. A program that is poorly designed can still run if it is coded correctly. IMS will not find design errors for you. The suggestions that follow will help you develop the most efficient design possible for your application program. When you have a general sequence of calls mapped out for your program, look over the guidelines on sequence to see if you can improve it. An efficient sequence of requests results in efficient internal IMS processing. As you write your program, keep in mind the guidelines explained in this section. The following list offers programming guidelines that will help you write efficient and error-free programs. v Use the most simple call. Qualify your requests to narrow the search for IMS. v Use the request or sequence of requests that will give IMS the shortest path to the segment you want. v Use as few requests as possible. Each DL/I call your program issues uses system time and resources. You may be able to eliminate unnecessary calls by: Using path requests when you are replacing, retrieving, or inserting more than one segment in the same path. If you are using more than one request to do this, you are issuing unnecessary requests. Changing the sequence so that your program saves the segment in a separate I/O area, and then gets it from that I/O area the subsequent times it needs the segment. If your program retrieves the same segment more than once during program execution, you are issuing unnecessary requests. Anticipating and eliminating needless and nonproductive requests, such as requests that result in GB, GE, and II status codes. For example, if you are issuing GN calls for a particular segment type, and you know how many occurrences of that segment type exist, do not issue the GN that results in a GE status code. Keep track of the number of occurrences your program retrieves, and then continue with other processing when you know you have retrieved all the occurrences of that segment type. Issuing an insert request with a qualification for each parent, rather than issuing Get requests for the parents to make sure that they exist. If IMS
19
Programming Guidelines
returns a GE status code, at least one of the parents does not exist. When you are inserting segments, you cannot insert dependent segments unless the parent segments exist. | | | | | | | | | v Commit your updates regularly. IMS limits full-function databases so that only 300 databases at a time can have uncommitted updates. Logically related databases, secondary indexes, and HALDB partitions are counted towards this limit. The number of partitions in HALDB databases is the most common reason for approaching the 300 database limit for uncommitted updates. If the PROCOPT values allow a BMP application to insert, replace, or delete segments in the databases, ensure that the BMP application does not update a combined total of more than 300 databases and HALDB partitions without committing the changes. v Keep the main section of the program logic together. For example, branch to conditional routines, such as error and print routines in other parts of the program, instead of branching around them to continue normal processing. v Use call sequences that make good use of the physical placement of the data. Access segments in hierarchic sequence as often as possible, and avoid moving backward in the hierarchy. v Process database records in order of the key field of the root segments. (For HDAM and PHDAM databases, this order depends on the randomizing routine that is used. Check with your DBA for this information.) v Avoid constructing the logic of the program and the structure of commands or calls in a way that depends heavily on the database structure. Depending on the current structure of the hierarchy reduces the program's flexibility. v Minimize the number of segments your program locks. You may need to take checkpoints to release the locks on updated segments and the lock on the current database record for each PCB your program uses. Each PCB used by your program has the current database record locked at share or update level. If this lock is no longer required, issuing the GU call, qualified at the root level with a greater-than operator for a key of X'FF' (high values), releases the current lock without acquiring a new lock. | | | | | | Do not use the minimization technique if you use a randomizer that puts high values at the end of the database and you use secondary indexes. If there is another root beyond the supposed high value key, IMS returns a GE to allow the application to determine the next step. A secondary index might not work because the hierarchical structure is inverted, and although the key is past the last root in the index, it might not be past the last root in the database. Using PCBs with a processing option of get (G) results in locks for the PCB at share level. This allows other programs that use the get processing option to concurrently access the same database record. Using a PCB with a processing option that allows updates (I, R, or D) results in locks for the PCB at update level. This does not allow any other program to concurrently access the same database record. Related Reading: For more information about segment locking, see Reserving Segments for the Exclusive Use of Your Program on page 118.
| |
20
You can use SSA to select segments by name and to specify search criteria for specific segments. Specific segments are described by adding qualification statements to the DL/I call. You can further qualify your calls by using command codes. Table 11 shows the structure of a qualified SSA. Table 12 on page 27 shows the structure of an unqualified SSA using command codes. Finally, Table 13 on page 27 shows the structure of a qualified SSA that uses command codes.
Unqualified SSAs
An unqualified SSA gives the name of the segment type that you want to access. In an unqualified SSA, the segment name field is 8 bytes and must be followed by a 1-byte blank. If the actual segment name is fewer than 8 bytes long, it must be padded to the right with blanks. An example of an unqualified SSA follows:
PATIENT
Qualified SSAs
To qualify an SSA, you can use either a field or the sequence field of a virtual child. A qualified SSA describes the segment occurrence that you want to access. This description is called a qualification statement and has three parts. Table 11 shows the structure of a qualified SSA.
Table 11. Qualified SSA Structure SSA Component Seg Name ( Fld Name R.O. Fld Value ) Field Length 8 1 8 2 Variable 1
Using a qualification statement enables you to give IMS information about the particular segment occurrence that you are looking for. You do this by giving IMS the name of a field within the segment and the value of the field you are looking for. The field and the value are connected by a relational operator (R.O. in Table 11) which tells IMS how you want the two compared. For example, to access the PATIENT segment with the value 10460 in the PATNO field, you could use this SSA:
PATIENT (PATNO = 10460)
The qualification statement is enclosed in parentheses. The first field contains the name of the field (Fld Name in Table 11) that you want IMS to use in searching for the segment. The second field contains a relational operator. The relational operator can be any one of the following: v Equal, represented as
Chapter 2. Writing Your Application Programs
21
22
If the first sequence field is not included in a scattered sequence field in an SSA, IMS treats the argument as a data field specification, rather than as a sequence field. Related Reading: For more information on the virtual logical child segment, refer to IMS Version 9: Administration Guide: Database Manager.
SSA Guidelines
Using SSAs can simplify your programming, because the more information you can give IMS to do the searching for you, the less program logic you need to analyze and compare segments in your program. Using SSAs does not necessarily reduce system overhead, such as internal logic and I/Os, required to obtain a specific segment. To locate a particular segment without using SSAs, you can issue DL/I calls and include program logic to examine key fields until you find the segment you want. By using SSAs in your DL/I calls, you can reduce the number of DL/I calls that are issued and the program logic needed to examine key fields. When you use SSAs, IMS does this work for you. Recommendations: v Use qualified calls with qualified SSAs whenever possible. SSAs act as filters, returning only the segments your program requires. This reduces the number of calls your program makes, which provides better performance. It also provides better documentation of your program. Qualified SSAs are particularly useful when adding segments with insert calls. They ensure that the segments are inserted where you want them to go. v For the root segment, specify the key field and an equal relational operator, if possible. Using a key field with an equal-to, equal-to-or-greater-than, or greater-than operator lets IMS go directly to the root segment. v For dependent segments, it is desirable to use the key field in the SSA, although it is not as important as at the root level. Using the key field and an equal-to operator lets IMS stop the search at that level when a higher key value is encountered. Otherwise IMS must search through all occurrences of the segment type under its established parent in order to determine whether a particular segment exists. v If you often must search for a segment using a field other than the key field, consider putting a secondary index on the field. For more information on secondary indexing, see Chapter 7, Secondary Indexing and Logical Relationships, on page 149. Example: Suppose you want to find the record for a patient by the name of Ellen Carter. As a reminder, the patient segment in the examples contains three fields: the patient number, which is the key field; the patient name; and the patient address. The fact that patient number is the key field means that IMS stores the
23
If your program supplies an invalid number, or if someone has deleted Ellen Carter's record from the database, IMS does not need to search through all the PATIENT occurrences to determine that the segment does not exist. However, if your program does not have the number and must give the name instead, IMS must search through all the patient segments and read each patient name field until it finds Ellen Carter or until it reaches the end of the patient segments.
Logical OR
One more Boolean operator exists and is called the independent AND. Use it only with secondary indexes. Multiple Qualification Statements with Secondary Indexes on page 150 describes its use. For a segment to satisfy multiple qualification statements, the segment must satisfy a set of qualification statements. A set is a number of qualification statements that are joined by an AND. To satisfy a set, a segment must satisfy each of the qualification statements within that set. Each OR starts a new set of qualification statements. When processing multiple qualification statements, IMS reads them left to right and processes them in that order. When you include multiple qualification statements for a root segment, the fields you name in the qualification statements affect the range of roots that IMS examines to satisfy the call. DL/I examines the qualification statements to determine the minimum acceptable key value. If one or more of the sets do not include at least one statement that is qualified on the key field with an operator of equal-to, greater-than, or equal-to-or-greater-than, IMS starts at the first root of the database and searches for a root that meets the qualification.
24
In this case, the minimum and maximum key is 10. This means that IMS starts searching with key 10 and stops when it encounters the first key greater than 10. To satisfy the SSA, the ROOTKEY field must be equal to 10, and FIELDB must be equal to either ABC or XYZ.
ROOTKEY =>10&ROOTKEY =<20
In this case, the minimum key is 10 and the maximum key is 20. Keys in the range of 10 to 20 satisfy the SSA. IMS stops the search when it encounters the first key greater than 20.
ROOTKEY =>10&ROOTKEY =<20+ROOTKEY =>110&ROOTKEY =<120
In this case, the minimum key is 10 and the maximum key is 120. Keys in the range of 10 to 20 and 110 to 120 satisfy the call. IMS stops the search when it encounters the first key greater than 120. IMS does not scan from 20 to 110 but skips forward (using the index for HIDAM or PHIDAM) from 20 to 110. Because of this, you can use ranges for more efficient program operation. When you use multiple qualification statement segments that are part of logical relationships, additional considerations exist. See How Logical Relationships Affect Your Programming on page 154 for more information about these considerations.
25
In other words, you want IMS to return any ILLNESS segment occurrences under patient number 04120 that have a date on or after January 1, 1992, and on or before December 31, 1992, joined with an AND connector. Suppose you wanted to answer the following request: Did we see Judy Jennison during January of 1992 or during July of 1992? Her patient number is 05682. You could issue a GU call with the following SSAs:
GU PATIENT (PATNO EQ05682) ILLNESS (ILLDATE >=19920101&ILLDATE <=19920131| ILLDATE >=19920701&ILLDATE <=19920731)
To satisfy this request, the value for ILLDATE must satisfy either of the two sets. IMS returns any ILLNESS segment occurrences for the month of January 1992, or for the month of July 1992.
26
The call function and the SSAs for the call look like this:
GU A C E F *D *D *D
A command code consists of one letter. Code the command codes in the SSA after the segment name field. Separate the segment name field and the command code with an asterisk, as shown in Table 12.
Table 12. Unqualified SSA with Command Code SSA Component Seg Name * Cmd Code b Field Length 8 1 Variable 1
Your program can use command codes in both qualified and unqualified SSAs. However, command codes cannot be used by MSDB calls. If the command codes are not followed by qualification statements, they must each be followed by a 1-byte blank. If the command codes are followed by qualification statements, do not use the blank. The left parenthesis of the qualification statement follows the command code instead, as indicated in Table 13.
Table 13. Qualified SSA with Command Code SSA Component Seg Name * Cmd Code ( Fld Name R.O. Fld Value ) Field Length 8 1 Variable 1 8 2 Variable 1
If your program uses command codes to manage subset pointers in a DEDB, enter the number of the subset pointer immediately after the command code. Subset pointers are a means of dividing a chain of segment occurrences under the same
Chapter 2. Writing Your Application Programs
27
28
| | | | | | |
v Coding a Batch Program in PL/I on page 46 v Coding a CICS Online Program in PL/I on page 50
29
3 4
5 6
30
11
Notes to Figure 8 on page 30: 1. The entry point to an assembler language program can have any name. Also, you can substitute CBLTDLI for ASMTDLI in any of the calls. 2. When IMS passes control to the application program, register 1 contains the address of a variable-length fullword parameter list. Each word in this list contains the address of a PCB that the application program must save. The high-order byte of the last word in the parameter list has the 0 bit set to a value of 1 which indicates the end of the list. The application program subsequently uses these addresses when it executes DL/I calls. 3. The program loads the address of the DETAIL DB PCB. 4. The program issues a GU call to the DETAIL database using a qualified SSA (SSANAME). 5. The program loads the address of the HALDB master PCB. 6. The next three calls that the program issues are to the HALDB master. The first is a GHU call that uses an unqualified SSA. The second is an unqualified GHN call. The REPL call replaces the segment retrieved using the GHN call with the segment in the MSTSEGIO area. You can use the parmcount parameter in DL/I calls in assembler language instead of the VL parameter, except for in the call to the sample status-code error routine. 7. The RETURN statement loads IMS registers and returns control to IMS. 8. The call functions are defined as four-character constants. 9. The program defines each part of the SSA separately so that it can modify the SSA's fields. 10. The program must define an I/O area that is large enough to contain the largest segment it is to retrieve or insert (or the largest path of segments if the program uses the D command code). This program's I/O areas are 100 bytes each. 11. A fullword must be defined for each PCB. The assembler language program can access status codes after a DL/I call by using the DB PCB base addresses. This example assumes that an I/O PCB was passed to the application program. If the program is a batch program, CMPAT=YES must be specified on the PSBGEN statement of PSBGEN so that the I/O PCB is included.
Chapter 2. Writing Your Application Programs
31
32
* * *
* *
9,10
Notes to the example: 1. The program must define an I/O area that is large enough to contain the largest segment it is to retrieve or insert (or the largest path of segments if the program uses the D command code). 2. The DLIUIB statement copies the UIB DSECT, which is expanded as shown under Specifying the UIB (CICS Online Programs Only) on page 77. 3. A fullword must be defined for each DB PCB. The assembler language program can access status codes after a DL/I call by using the DB PCB base addresses. 4. This is an unqualified SSA. For qualified SSA, define each part of the SSA separately so that the program can modify the fields of the SSA. 5. This call schedules the PSB and obtains the PSB address. 6. This call retrieves a segment from the database. CICS online assembler language programs use the CALLDLI macro, instead of the call statement, to access DL/I databases. This macro is similar to the call statement. It looks like this:
Chapter 2. Writing Your Application Programs
33
7. CICS online programs must check the return code in the UIB before checking the status code in the DB PCB. 8. The REPL call replaces the data in the segment that was retrieved by the most recent Get Hold call. The data is replaced by the contents of the I/O area referenced in the call. 9. This call releases the PSB. 10. The RETURN statement loads IMS registers and returns control to IMS. | Related Reading: For more information on installing CICS application programs, see CICS/MVS Installation Guide.
34
7 */ */ */ 8 9 10 11 12
/* /* /*
Main part of C batch program ctdli(func_GU, detail_PCB, &det_seg_io_area,qual_ssa); ctdli(func_GHU, mast_PCB, &mast_seg_io_area,qual_ssa); ctdli(func_GHN, mast_PCB, &mast_seg_io_area); ctdli(func_REPL, mast_PCB, &mast_seg_io_area;
Notes to Figure 10: 1. The env(IMS) establishes the correct operating environment and the plist(IMS) establishes the correct parameter list when invoked under IMS. The ims.h header file contains declarations for PCB layouts, __pcblist, and the ctdli routine. The PCB layouts define masks for the PCBs that the program uses as structures. These definitions make it possible for the program to check fields in the PCBs. The stdio.h header file contains declarations for sprintf (used to build up the SSA). 2. After IMS has loaded the application program's PSB, IMS gives control to the application program through this entry point. 3. The C run-time sets up the __pcblist values. The order in which you refer to the PCBs must be the same order in which they have been defined in the PSB. (Values other than 10 and 20 can be used, according to the actual key lengths needed.) These declarations can be done using macros, such as:
#define IO_PCB (IO_PCB_TYPE *) (__pcblist[0]) #define mast_PCB (__pcblist[1]) #define detail_PCB (__pcblist[2])
This example assumes that an I/O PCB was passed to the application program. When the program is a batch program, CMPAT=YES must be specified on the PSBGEN statement of PSBGEN so that the I/O PCB is included. Because the I/O PCB is required for a batch program to make system service calls, CMPAT=YES should always be specified for batch programs. 4. Each of these areas defines one of the call functions used by the batch program. Each character string is defined as four alphanumeric characters, with a value assigned for each function. (If the [4]s had been left out, 5 bytes would have been reserved for each constant.) You can define other constants in the same way. Also, you can store standard definitions in a source library and include them by using a #include directive. Instead, you can define these by macros, although each string would have a trailing null ('\0').
35
8. This call retrieves data from the database. It contains a qualified SSA. Before you can issue a call that uses a qualified SSA, initialize the data field of the SSA. Before you can issue a call that uses an unqualified SSA, initialize the segment name field. Unlike the COBOL, PL/I, and Pascal interface routines, ctdli also returns the status code as its result. (Blank is translated to 0.) So, you can code:
switch (ctdli(....)) { case 0: ... /* everything ok */ break; case AB: .... break; case IX: ... break; default: }
You can pass only the PCB pointer for DL/I calls in a C program. 9. This is another call with a qualified SSA. 10. This call is an unqualified call that retrieves data from the database. Because it is a Get Hold call, it can be followed by REPL or DLET. 11. The REPL call replaces the data in the segment that was retrieved by the most recent Get Hold call. The data is replaced by the contents of the I/O area that is referenced in the call. 12. The end of the main routine (which can be done by a return statement or exit call) returns control to IMS. | | | |
36
PICTURE XXXX VALUE GU . PICTURE XXXX VALUE GHU . PICTURE XXXX VALUE GHN . PICTURE XXXX VALUE GHN . PICTURE XXXX VALUE GNP . PICTURE XXXX VALUE GHNP. PICTURE XXXX VALUE REPL. PICTURE XXXX VALUE ISRT. PICTURE XXXX VALUE DLET. PICTURE S9(5)VALUE +4 COMPUTATIONAL. PICTURE X(08) VALUE PICTURE X VALUE . PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE X(08) X X(08) X(02) X(06) X X(08) X X(08) X(02) X(06) X VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE . 2
PICTURE X(10). PICTURE XX. PICTURE X(20). PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE PICTURE X(8). XX. XX. XXXX. S9(5) COMPUTATIONAL. X(8). S9(5) COMPUTATIONAL. S9(5) COMPUTATIONAL. XX. X(8). XX. XX. XXXX. S9(5) COMPUTATIONAL. X(8). S9(5) COMPUTATIONAL. S9(5) COMPUTATIONAL. XX. 5
37
10 11
Notes to Figure 11: 1. You define each of the DL/I call functions the program uses with a 77-level or 01-level working storage entry. Each picture clause is defined as four alphanumeric characters and has a value assigned for each function. If you want to include the optional parmcount field, you can initialize count values for each type of call. You can also use a COBOL COPY statement to include these standard descriptions in the program. 2. A 9-byte area is set up for an unqualified SSA. Before the program issues a call that requires an unqualified SSA, it moves the segment name to this area. If a call requires two or more SSAs, you may need to define additional areas. 3. A 01-level working storage entry defines each qualified SSA that the application program uses. Qualified SSAs must be defined separately, because the values of the fields are different. 4. A 01-level working storage entry defines I/O areas that are used for passing segments to and from the database. You can further define I/O areas with 02-level entries. You can use separate I/O areas for each segment type, or you can define one I/O area that you use for all segments. 5. A 01-level linkage section entry defines a mask for each of the PCBs that the program requires. The DB PCBs represent both input and output databases. After issuing each DL/I call, the program checks the status code through this linkage. You define each field in the DB PCB so that you can reference it in the program. 6. This is the standard procedure division statement of a batch program. After IMS has loaded the PSB for the program, IMS passes control to the application program. The PSB contains all the PCBs that are defined in the PSB. The coding of USING on the procedure division statement references each of the PCBs by the names that the program has used to define the PCB masks in the linkage section. The PCBs must be listed in the order in which they are defined in the PSB. The example in Figure 11 assumes that an I/O PCB was passed to the application program. When the program is a batch program, CMPAT=YES must be specified on the PSBGEN statement of PSBGEN so that the I/O PCB
38
2 3
39
* * * *
10
* * * *
11,12
Notes to example: 1. You define each of the DL/I call functions the program uses with a 77-level or 01-level working storage entry. Each picture clause is defined as four alphanumeric characters and has a value assigned for each function. If you want to include the optional parmcount field, initialize count values for each type of call. You can also use the COBOL COPY statement to include these standard descriptions in the program. 2. A 9-byte area is set up for an unqualified SSA. Before the program issues a call that requires an unqualified SSA, it can either initialize this area with the
40
3.
4. 5. 6.
| | |
7. One PCB layout is defined in the linkage section. The PCB-ADDRESS-LIST occurs n times, where n is greater than or equal to the number of PCBs in the PSB. 8. The PCB call schedules a PSB for your program to use. The address of the DLIUIB parameter returns the address of DLIUIB. 9. This unqualified GHU call retrieves a segment from the database and places it in the I/O area that is referenced by the call. Before issuing the call, the program must initialize the key or data value of the SSA so that it specifies the particular segment to be retrieved. 10. CICS online programs should test the return code in the UIB before testing the status code in the DB PCB. 11. The REPL call replaces the segment that was retrieved in the most recent Get Hold call with the data that the program has placed in the I/O area. 12. The TERM call terminates the PSB the program scheduled earlier. This call is optional and is only issued if a sync point is desired prior to continued processing. The program issues the EXEC CICS RETURN statement when it has finished its processing. If this is a RETURN from the highest-level CICS program, a TERM call and sync point are internally generated by CICS.
41
3 4
5,6 7
10
42
* * *
11
* *
12,13
Figure 12. Sample Call-Level OS/V COBOL program (CICS Online) (Part 2 of 2)
Notes to Figure 12: 1. You define each of the DL/I call functions the program uses with a 77-level or 01-level working storage entry. Each picture clause is defined as four alphanumeric characters and has a value assigned for each function. If you want to include the optional parmcount field, you can initialize count values for each type of call. You can also use the COBOL COPY statement to include these standard descriptions in the program. 2. A 9-byte area is set up for an unqualified SSA. Before the program issues a call that requires an unqualified SSA, it can either initialize this area with the segment name or move the segment name to this area. If a call requires two or more SSAs, you may need to define additional areas. 3. An 01-level working storage entry defines I/O areas that are used for passing segments to and from the database. You can further define I/O areas with 02-level entries. You can use separate I/O areas for each segment type, or you can define one I/O area to use for all segments. 4. The linkage section must start with a definition of this type to provide addressability to a parameter list that will contain the addresses of storage that is outside the working storage of the application program. The first 02-level definition is used by CICS to provide addressability to the other fields in the list. A one-to-one correspondence exists between the other 02-level names and the 01-level data definitions in the linkage section. 5. The COPY DLIUIB statement will be expanded as shown in Figure 18 on page 79. 6. The UIB returns the address of an area that contains the PCB addresses. The definition of PCB pointers is necessary to obtain the actual PCB addresses. Do not alter the addresses in the area. 7. The PCBs are defined in the linkage section. 8. The PCB call schedules a PSB for your program to use. 9. This unqualified GHU call retrieves a segment from the database and places it in the I/O area that is referenced by the call. Before issuing the call, the program must initialize the key or data value of the SSA so that it specifies the particular segment to be retrieved. 10. CICS online programs should test the return code in the UIB before testing the status code in the DB PCB. 11. The REPL call replaces the segment that was retrieved in the most recent Get Hold call with the data that the program has placed in the I/O area.
Chapter 2. Writing Your Application Programs
43
Ensuring Addressability Using the COBOL Optimization Feature (CICS Online Only)
| | | | | If you use the OS/VS COBOL compiler (5740-CB1) with the OPTIMIZE feature, you must use the SERVICE RELOAD compiler control statement in your program to ensure addressability to areas that are defined in the LINKAGE SECTION. If you use the Enterprise COBOL compiler, the SERVICE RELOAD statement is not required. The format of the SERVICE RELOAD statement is:
SERVICE RELOAD fieldname
fieldname is the name of a storage area defined in a 01-level statement in the LINKAGE SECTION. Use the SERVICE RELOAD statement after each statement that modifies addressability to an area in the LINKAGE SECTION. Include the SERVICE RELOAD statement after the label if the statement might cause a branch to another label. If you specify NOOPTIMIZE when compiling your program, you do not need to use the SERVICE RELOAD statement. However, use this statement to ensure that the program will execute correctly if it is compiled using the OPTIMIZE option. For more information on using the SERVICE RELOAD statement, see CICS/ESA Application Programmer's Reference.
44
6 7
45
10
11 12 13
Notes to Figure 13: 1. Define the name of the Pascal compile unit. 2. Define the data types that are needed for the PCBs used in your program. 3. Define the PCB data type that is used in your program. 4. Declare the procedure heading for the REENTRANT procedure that is called by IMS. The first word in the parameter list should be an INTEGER, which is reserved for VS Pascal's usage. The rest of the parameters are the addresses of the PCBs that are received from IMS. 5. Define the data types that are needed for the SSAs and I/O areas. 6. Declare the variables used for the I/O areas. 7. Define the constants, such as function codes and SSAs that are used in the PASTDLI DL/I calls. 8. Declare the IMS interface routine by using the GENERIC directive. GENERIC identifies external routines that allow multiple parameter list formats. A GENERIC routine's parameters are declared only when the routine is called. 9. This call retrieves data from the database. It contains a qualified SSA. Before you can issue a call that uses a qualified SSA, you must initialize the data field of the SSA. Before you can issue a call that uses an unqualified SSA, you must initialize the segment name field. 10. This is another call that has a qualified SSA. 11. This call is an unqualified call that retrieves data from the database. Because it is a Get Hold call, it can be followed by a REPL or DLET call. 12. The REPL call replaces the data in the segment that was retrieved by the most recent Get Hold call; the data is replaced by the contents of the I/O area that is referenced in the call. 13. You return control to IMS by exiting from the PASCIMS procedure. You can also code a RETURN statement to exit at another point. | | |
46
47
DCL 1
DCL DCL DCL DCL /* */ /* MAIN PART OF PL/I BATCH PROGRAM */ /* */ CALL PLITDLI (FOUR,FUNC_GU,DB_PCB_DETAIL,DET_SEG_IO_AREA, QUAL_SSA); IF DET_STAT_CODE = GOOD_STATUS_CODE THEN DO; CALL PLITDLI (FOUR,FUNC_GHU,DB_PCB_MAST,MAST_SEG_IO_AREA,QUAL_SSA); IF MAST_STAT_CODE = GOOD_STATUS_CODE THEN DO; CALL PLITDLI (THREE,FUNC_GHN,DB_PCB_MAST,MAST_SEG_IO_AREA); IF MAST_STAT_CODE = GOOD_STATUS_CODE THEN DO; CALL PLITDLI (THREE,FUNC_REPL,DB_PCB_MAST,MAST_SEG_IO_AREA); IF MAST_STAT_CODE ^= GOOD_STATUS_CODE THEN DO; /* INSERT REPLACE DIAGNOSTIC MESSAGE */ END; ELSE DO; /* INSERT GHN DIAGNOSTIC MESSAGE */ END; ELSE DO; /* INSERT GHU DIAGNOSTIC MESSAGE */ END; ELSE DO; /* INSERT GU DIAGNOSTIC MESSAGE */ END; RETURN; END DLITPLI;
7 8 9 10
11
| | Figure 14. Sample PL/I Program (Part 2 of 2) | Notes to Figure 14: | | | | | | | | | | 1. After IMS has loaded the PSB of the application program, IMS gives control to the application program through this entry point. PL/I programs must pass the pointers to the PCBs, not the names, in the entry statement. The entry statement lists the PCBs that the program uses by the names that it has assigned to the definitions for the PCB masks. The order in which you refer to the PCBs in the entry statement must be the same order in which they have been defined in the PSB. The example in Figure 14 on page 47 assumes that an I/O PCB was passed to the application program. When the program is a batch program, CMPAT=YES must be specified on the PSBGEN statement of PSBGEN so that the I/O PCB
48
7. This call retrieves data from the database. It contains a qualified SSA. Before you can issue a call that uses a qualified SSA, initialize the data field of the SSA. Before you can issue a call that uses an unqualified SSA, initialize the segment name field. Check the status code after each DL/I call that you issue. Although you must declare the PCB parameters that are listed in the entry statement to a PL/I program as POINTER data types, you can pass either the PCB name or the PCB pointer in DL/I calls in a PL/I program. 8. This is another call that has a qualified SSA. 9. This is an unqualified call that retrieves data from the database. Because it is a Get Hold call, it can be followed by REPL or DLET. 10. The REPL call replaces the data in the segment that was retrieved by the most recent Get Hold call; the data is replaced by the contents of the I/O area referenced in the call. 11. The RETURN statement returns control to IMS.
49
50
3 4 5 6
7 8 9
10
11 12
Notes to Figure 15: 1. Each of these areas defines the DL/I call functions the program uses. Each character string is defined as four alphanumeric characters and has a value assigned for each function. You can define other constants in the same way. You can store standard definitions in a source library and include them by using a %INCLUDE statement.
Chapter 2. Writing Your Application Programs
51
| |
52
v GSAM Databases on page 85 v The AIBTDLI Interface on page 85 v Language Specific Entry Points on page 86 v v v v Program Communication Block (PCB) Lists on page 89 The AERTLDI interface on page 91 Language Environments on page 91 Special DL/I Situations on page 93
Related Reading: For detailed information on specific parameters for the DL/I calls, see Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249.
53
Format
CALL (2) ASMTDLI,( (1) parmcount, function ,db pcb ,tp pcb C (2) AIBTDLI,( (1) parmcount, (1) ) ,VL function, aib A B A A B
A:
,i/o area , ,ssa ,token ,stat function ,rsa ,rootssa
B:
,i/o area length, i/o area , ,area length,area
54
Notes: 1 2 Assembler language must use either parmcount or VL. See Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249 for descriptions of call functions and parameters.
Parameters
parmcount Specifies the address of a 4-byte field in user-defined storage that contains the number of parameters in the parameter list that follows parmcount. Assembler language application programs must use either parmcount or VL. function Specifies the address of a 4-byte field in user-defined storage that contains the call function. The call function must be left-justified and padded with blanks (such as GU ). db pcb Specifies the address of the database PCB to be used for the call. The PCB address must be one of the PCB addresses passed on entry to the application program in the PCB list. tp pcb Specifies the address of the I/O PCB or alternate PCB to be used for the call. The PCB address must be one of the PCB addresses passed on entry to the application program in the PCB list. aib Specifies the address of the application interface block (AIB) in user-defined storage. For more information on AIB, see The AIBTDLI Interface on page 85. i/o area Specifies the address of the I/O area in user-defined storage that is used for the call. The I/O area must be large enough to contain the returned data. i/o area length Specifies the address of a 4-byte field in user-defined storage that contains the I/O area length (specified in binary). area length Specifies the address of a 4-byte field in user-defined storage that contains the length (specified in binary) of the area immediately following it in the parameter list. Up to seven area lengths or area pairs can be specified. area Specifies the address of the area in user-defined storage to be checkpointed. Up to seven area lengths or area pairs can be specified. token Specifies the address of a 4-byte field in user-defined storage that contains a user token.
55
Format
56
A:
,i/o area , ,ssa ,token ,stat function ,rsa ,rootssa
B:
,i/o area length, i/o area , ,area length,area
C:
,psb name, uibptr ,sysserve
Notes: 1 See Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249 for descriptions of call functions and parameters. For AIBTDLI, parmcount is required for C applications.
Parameters
rc This parameter receives the DL/I status or return code. It is a two-character field shifted into the 2 low-order bytes of an integer variable (int). If the status code is two blanks, 0 is placed in the field. You can test the rc parameter with
Chapter 3. Defining Application Program Elements
57
58
I/O Area
In C, the I/O area can be of any type, including structures or arrays. The ctdli declarations in ims.h do not have any prototype information, so no type checking of the parameters is done. The area may be auto, static, or allocated (with malloc or calloc). You need to give special consideration to C-strings because DL/I does not recognize the C convention of terminating strings with nulls ('\0') Instead of the usual strcpy and strcmp functions, you may want to use memcpy and memcmp.
Format
CALL
59
A:
,i/o area , ,ssa ,token ,stat function ,rsa ,rootssa
B:
,i/o area length, i/o area , ,area length,area
C:
,psb name, uibptr ,sysserve
Notes: 1 See Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249 for descriptions of call functions and parameters.
Parameters
parmcount Specifies the identifier of a usage binary (4) byte data item in user-defined storage that contains the number of parameters in the parameter list that follows parmcount. function Specifies the identifier of a usage display (4) byte data item, left justified in
60
61
Format
PASTDLI ( A ,VAR ,VAR db pcb tp pcb B B C AIBTDLI ( A , D VAR aib, B C );
A:
(1) CONST CONST parmcount , function
B:
,VAR i/o area , ,VAR ssa ,CONST token ,CONST stat function ,VAR rsa ,VAR rootssa
62
D:
,VAR psb name, VAR uibptr ,VAR sysserve
Notes: 1 See Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249 for descriptions of call functions and parameters.
Parameters
parmcount Specifies the name of a fixed binary (31) variable in user-defined storage that contains the number of parameters in the parameter list that follows parmcount. function Specifies the name of a character (4) variable, left justified in user-defined storage, that contains the call function to be used. The call function must be left-justified and padded with blanks (such as GU ). db pcb Specifies the name of a pointer variable that contains the address of the database PCB defined in the call procedure statement. tp pcb Specifies the name of a pointer variable that contains the address of the I/O PCB or alternate PCB defined in the call procedure statement. aib Specifies the name of the pointer variable that contains the address of the structure that defines the application interface block (AIB) in user-defined storage. For more information on the AIB, see The AIBTDLI Interface on page 85. i/o area Specifies the name of a pointer variable to a major structure, array, or character string that defines the I/O area in user-defined storage used for the call. The I/O area must be large enough to contain all of the returned data. i/o area length Specifies the name of a fixed binary (31) variable in user-defined storage that contains the I/O area length. area length Specifies the name of a fixed binary (31) variable in user-defined storage that contains the length of the area immediately following it in the parameter list. Up to seven area lengths or area pairs can be specified. area Specifies the name of the pointer variable that contains the address of the
Chapter 3. Defining Application Program Elements
63
Format
64
A:
,i/o area , ,ssa ,token ,stat function ,rsa ,rootssa
B:
,i/o area length, i/o area , ,area length,area
C:
,psb name, uibptr ,sysserve
Notes: 1 See Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249 for descriptions of call functions and parameters.
Parameters
parmcount Specifies the name of a fixed binary (31-byte) variable that contains the number of arguments that follow parmcount.
65
).
db pcb Specifies the structure associated with the database PCB to be used for the call. This structure is based on a PCB address that must be one of the PCB addresses passed on entry to the application program. tp pcb Specifies the structure associated with the I/O PCB or alternate PCB to be used for the call. aib Specifies the name of the structure that defines the AIB in your application program. For more information on the AIB, see The AIBTDLI Interface on page 85. i/o area Specifies the name of the I/O area used for the call. The I/O area must be large enough to contain all the returned data. i/o area length Specifies the name of a fixed binary (31) variable that contains the I/O area length. area length Specifies the name of a fixed binary (31) variable that contains the length of the area immediately following it in the parameter list. Up to seven area lengths or area pairs can be specified. area Specifies the name of the area to be checkpointed. Up to seven area lengths or area pairs can be specified. token Specifies the name of a character (4) variable that contains a user token. stat function Specifies the name of a character (9) variable string containing the stat function to be performed. ssa Specifies the name of a character variable that contains the SSAs to be used for the call. Up to 15 SSAs can be specified, one of which is rootssa. rootssa Specifies the name of a character variable that contains a root segment search argument. rsa Specifies the name of a character variable that contains the record search argument. psb name Specifies the name of a character (8) containing the PSB name to be used for the call. uibptr Specifies the name of the user interface block (UIB). sysserve Specifies the name of a character (8) variable character string to be used for the call.
66
DB/DC X X X X X X X X X X X X X
DBCTL
DCCTL X X
DB Batch
TM Batch
X X X X X X X X X X X
2 2 4 8
Time
67
68
69
70
DB/DC X X X X X X X X X
DBCTL X X X X X X X X X
DCCTL
DB Batch X X X X X X X X X
TM Batch
Length of key feedback area 7 Number of sensitive segments 8 Key feedback area
9
Notes: 1. Database Name This contains the name of the database. This field is 8 bytes long and contains character data. 2. Segment Level Number This field contains numeric character data. It is 2 bytes long and right-justified. When IMS retrieves the segment you have requested, IMS places the level number of that segment in this field. If you are retrieving several segments in a hierarchic path with one call, IMS places the number of the lowest-level segment retrieved. If IMS is unable to find the segment that you request, it gives you the level number of the last segment it encounters that satisfied your call. 3. Status Code After each DL/I call, this field contains the two-character status code that describes the results of the DL/I call. IMS updates this field after each call and does not clear it between calls. The application program should test this field after each call to find out whether the call was successful. When the program is initially scheduled, this field contains a data-availability status code, which indicates any possible access constraint based on segment sensitivity and processing options. Related Reading: For more information on these status codes, seeINIT Call on page 261. During normal processing, four categories of status codes exist: v Successful or exceptional but valid conditions. If the call was completely successful, this field contains blanks. Many of the codes in this category are for information only. For example, GB means that IMS has reached the end of the database without satisfying the call. This situation is expected in sequential processing and is not usually the result of an error. v Errors in the program. For example, AK means that you have included an invalid field name in a segment search argument (SSA). Your program should have error routines available for these status codes. If IMS returns an error status code to your program, your program should terminate. You can then find the problem, correct it, and restart your program.
71
72
Byte Length 8 4
3
DB/DC X X X X
DBCTL DCCTL X X X X X X X X
DB Batch X X X X
TM Batch X X X X
8 8 16 4 4 12
X X
X X
X X
X X
X X
4 4 4 4 48
12
X X X X
X X
X X X
X X
X X
Notes: 1. AIB Identifier (AIBID) This 8-byte field contains the AIB identifier. You must initialize AIBID in your application program to the value DFSAIB before you issue DL/I calls. This field is required. When the call is completed, the information returned in this field is unchanged. 2. DFSAIB Allocated Length (AIBLEN) This field contains the actual 4-byte length of the AIB as defined by your program. You must initialize AIBLEN in your application program before you issue DL/I calls. The minimum length required is 128 bytes. When the call is completed, the information returned in this field is unchanged. This field is required. 3. Subfunction Code (AIBSFUNC) This 8-byte field contains the subfunction code for those calls that use a subfunction. You must initialize AIBSFUNC in your application program before you issue DL/I calls. When the call is completed, the information returned in this field is unchanged. 4. Resource Name (AIBRSNM1) This 8-byte field contains the name of a resource. The resource varies depending on the call. You must initialize AIBRSNM1 in your application
Chapter 3. Defining Application Program Elements
73
74
Notes for AIB Fields for Use of ODBA Applications: 1. AIB Identifier (AIBID) This 8-byte field contains the AIB identifier. You must initialize AIBID in your application program to the value DFSAIB before you issue DL/I calls. This field is required. When the call is completed, the information returned in this field is unchanged. 2. DFSAIB Allocated Length (AIBLEN) This field contains the actual 4-byte length of the AIB as defined by your program. You must initialize AIBLEN in your application program before you issue DL/I calls. The minimum length required is 264 bytes for ODBA. When the call is completed, the information returned in this field is unchanged. This field is required. 3. Subfunction Code (AIBSFUNC) This 8-byte field contains the subfunction code for those calls that use a subfunction. You must initialize AIBSFUNC in your application program before you issue DL/I calls. When the call is completed, the information returned in this field is unchanged. 4. Resource Name (AIBRSNM1) #1 This 8-byte field contains the name of a resource. The resource varies depending on the call. You must initialize AIBRSNM1 in your application program before you issue DL/I calls. When the call is complete, the information returned in this field is unchanged. This field is required. For PCB related calls where the AIB is used to pass the PCB name instead of passing the PCB address in the call list, this field contains the PCB name. The PCB name for the I/O PCB is IOPCB . The PCB name for other types of PCBs is defined in the PCBNAME= parameter in PSBGEN.
75
76
AIBRETRN AIBREASN AIBRRXT AIBRSA1 AIBRSA2 AIBRSA3 AIBLL AIBSAVE AIBTOKN AIBTOKC AIBTOKV AIBTOKA AIBAERL
77
01
PCB-ADDRESSES. 02 PCB-ADDRESS-LIST USAGE IS POINTER OCCURS 10 TIMES. 01 PCB1. 02 PCB1-DBD-NAME PIC X(8). 02 PCB1-SEG-LEVEL PIC XX. . . . Figure 16. Defining the UIB, PCB Address List, and the PCB Mask for VS COBOL II
Figure 17 provides an example of using the COPY DLIUIB statement in an OS/VS COBOL program.
LINKAGE SECTION. 01 BLL CELLS. 02 FILLER 02 UIB-PTR 02 PCB-LIST-PTR 02 PCB1-PTR COPY DLIUIB. 01 PCB-ADDRESS-LIST. 02 PCB1-LIST-PTR PIC S9(8) COMP. 01 PCB1. 02 PCB1-DBD-NAME PIC X(8). 02 PCB1-SEG-LEVEL PIC XX. . . . Figure 17. Defining the UIB, PCB Address List, and the PCB Mask for OS/VS COBOL
78
* 03
The values placed in level 88 entries are not printable. They are described in Chapter 16, CICS-DL/I User Interface Block Return Codes, on page 377. The meanings of the field names and their hexadecimal values are shown below: FCNORESP Normal response X'00' FCNOTOPEN Not open X'0C' FCINVREQ Invalid request X'08' FCINVPCB Invalid PCB X'10' DLPSBNF PSB not found X'01' DLTASKNA Task not authorized X'02' DLPSBSCH PSB already scheduled X'03' DLLANGCON Language conflict X'04' DLPSBFAIL PSB initialization failed X'05' DLPSBNA PSB not authorized X'06' DLTERMNS Termination not successful X'07'
79
EXTENDED CALL USER INTFC BLK*/ PCB ADDRESS LIST */ DL/I RETURN CODES */ RETURN CODES */ ADDITIONAL INFORMATION */
Figure 19. Defining the UIB, PCB Address List, and the PCB Mask for PL/I
Figure 20 shows you how to define the UIB, PCB address list, and PCB mask for assembler language.
DLIUIB UIB UIBPCBAL UIBRCODE UIBFCTR UIBDLTR UIBLEN DSECT DS DS DS DS DS DS DS EQU 0F A 0XL2 X X 2X 0F *-UIB EXTENDED CALL USER INTFC BLK PCB ADDRESS LIST DL/I RETURN CODES RETURN CODE ADDITIONAL INFORMATION RESERVED LENGTH IS FULLWORD MULTIPLE LENGTH OF UIB
Figure 20. Defining the UIB, PCB Address List, and the PCB Mask for Assembler Language
80
The comparative value follows the relational operator. The length of this value must be equal to the length of the field that you specified in the field name. This length is defined in the DBD. The comparative value must include leading zeros for numeric values or trailing blanks for alphabetic values as necessary. v If you are using multiple qualification statements within one SSA (Boolean qualification statements), the qualification statements must be separated by one of these symbols: * or & Dependent AND + or | Logical OR
Chapter 3. Defining Application Program Elements
81
You can use an SSA that is coded like this for each DL/I call that needs an unqualified SSA by supplying the name of the segment type you want during program execution. Note that the string size declarations are such that the C null terminators do not appear within the structure. You can, of course, declare this as a single string:
const char unqual_ssa[] = "NAME "; /* 8 chars + 1 blank */
DL/I ignores the trailing null characters. You can define SSAs in any of the ways explained for the I/O area.
82
Another way is to define the SSA as a string, using sprintf. Remember to use the preprocessor directive #include <stdio.h>.
char qual_ssa[8+1+8+2+6+1+1]; /* the final 1 is for the */ /* trailing \0 of string */ sprintf(qual_ssa, "%-8.8s(%-8.8s%2.2s%-6.6s)", "ROOT", "KEY", "=", "vvvvv");
Alternatively, if only the value were changing, the sprintf call can be:
sprintf(qual_ssa, "ROOT (KEY =%-6.6s)", "vvvvv"); /* 12345678 12345678 */
These SSAs are both taken from the C skeleton program shown in Figure 10 on page 34. To see how SSAs are used in DL/I calls, refer to that program.
By supplying the name of the segment type you want during program execution, you can use an SSA coded like the one in this example for each DL/I call that needs an unqualified SSA. Use a 01 level working storage entry to define each SSA that the program is to use. Then use the name you have given the SSA as the parameter in the DL/I call, in this case:
UNQUAL-SSA,
The following SSA is an example of a qualified SSA that does not use command codes. If you use command codes in this SSA, code the asterisk (*) and the command code between the 8-byte segment name field and the left parenthesis that begins the qualification statement.
83
These SSAs are both taken from the COBOL skeleton program in Figure 11 on page 37. To see how they are used in a DL/I call, refer to that program.
The SSA shown in Figure 22 is an example of a qualified SSA that does not use command codes. If you use command codes in this SSA, code the asterisk (*) and the command code between the 8-byte segment name field and the left parenthesis that begins the qualification statement. This SSA looks like this:
type STRUCT = record SEG_NAME : ALFA; SEG_QUAL : CHAR; SEG_KEY_NAME : ALFA; SEG_OPR : CHAR; SEG_KEY_VALUE : packed array[1..n] of CHAR; SEG_END_CHAR : CHAR; end; const QUAL_SSA = STRUCT('ROOT','(','KEY',' =','vv...v',')'); Figure 22. Qualified SSA without Command Codes ROOT (KEY =vv...v)
You can use a SSA that is coded like this for each DL/I call that needs an unqualified SSA by supplying the name of the segment type you want during program execution.
84
Both of these SSAs are taken from the PL/I skeleton program shown in Figure 14 on page 47. To see how they are used in DL/I calls, refer to that program.
GSAM Databases
This section shows how to code GSAM databases. GSAM databases are only available to application programs that can run as batch programs, batch-oriented BMPs or transaction-oriented BMPs. The PCB mask and the RSA that you use in a GSAM call have special formats. Generalized Sequential Access Method (GSAM) DB PCB masks are slightly different from other DB PCB masks. The fields that are different are the length of the key feedback area and the key feedback area. Also, an additional field exists that gives the length of the record being retrieved or inserted when using undefined-length records. The RSA (record search argument) is an 8-byte token that can be returned on GN and ISRT calls. The application program can save the RSA for use in a subsequent GU call. Related Reading: For more information on RSAs for GSAM, see Chapter 8, Processing GSAM Databases, on page 157.
85
AIBTDLI Interface
When you use the AIBTDLI interface, you specify the PCB that is requested for the call by placing the PCB name (as defined by PSBGEN) in the resource name field of the AIB. You do not specify the PCB address. Because the AIB contains the PCB name, your application can refer to the PCB name rather than to the PCB address. The AIBTDLI call allows you to select PCBs directly by name rather than by a pointer to the PCB. At completion of the call, the AIB returns the PCB address that corresponds to the PCB name that is passed by the application program. For PCBs to be used in a AIBTDLI call, you must assign a name in PSBGEN, either with PCBNAME= or with the name as a label on the PCB statement. PCBs that have assigned names are also included in the positional pointer list, unless you specify LIST=NO. During PSBGEN, you define the names of the DB PCBs and alternate PCBs. All I/O PCBs are generated with the PCB name IOPCB . For a generated program specification block (GPSB), the I/O PCB is generated with the PCB name IOPCB , and the modifiable alternate PCB is generated with the PCB name TPPCB1 . Because you can pass the PCB name, you do not need to know the relative PCB number in the PCB list. In addition, the AIBTDLI interface enables your application program to make calls on PCBs that do not reside in the PCB list. The LIST= keyword, which is defined in the PCB macro during PSBGEN, controls whether the PCB is included in the PCB list. The AIB resides in user-defined storage that is passed to IMS for DL/I calls that use the AIBTDLI interface. When the call is completed, the AIB is updated by IMS. Recommendation: Allocate at least 128 bytes of storage for the AIB. Restriction: No fields in the AIB can be used by the application program except as defined by IMS. Related Reading: For more information about PSBGEN, see IMS Version 9: Utilities Reference: System.
86
The env option specifies the operating environment in which your C language program is to run. For example, if your C language program is invoked under IMS and uses IMS facilities, specify env(IMS). The plist option specifies the format of the invocation parameters that is received by your C language program when it is invoked. When your program is invoked by a system support services program, the format of the parameters passed to your main program must be converted into the C language format: argv, argc, and envp. To do this conversion, you must specify the format of the parameter list that is received by your C language program. The ims.h include file contains declarations for PCB masks. You can finish in three ways: v End the main procedure without an explicit return statement. v Execute a return statement from main. v Execute an exit or an abort call from anywhere, or alternatively issue a longjmp back to main, and then do a normal return.
87
In previous versions of IMS, USING might be coded on the entry statement to reference PCBs. However, IMS continues to accept such coding on the entry statement. Recommendation: Use the procedure statement rather than the entry statement to reference the PCBs.
88
| | | | |
Each PSB must contain at least one PCB. An I/O PCB is required for most system service calls. An I/O PCB or alternate PCB is required for transaction management calls. (Alternate PCBs can exist in IMS TM.) DB PCBs for DL/I databases are used only with the IMS Database Manager under DBCTL. GSAM PCBs can be used with DCCTL.
89
PCB Lists
[IOPCB] [Alternate PCB]
A GPSB contains only an I/O PCB and one modifiable alternate PCB. (A modifiable alternate PCB enables you to change the destination of the alternate PCB while the program is running.)A GPSB can be used by all transaction management application programs, and permits access to the specified PCBs without the need for a specific PSB for the application program. | | | The names of PCBs in a GPSB are predefined. The name of the I/O PCB is IOPCB. The name of the alternate PCB is TPPCB1 . The minimum size of the I/O work area that IMS generates for GPSBs in a DBCTL environment is 600 bytes.
PCB Summary
This section summarizes the information concerning I/O PCBs and alternate PCBs in various types of application programs. You should read this section if you intend to issue system service requests. DB Batch Programs If CMPAT=Y is specified in PSBGEN, the I/O PCB is present in the PCB list; otherwise, the I/O PCB is not present, and the program cannot issue system service calls. Alternate PCBs are always included in the list of PCBs that IMS supplies to the program. The I/O PCB and alternate PCBs are always passed to BMPs, MPPs, and IFPs. The PCB list always contains the address of the I/O PCB, followed by the addresses of any alternate PCBs, followed by the addresses of the DB PCBs. CICS Online Programs with DBCTL If you specify the IOPCB option on the PCB call, the first PCB address in your PCB list is the I/O PCB, followed by any alternate PCBs, followed by the addresses of the DB PCBs. If you do not specify the I/O PCB option, the first PCB address in your PCB list points to the first DB PCB. Table 19 summarizes the I/O PCB and alternate PCB information.
Table 19. I/O PCB and Alternate PCB Information Summary CALL DL/I Environment MPP IFP BMP DB Batch DB Batch
1 2 3 4
I/O PCB address in PCB list Yes Yes Yes No Yes Yes No
Alternate PCB address in PCB list Yes Yes Yes Yes Yes Yes No
TM Batch
CICS DBCTL
90
PCB Lists
Table 19. I/O PCB and Alternate PCB Information Summary (continued) CALL DL/I Environment CICS DBCTL5 Notes: 1. CMPAT = N specified. 2. CMPAT = Y specified. 3. CMPAT = Option. Default is always to Y, even when CMPAT = N is specified. 4. SCHD request issued without the IOPCB or SYSSERVE option. 5. SCHD request issued with the IOPCB or SYSSERVE for a CICS DBCTL request or for a function-shipped request which is satisfied by a CICS system using DBCTL. I/O PCB address in PCB list Yes Alternate PCB address in PCB list Yes
Language Environments
IBM z/OS Language Environment provides the strategic execution environment for running your application programs written in one or more high-level languages. It provides not only language-specific run-time support, but also cross-language run-time services for your application programs, such as support for initialization, termination, message handling, condition handling, storage management, and National Language Support. Many of Language Environment services are
Chapter 3. Defining Application Program Elements
91
Language Environments
accessible explicitly through a set of Language Environment interfaces that are common across programming languages; these services are accessible from any Language Environment-conforming program. Language Environment-conforming programs can be compiled with: v IBM z/OS C/C++ Compilers v Enterprise COBOL v Enterprise PL/I These programs can be produced by programs coded in assembler. All these programs can use CEETDLI, the Language Environment-provided language-independent interface to IMS, as well as older language-dependent interfaces to IMS, such as CTDLI, CBLTDLI, and PLITDLI. Although they do not conform to Language Environment, programs compiled with the following older compilers can run under Language Environment: v IBM C/370 v IBM VS COBOL II v IBM OS PL/I These programs cannot use CEETDLI, but they can use the older language-dependent interfaces to IMS. Related Reading: For more information about Language Environment, see IBM Language Environment for MVS and VM Programming Guide.
92
Language Environments
Table 20. Using LANG= Option in a Language Environment for PL/I Compatibility (continued) Compile EXEC statement is PARM=(...,SYSTEM(IMS)... No No and entry point name is PLICALLA No Yes Then LANG= is Not valid for IMS PL/I applications LANG=PLI
| | | | | | | |
Restriction: PLICALLA is only valid for PL/I compatibility with Language Environment. If a PL/I application program that uses the PLICALLA entry at bind time is bound using Language Environment with the PLICALLA entry, the bind will work; however, you must use LANG=PLI in the PSB. If you recompile the application program (without the PLICALLA entry) by using Enterprise PL/I, and then attempt to bind using Language Environment Version 1 Release 2 or later, the bind will fail. To bind successfully, you first must remove the PLICALLA entry statement from the bind.
Mixed-Language Programming
When an application program uses the Language Environment language-independent interface, CEETDLI, IMS does not need to know the language of the calling program. When the application program calls IMS in a language-dependent interface, IMS determines the language of the calling program according to the entry name that is specified in the CALL statement. That is, IMS assumes that the program is:
Chapter 3. Defining Application Program Elements
93
For example, if a PL/I program calls an assembler language subroutine and the assembler language subroutine makes DL/I calls by using CALL ASMTDLI, the assembler language subroutine should use the assembler language calling convention, not the PL/I convention. In this situation, where the I/O area uses the LLZZ format, LL is a halfword, not the fullword that is used for PL/I.
Preloaded Programs
| | If you compile your COBOL program with the Enterprise COBOL compiler and preload it, you must use the COBOL compiler option RENT. If you compile your COBOL program with the VS COBOL II compiler and preload it, you must use the COBOL compiler options RES and RENT.
94
= B11) D111)
95
When you issue this call, IMS returns the D segment with the key D111, regardless of where your position is when you issue the call. If this is the first call your program issues (and if this is the first database record in the database), current position before you issue the call is immediately before the first segment occurrence in the databasejust before the A segment with the key of A1. Even if current position is past segment D111 when you issue the call (for example, just before segment F111), IMS still returns the segment D111 to your program. This is also true if the current position is in a different database record. When you issue GN and GNP calls, current position in the database affects the way that you code the call and the SSA. That is because when IMS searches for a segment described in a GN or GNP call, it starts the search from current position and can only search forward in the database. IMS cannot look behind that segment occurrence to satisfy a GN or GNP. These calls can only move forward in the database when trying to satisfy your call, unless you use the F command code, the use of which is described in F Command Code on page 205. If you issue a GN call for a segment occurrence that you have already passed, IMS starts searching at the current position and stops searching when it reaches the end of the database (resulting in a GB status code), or when it determines from your SSA that it cannot find the segment you have requested (GE status code). Current Position after Unsuccessful Calls on page 100 explains where your position is when you receive a GE status code. Current position affects ISRT calls when you do not supply qualified SSAs for the parents of the segment occurrence that you are inserting. If you supply only the unqualified SSA for the segment occurrence, you must be sure that your position in the database is where you want the segment occurrence to be inserted.
96
Your current position is the same after retrieving segment C111, whether you retrieve it with GU, GN, GNP, or any of the Get Hold calls. If you retrieve several segment occurrences by issuing a Get call with the D command code, current position is immediately after the lowest segment occurrence that you retrieved. If you issue the GU call as shown in the example above, but include the D command code in the SSA for segments A and B, the current position is still immediately after segment C111. C111 is the last segment that IMS retrieves for this call. With the D command code, the call looks like this: | | |
GU A B C D(AKEY D(BKEY (CKEY = A1) = B11) = C111)
You do not need the D command code on the SSA for the C segment because IMS always returns to your I/O area the segment occurrence that is described in the last SSA.
Figure 25 on page 98 shows what the hierarchy looks like after this call. The successful DLETcall has deleted segment C111.
97
When you issue a successful DLET call for a segment occurrence that has dependents, IMS deletes the dependents, and the segment occurrence. Current position still immediately follows the segment occurrence you deleted. An unqualified GN call returns the segment occurrence that followed the segment you deleted. Example: If you delete segment B11 in the hierarchy shown in Figure 25, IMS deletes its dependent segments, C112 and D111, as well. Current position immediately follows segment B11, just before segment B12. If you then issue an unqualified GN call, IMS returns segment B12. Figure 26 shows what the hierarchy looks like after you issued this call.
Because IMS deletes the segment's dependents, you can think of current position immediately following the last (lowest, right-most) dependent. In the example in Figure 25, this immediately follows segment D111. But if you then issue an unqualified GN call, IMS still returns segment B12. You can think of position in
98
If you are inserting a segment that has a unique key, IMS places the new segment in key sequence. If you are inserting a segment that has either a non unique key or no key at all, IMS places the segment according to the rules parameter of the SEGM statement of the DBD for the database. ISRT Call on page 238 explains these rules. If you insert several segment occurrences using the D command code, current position immediately follows the lowest segment occurrence that is inserted. Example: Suppose you insert a new segment B (this would be B14), and a new C segment occurrence (C141), which is a dependent of B14. Figure 27 on page 100 shows what the hierarchy looks like after these segment occurrences are inserted. The call to do this looks like this:
ISRT A (AKEY =
You do not need the D command code in the SSA for the C segment. On ISRT calls, you must include the D command code in the SSA for the only first segment you are inserting. After you issue this call, position immediately follows the C segment occurrence with the key of C141. Then, if you issue an unqualified GN call, IMS returns segment E11. If your program receives an II status code as a result of an ISRT call (which means that the segment you tried to insert already exists in the database), current position is just before the duplicate of the segment that you tried to insert.
99
100
Now DL/I has three positions, one on each hierarchic level in the call: v One on the A segment with the key A1 v One on the B segment with the key B11 v One on the C segment with the key C111
When IMS searches for a segment occurrence, it accepts the first segment occurrence it encounters that satisfies the call. As it does so, IMS stores the key of that segment occurrence in the key feedback area.
101
When IMS processes this call, it searches for a C segment with the key equal to C113. IMS can only look at C segments whose parents meet the qualifications for the A and B segments. The B segment that is part of the path must have a key equal to B11, and the A segment that is part of the path must have a key equal to A1. IMS then looks at the first C segment. Its key is C111. The next C segment has a key of C112. IMS looks for a third C segment occurrence under the B11 segment occurrence. No more C segment occurrences exist under B11. Because you have specified in the SSA that the A and B segment occurrences in C's path must be equal to certain values, IMS cannot look for a C segment occurrence with a key of C113 under any other A or B segment occurrence. No more C segment occurrences exist under the parent B11; the parent of C must be B11, and the parent of B11 must be A1. IMS determines that the segment you have specified does not exist and returns a not-found (GE) status code. When you receive the GE status code on this call, you can determine where your position is from the key feedback area, which reflects the positions that IMS has at the levels it was able to satisfyin this case, A1 and B11. After this call, current position immediately follows the last segment occurrence that IMS examined in trying to satisfy your callin this case, C112. Then, if you issue an unqualified GN call, IMS returns D111. The current position after this call is different if A and B have non unique keys. Suppose A's key is unique and B's is non unique. After IMS searches for a C113 segment under B11 and is unable to find one, IMS moves forward from B11 to look for another B segment with a key of B11. When IMS does not find one, DL/I returns a GE status code. Current position is further in the database than it was when both keys were unique. Current position immediately follows segment B11. An unqualified GN call would return B12. If A and B both have non unique keys, current position after the previous call immediately follows segment A1. Assuming no more segment A1s exist, an unqualified GN call would return segment A2. If other A1s exist, IMS tries to find a segment C113 under the other A1s. But suppose you issue the same call with a greater-than-or-equal-to relational operator in the SSA for segment B:
GU A B C (AKEY (BKEY (CKEY = A1) =>B11) = C113)
IMS establishes position on segment A1 and segment B11. Because A1 and B11 satisfy the first two SSAs in the call, IMS stores their keys in the key feedback area. IMS searches for a segment C113 under segment B11. None is found. But this time, IMS can continue searching, because the key of the B parent can be greater than or equal to B11. The next segment is B12. Because B12 satisfies the qualification for segment B, IMS places B12's key in the key feedback area. IMS then looks for a C113 under B12 and does not find one. The same thing happens for B13: IMS places the key of B13 in the key feedback area and looks for a C113 under B13.
102
After you issue this call, the key feedback area contains the key for segment B11. If you continue issuing this call until you receive a GE status code, IMS's current position immediately follows segment B13, but the key feedback area still contains only the key for segment B11. Of the B segments IMS examines, only one of them (B11) satisfies the SSA in the call. When you use a greater-than or greater-than-or-equal-to relational operator, you do not limit IMS's search. If you get a GE status code on this kind of call, and if one or more of the segments IMS examines does not satisfy an SSA, IMS's position in the database may be further than the position reflected in the key feedback area. If, when you issue the next GN or GNP call, you want IMS to start searching from the position reflected in the key feedback area instead of from its real position, you can either: v Issue a fully qualified GU call to reestablish position to where you want it. v Issue a GN or GNP call with the U command code. Including a U command code on an SSA tells IMS to use the first position it established at that level as qualification for the call. This is like supplying an equal-to relational operator for the segment occurrence that IMS has positioned on at that level. Example: Suppose that you first issue the GU call with the greater-than-or-equal-to relational operator in the SSA for segment B, and then you issue this GN call:
GN A B C *U *U
103
Multiple Processing
The order in which an application program accesses segments in a hierarchy depends on the purpose of the application program. Some programs access segments directly, others sequentially. Some application programs require that the program process segments in different hierarchic paths, or in different database records, in parallel. If your program must process segments from different hierarchic paths or from different database records in parallel, using multiple positioning or multiple PCBs can simplify the program's processing. For example: v Suppose your program must retrieve segments from different hierarchic paths alternately: for example, in Figure 29, it might retrieve B11, then C11, then B12, then C12, and so on. If your program uses multiple positioning, IMS maintains positions in both hierarchic paths. Then the program is not required to issue GU calls to reset position each time it needs to retrieve a segment from a different path. v Suppose your program must retrieve segments from different database records alternately: for example, it might retrieve a B segment under A1, and then a B segment under another A root segment. If your program uses multiple PCBs, IMS maintains positions in both database records. Then the program does not have to issue GU calls to reset position each time it needs to access a different database record.
Multiple Positioning
When you define the PSB for your application program, you have a choice about the kind of positioning you want to use: single or multiple. All of the examples used so far, and the explanations about current position, have used single positioning. This section explains what multiple positioning is, why it is useful, and how it affects your programming. Specify the kind of position you want to use for each PCB on the PCB statement when you define the PSB. The POS operand for a DEDB is disregarded. DEDBs support multiple positioning only. Definitions:
104
Multiple Positioning
v Single positioning means that IMS maintains position in one hierarchic path for the hierarchy that is defined by that PCB. When you retrieve a segment, IMS clears position for all dependents and all segments on the same level. v Multiple positioning means that IMS maintains position in each hierarchic path in the database record that is being accessed. When you retrieve a segment, IMS clears position for all dependents but keeps position for segments at the same level. Example: Suppose you issue these two calls using the hierarchy shown in Figure 30:
GU A B C E (AKEY (BKEYY (CKEYY (EKEYY = A1) = B11) = C111) = E11)
GN
After issuing the first call with single positioning, IMS has three positions established: one on A1, one on B11, and one on C111. After issuing the second call, the positions on B11 and C111 are canceled. Then IMS establishes positions on A1 and E11. After issuing the first call with single and multiple positioning, IMS has three positions established: one on A1, one on B11, and one on C111. However, after issuing the second call, single positioning cancels positions on B11 and C111 while multiple positioning retains positions on B11 and C111. IMS then establishes positions on segments A1 and E11 for both single and multiple positioning. After issuing the first call with multiple positioning, IMS has three positions established (just as with single positioning): one on A1, one on B11, and one on C111. But after issuing the second call, the positions on B11 and C111 are retained. In addition to these positions, IMS establishes position on segments A1 and E11.
105
Multiple Positioning
The examples that follow compare the results of single and multiple positioning using the hierarchy in Figure 31.
Table 21. Results of Single and Multiple Positioning with DL/I Calls Sequence Example 1 GU (where AKEY equals A1) GNP B GNP C GNP B GNP C GNP B GNP C GNP B GNP C Example 2 GU A (where AKEY equals A1) GN B GN C GN B GN C Example 3 GU A (where AKEY equals A1) GN C GN B GN B GN C Example 4 GU A (where AKEY equals A1) GN B GN C GN D GN E GN B GN D GN C GN E Result of Single Positioning A1 B11 C11 Not C12 Not C13 Not Not A1 B11 C11 B21 C21 A1 C11 B21 B22 C21 A1 B11 C11 D111 E111 B21 D221 C under next A E under next A Result of Multiple Positioning A1 B11 C11 B12 C12 B13 C13 Not found Not found A1 B11 C11 B12 C12 A1 C11 B11 B12 C12 A1 B11 C11 D111 E111 B12 D112 C12 E121
106
Multiple Positioning
Multiple positioning is useful when you want to examine or compare segments in two hierarchic paths. It lets you process different segment types under the same parent in parallel. Without multiple positioning, you would have to issue GU calls to reestablish position in each path.
107
Multiple Positioning
position at each level in all hierarchic paths, instead of at each level in one hierarchic path. To satisfy GN and GNP calls with multiple positioning, IMS moves forward from the current position in the path that is referred to in the SSA. Mixing Qualified and Unqualified GN and GNP Calls: Although multiple positioning is intended to be used with qualified calls for parallel processing and data independence, you may occasionally want to use unqualified calls with multiple positioning. For example, you may want to sequentially retrieve all of the segment occurrences in a hierarchy, regardless of segment type. Recommendation: Limit unqualified calls to GNP calls in order to avoid inconsistent results. Mixing qualified and unqualified SSAs may be valid for parallel processing, but doing so might also decrease the program's data independence. There are three rules that apply to mixing qualified and unqualified GN and GNP calls: 1. When you issue an unqualified GN or GNP, IMS uses the position that is established by the preceding call to satisfy the GN or GNP call. For example:
Your program issues these calls: GU A (where AKEY = A1) GN B GN E GN DL/I returns these segments: A1 B11 E11 F111
| | |
When your program issues the unqualified GN call, IMS uses the position that is established by the last call, the call for the E segment, to satisfy the unqualified call. 2. After you successfully retrieve a segment with an unqualified GN or GNP, IMS establishes position in only one hierarchic path: the path containing the segment just retrieved. IMS cancels positions in other hierarchic paths. IMS establishes current position on the segment that is retrieved and sets parentage on the parent of the segment that is retrieved. If you issue a qualified call for a segment in a different hierarchic path after issuing an unqualified call, the results are unpredictable. For example:
Your program issues these calls: GU A (where AKEY = A1) GN B GN E GN GN B DL/I returns these segments: A1 B11 E11 F111 unpredictable
When you issue the unqualified GN call, IMS no longer maintains a position in the other hierarchic path, so the results of the GN call for the B segment are unpredictable. 3. If you issue an unqualified GN or GNP call and IMS has a position established on a segment that the unqualified call might encounter, the results of the call are unpredictable. Also, when you issue an unqualified call and you have established position on the segment that the call should retrieve, the results are unpredictable. For example:
108
Multiple Positioning
Your program issues these calls: GU A (where AKEY = A1) GN E GN D GN B GN B GN DL/I returns these segments: A1 E11 D111 B12 B13 E11 (The only position IMS has is the one established by the GN call.)
In this example, IMS has a position established on E11. An unqualified GN call moves forward from the position that is established by the previous call. Multiple positions are lost; the only position IMS has is the position that is established by the GN call. To summarize these rules: 1. To satisfy an unqualified GN or GNP call, IMS uses the position established in the last call for that PCB. 2. If an unqualified GN or GNP call is successful, IMS cancels positions in all other hierarchic paths. Position is maintained only within the path of the segment retrieved.
Or, if you wanted to continue processing segments in record A1, you issue this call to cancel all positions in record A1:
GU A (AKEY = A1)
Multiple DB PCBs
When a program has multiple PCBs, it usually means that you are defining views of several databases, but this also can mean that you need several positions in one database record. Defining multiple PCBs for the same hierarchic view of a database is another way to maintain more than one position in a database record. Using multiple PCBs also extends what multiple positioning does, because with multiple PCBs you can maintain positions in two or more database records and within two or more hierarchic paths in the same record. Example: Suppose you were processing the database record for Patient A. Then you wanted to look at the record for Patient B and also be able to come back to your position for Patient A. If your program uses multiple PCBs for the medical hierarchy, you issue the first call for Patient A using PCB1 and then issue the next
Chapter 4. Current Position in the Database After Each Call
109
Multiple DB PCBs
call, for Patient B, using PCB2. To return to Patient A's record, you issue the next call using PCB1, and you are back where you left off in that database record. Using multiple PCBs can decrease the number of Get calls required to maintain position and can sometimes improve performance. Multiple PCBs are particularly useful when you want to compare information from segments in two or more database records. On the other hand, the internal control block requirements increase with each PCB that you define. You can use the AIBTDLI interface with multiple PCBs by assigning different PCBNAMEs to the PCBs during PSB generation. Just as multiple PCBs must have different addresses in the PSB PCBLIST, multiple PCBs must have different PCBNAMEs when using the AIBTDLI interface. For example, if your application program issues DL/I calls against two different PCBs in a list that identifies the same database, you achieve the same effect with the AIBTDLI interface by using different PCBNAMEs on the two PCBs at PSB generation time.
110
Issuing Checkpoints
Two kinds of checkpoint (CHKP) calls exist: the basic CHKP and the symbolic CHKP. All IMS programs and CICS shared database programs can issue the basic CHKP call; only BMPs and batch programs can use either call. IMS Version 9: Application Programming: Design Guide explains when and why you should issue checkpoints in your program. Both checkpoint calls cause a loss of database position when the call is issued, so you must reestablish position with a GU call or some other method. You cannot reestablish position in the middle of non unique keys or nonkeyed segments. Restriction: You must not specify CHKPT=EOV on any DD statement to take an IMS checkpoint. Some differences exist if you issue the same call sequence against a full-function database or a DEDB, and an MSDB. For more information about the differences, see Commit-Point Processing in MSDBs and DEDBs on page 176. Depending on the database organization, a CHKP call can result in the database position for the PCB being reset. When the CHKP call is issued, the locks held by the program are released. Therefore, if locks are necessary for maintaining your database position, the position is reset by the CHKP call. Position is reset in all cases except those in which the organization is either GSAM (locks are not used) or DEDB, and the CHKP call is issued after a GC status code. For a DEDB, the position is maintained at the unit-of-work boundary. Issuing a CHKP resets the destination of the modifiable alternate PCB. Related Reading: For more information on CHKP calls, see CHKP (Basic) Call on page 253 and CHKP (Symbolic) Call on page 254.
111
Maintaining Database Integrity (IMS Batch, BMP, and IMS Online Regions)
IMS uses these DL/I calls to back out database updates: ROLB, ROLL, ROLS, SETS, and SETU. The ROLB and ROLS calls can back out the database updates or cancel the output messages that the program has created since the program's most recent commit point. A ROLL call backs out the database updates and cancels any non-express output messages the program has created since the last commit point. It also deletes the current input message. SETS allows multiple intermediate backout points to be noted during application program processing. SETU operates like SETS except that it is not rejected by unsupported PCBs in the PSB. If your program issues a subsequent ROLS call specifying one of these points, database updates and message activity performed since that point are backed out. CICS online programs with DBCTL can use the ROLS and SETS or SETU DL/I calls to back out database changes to a previous commit point or to an intermediate backout point.
112
ROLL X X
1
ROLS X X1
Because IMS has the complete message (MSG1) and because an express PCB is being used, the message can be sent before a commit point. 2. Returned only if you supply the address of an I/O area as one of the call parameters. 3. The transaction is suspended and requeued for subsequent processing.
ROLL
A ROLL call backs out the database updates and cancels any non-express output messages the program has created since the last commit point. It also deletes the current input message. Any other input messages that were processed since the last commit point are returned to the queue to be reprocessed. IMS then terminates the program with an abend code U0778. This type of abnormal termination terminates the program without a storage dump. When you issue a ROLL call, the only parameter you supply is the call function, ROLL. You can use the ROLL call in a batch program. If your system log is on DASD, and if dynamic backout has been specified through the use of the BKO execution parameter, database changes made since the last commit point will be backed out; otherwise they will not. One reason for issuing ROLL in a batch program is for compatibility. After backout is complete, the original transaction is discarded if it can be, and it is not re-executed. IMS issues the APPC/MVS verb, ATBCMTP TYPE(ABEND), specifying the TPI to notify remote transaction programs. Issuing the APPC/MVS verb causes all active conversations (including any that are spawned by the application program) to be DEALLOCATED TYP(ABEND_SVC).
113
ROLB
The advantage of using a ROLB call is that IMS returns control to the program after executing a ROLB call, so the program can continue processing. The parameters for the ROLB call are: v The call function, ROLB v The name of the I/O PCB or AIB The total effect of the ROLB call depends on the type of IMS application program that issued it. v For current IMS application programs: After IMS backout is complete, the original transaction is represented to the IMS application program. Any resources that cannot be rolled back by IMS are ignored; for example, output that is sent to an express alternate PCB and a PURG call that is issued before the ROLB call. v For modified IMS application programs: The same consideration for the current IMS application program applies. The application program must notify any spawned conversations that a ROLB was issued. v For CPI-C driven IMS application programs: Only IMS resources are affected. All database changes are backed out. Any messages that are inserted to non-express alternate PCBs are discarded. Also, any messages that are inserted to express PCBs that have not had a PURG call are discarded. The application program must notify the originating remote program and any spawned conversations that a ROLB call was issued. MPPs and Transaction-Oriented BMPs: If the program supplies the address of an I/O area as one of the ROLB parameters, the ROLB call acts as a message retrieval call and returns the first segment of the first input message issued since the most recent commit point. This is true only if the program has issued a GU call to the message queue since the last commit point; it if has not, it was not processing a message when it issued the ROLB call. If the program issues GN call to the message queue after issuing a ROLB call, IMS returns the next segment of the message that was being processed when the ROLB call was issued. If no more segments exist for that message, IMS returns a QD status code. If the program issues a GU call to the message queue after the ROLB call, IMS returns the first segment of the next message to the application program. If no more messages exist on the message queue for the program to process, IMS returns a QC status code. If you include the I/O area parameter, but you have not issued a successful GU call to the message queue since the last commit point, IMS returns a QE status code to your program. If you do not include the address of an I/O area in the ROLB call, IMS does the same thing for you. If the program has issued a successful GU call in the commit interval and then issues a GN call, IMS returns a QD status code. If the program issues a GU call after the ROLB call, IMS returns the first segment of the next message or a QC status code, if no more messages exist for the program.
114
ROLS
You can use the ROLS call in two ways to back out to the prior commit point and return the processed input messages to IMS for later reprocessing: v Have your program issue the ROLS call using the I/O PCB but without an I/O area or token in the call. The parameters for this form of the ROLS call are: The call function, ROLS The name of the I/O PCB or AIB v Have your program issue the ROLS call using a database PCB that has received one of the data-unavailable status codes. This has the same result as if unavailable data were encountered and the INIT call was not issued. A ROLS call must be the next call for that PCB. Intervening calls using other PCBs are permitted. On a ROLS call with a TOKEN, message queue repositioning can occur for all non-express messages, including all messages processed by IMS. The processing uses APPC/MVS calls, and includes the initial message segments. The original input transaction can be represented to the IMS application program. Input and output positioning is determined by the SETS call. This positioning applies to current and modified IMS application programs but does not apply to CPI-C driven IMS programs. The IMS application program must notify all remote transaction programs of the ROLS. On a ROLS call without a TOKEN, IMS issues the APPC/MVS verb, ATBCMTP TYPE(ABEND), specifying the TPI. Issuing this verb causes all conversations associated with the application program to be DEALLOCATED TYPE(ABEND_SVC). If the original transaction is entered from an LU 6.2 device and IMS receives the message from APPC/MVS, a discardable transaction is discarded rather than being placed on the suspend queue like a non-discardable transaction. See IMS Version 9: Administration Guide: Transaction Manager for more information on LU 6.2. The parameters for this form of the ROLS call are: v The call function, ROLS v The name of the DB PCB that received the BA or BB status code
115
116
117
ROLS
The ROLS call backs out database changes to a processing point set by a previous SETS or SETU call, or to the prior commit point. The ROLS call then returns the processed input messages to the message queue. To back out database changes and message activity that have occurred since a prior SETS call, issue the ROLS call using the I/O PCB, and specify an I/O area and token in the call. If the token does not match a token that was set by a preceding SETS call, an error status is returned. If the token matches the token of a preceding SETS call, the database updates made since this corresponding SETS call are backed out, and all non-express messages that were inserted since the corresponding SETS are discarded. SETS that are issued as part of processing that was backed out are canceled. The existing database positions for all supported PCBs are reset. If a ROLS call is in response to a SETU call, and if there are unsupported PCBs (DEDB, MSDB, or GSAM) in the PSB, the position of the PCBs is not affected. The token specified by the ROLS call can be set by either a SETS or SETU call. If no unsupported PCBs exist in the PSB, and if the program has not used an attached subsystem, the function of the ROLS call is the same regardless of whether the token was set by a SETS or SETU call. If the ROLS call is in response to a SETS call, and if unsupported PCBs exist in the PSB or the program used an attached subsystem when the preceding SETS call was issued, the SETS call is rejected with an SC status code. The subsequent ROLS call is either rejected with an RC status code, indicating unsupported options, or it is rejected with an RA status code, indicating that a matching token that was set by a preceding successful SETS call does not exist. If the ROLS call is in response to a SETU call, the call is not rejected because of unsupported options. If unsupported PCBs exist in the PSB, this is not reflected with a status code on the ROLS call. If the program is using an attached subsystem, the ROLS call is processed, but an RC status is returned as a warning indicating that if changes were made using the attached subsystem, those changes were not backed out. The parameters for this form of the ROLS call are: v The call function, ROLS v The name of the I/O PCB or AIB v The name of the I/O area to receive the user data v The name of an area containing the 4-byte token Related Reading: For status codes that are returned after the ROLS call, see IMS Version 9: Messages and Codes, Volume 1. For explanations of those status codes and the response required, see IMS Version 9: Messages and Codes, Volume 1.
118
Reserving Segments
Resource lock management and the Q command code both reserve segments for your program's use, but they work differently and are independent of each other. To understand how and when to use the Q command code and the DEQ call, you must understand resource lock management. The function of resource lock management is to prevent one program from accessing data that another program has altered until the altering program reaches a commit point. Therefore, you know that if you have altered a segment, no other program (except those using the GO processing option) can access that segment until your program reaches a commit point. For database organizations that support the Q command code, if the PCB processing option allows updates and the PCB holds position in a database record, no other program can access the database record. The Q command code allows you to prevent other programs from updating a segment that you have accessed, even when the PCB that accessed the segment moves to another database record. Related Reading: For more information on the Q command code, see Q Command Code on page 208.
119
Reserving Segments
120
v Designing the CCTL Recovery Process on page 142 v CCTL Performance: Monitoring DRA Thread TCBs on page 143
Thread Concepts
A DRA thread is a DRA structure that connects: v A CCTL task (which makes database calls to IMS DB) with an IMS DB task that can process those calls. A CCTL thread is a CCTL task that issues IMS DB requests using the DRA. v A z/OS application program task (which makes database calls to IMS DB) with an IMS DB task that can process those calls. An ODBA thread is a z/OS task that issues IMS DB calls using the DRA. A single DRA thread is associated with every CCTL or ODBA thread. CCTL or ODBA threads cannot establish a connection with more than one DRA thread at a time.
Processing Threads
The way that the DRA processes a CCTL thread is different from how it processes an ODBA thread.
121
Thread Concepts
122
Thread Concepts
There are two CCTL threads and two DRA threads in the example. xxxRTNA is the module name (for this example) of the CCTL routine that builds PAPLs and calls DFSPRRC0 to process DRA requests.
Table 23. Example of Events in a Multithreading System CCTL TCB Events Application program1 needs a PSB, so CCTL thread1 is created. CCTL thread1 events: v DFSRTNA builds the SCHED PAPL and calls DFSPRRC0. v DFSPRRC0 creates a DRA thread, and the thread token (PAPLTTOK) is assigned to DRA thread TCB1. v DFSPRRC0 activates thread TCB1. v DFSPRRC0 calls the Suspend exit routine. v The Suspend exit routine suspends CCTL thread1. v The DRA processes the SCHED request and asks IMS DB to perform a schedule process. v Scheduling is in progress. CCTL can now dispatch other CCTL threads for the CCTL TCB. Application program2 needs a PSB, so CCTL thread2 is created. CCTL thread2 events: v DFSRTNA builds the SCHED PAPL and calls DFSPRRC0. v DFSPRRC0 creates a DRA thread, and a new thread token (PAPLTTOK) is assigned to DRA thread TCB2. v DFSPRRC0 activates thread TCB2. v DFSPRRC0 calls the Suspend exit routine. The Suspend exit routine suspends CCTL thread2. DRA thread TCB2 events: DRA thread TCB1 events: DRA TCB Events
v The DRA processes the SCHED request and asks IMS DB to perform a schedule process. v Scheduling is in progress. Both threads are now suspended. The CCTL TCB is inactive until one of the threads resumes execution. TCB2 scheduling finishes first. DRA thread TCB2 events: v Scheduling completes in IMS DB, and the PAPL is filled in with the results. v The DRA calls the Resume exit routine and passes the PAPL back to the CCTL.
123
Thread Concepts
Table 23. Example of Events in a Multithreading System (continued) CCTL TCB Events DRA TCB Events
Thread2 can resume immediately because the v The Resume exit routine sees the thread CCTL TCB is idle. It resumes execution token (PAPLTTOK) and flags CCTL directly after the point at which it was thread2 as 'ready to resume'. suspended by the Suspend exit routine. v The Resume exit routine returns to the DRA, and TCB2 becomes inactive. TCB1 scheduling completes. DRA thread TCB1 events: v Scheduling completes in IMS DB and the PAPL is filled in with the results. v The DRA calls the Resume exit routine and passes the PAPL back to the CCTL. Thread1 must wait until the Resume exit routine is available because thread2 has just resumed. v The Resume exit routine sees the thread token (PAPLTTOK) and flags CCTL thread1 as 'ready to resume'. v The Resume exit routine returns control to the DRA and TCB1 becomes inactive. CCTL thread2 events: v The Suspend exit routine returns to its caller, DFSPRRC0. v DFSPRRC0 returns to DFSRTNA. v DFSRTNA gets the results from the SCHED PAPL and gives them to the application program2. v DFSRTNA finishes the thread2 SCHED request. After thread2 completes in CCTL TCB, the CCTL can dispatch thread1, which is currently waiting. CCTL thread1 events: v The Suspend exit routine returns to its caller, DFSPRRC0. v DFSPRRC0 returns to DFSRTNA. v DFSRTNA gets the results from the SCHED PAPL and gives them to the application program1. v DFSRTNA finishes the thread1 SCHED request.
Sync Points
Sync point processing finalizes changes to resources. Sync point requests specify actions to take place for the resource changed (for example, commit or abort). A sync point is when IMS DB actually processes the request. Each sync point is based on a unit of recovery (UOR). A UOR covers the time during which database resources are allocated and can be updated until a request is received to commit or abort any changes. Normally, the UOR starts with a CCTL SCHED (schedule a PSB) request or an ODBA APSB call and ends with a sync point request. Other DRA thread requests can also define the start and end of a UOR.
124
Sync Points
A CCTL UOR is identified by a recovery token (PAPLRTOK) that is received as part of a thread request that creates a new UOR. It is 16 bytes in length. The first 8 bytes contain the CCTL identification. This identification is the same as the CCTL ID that was a final DRA startup parameter determined from USERID or PAPLUSID in INIT request. The second 8 bytes must be a unique identifier specified by the CCTL for each UOR. Related Reading: See the request descriptions under CCTL-Initiated DRA Function Requests on page 132 for more information on the DRA thread requests. IMS DB expects the CCTL or the z/OS application to make the sync point decision and the resulting request. In the case of a CCTL, the CCTL is the sync point manager and coordinates the sync point process with all of the database resource managers (including those other than IMS DB) that are associated with a UOR. In the case of an z/OS application, RRS/MVS is the sync point manager and coordinates all the resource managers (including those other than IMS) that are associated with the UOR. A CCTL working with a single resource manager may request a sync point in a single request or can use the two-phase sync point protocol which is required for a CCTL working with multiple resource managers. The single-phase sync point request can be issued when the CCTL has decided to commit the UOR, and when IMS DB owns all of the resources modified by the UOR. An z/OS application must use the two-phase sync point protocol for committing changes to the IMS database.
A UOR has two states: in-flight and in-doubt. The UOR is in an in-flight state from its creation time until the time IMS DB logs the phase 1 end (point C in Table 24 on page 126 and Table 25 on page 126). The UOR is in an in-doubt state from (point C) until IMS DB logs phase 2 (point D inTable 24 on page 126 and point H in Table 25 on page 126). The in-doubt state for a single-phase sync point request is a momentary state between points C and D in Table 24 on page 126. The in-flight and in-doubt states are important because they define what happens to the UOR in the event of a thread failure. If a thread fails while its IMS DB UOR is in-flight the UOR database changes are backed out. If a thread fails when its IMS DB UOR is in-doubt, during single-phase commit, the UOR database changes are kept for an individual thread abend, but are not kept for a system abend. If a thread fails when its IMS DB UOR is in-doubt during two-phase commit, the database changes are kept. Thread failure refers to either of these cases: v Individual thread abends.
Chapter 6. The Database Resource Adapter (DRA)
125
Sync Points
v System abends: IMS DB failure, CCTL failure, z/OS application failure, or z/OS failure (which abends all threads). The following shows the system events that occur when CCTL is used for single-phase sync point processing.
Time ABCDE Table 24. CCTL Single-Phase Sync Point Processing Points In Time A B C D E System Events CCTL phase 1 send IMS DB phase 1 receive IMS DB log phase 1 end IMS DB log phase 2 CCTL phase 2 receive
Table 25 shows the system events that occur when CCTL is used for two-phase sync point processing.
Time ABCDEFGHJK Table 25. CCTL Two-Phase Sync Point Processing Points In Time A B C D E F G H J K System Events CCTL phase 1 send IMS DB phase 1 receive IMS DB log phase 1 end IMS DB phase 1 respond CCTL phase 1 receive CCTL phase 2 send IMS DB phase 2 receive IMS DB log phase 2 IMS DB phase 2 respond CCTL phase 2 receive
Figure 33 on page 127 shows the system events that occur when two-phase sync point processing is done using ODBA.
126
Sync Points
Notes: 1. The z/OS application and IMS DB make a connection using the ODBA interface. 2. IMS expresses protected interest in the work started by the z/OS application. This informs RRS/MVS that IMS will participate in the two-phase commit process. 3. The z/OS application makes a read request to an IMS resource. 4. The z/OS application updates a protected resource. 5. Control is returned to the z/OS application following its update request. 6. The z/OS application requests that the update be made permanent by issuing the SRRCMIT call. 7. RRS/MVS calls IMS to do the prepare (phase 1) process. 8. IMS returns to RRS/MVS with its vote to commit. 9. RRS/MVS calls IMS to do the commit (phase 2) process. 10. IMS informs RRS/MVS that it has completed phase 2. 11. Control is returned to the z/OS application following its commit request.
127
Sync Points
2. If identification is successful, the DRA notifies the CCTL control exit, passing to it a list of IMS DB UORs that are in-doubt. 3. The CCTL must resolve each in-doubt by making a RESYNC call, which causes a phase 2 action, commit or abort. For CCTL to resolve a IMS DB in-doubt UOR, the CCTL must have a record of this UOR and the appropriate phase 2 action it must take. In this example, the CCTL record of a possible IMS DB in-doubt UOR is called a transition UOR. 4. The CCTL must define a transition UOR for the interval A-K (refer to Table 25 on page 126). Because this interval encompasses the IMS DB in-doubt period C-H, CCTL can resolve any in-doubts. If a CCTL defines a transition UOR as interval E-K and if IMS DB fails while a thread is between C and D, IMS DB has an in-doubt UOR for which CCTL has no corresponding transition UOR, even though the phase 1 call failed. CCTL cannot resolve this UOR during the identify process. The only way to resolve this in-doubt is by using the IMS DB command, CHANGE INDOUBT. ODBA Example: For ODBA, all in-doubts are resolved through z/OS using the Recoverable Resource Service (RRS).
CNBA=
DBCTLID=
DDNAME=
128
FPBOF=
FPBUF=
FUNCLV= IDRETRY=
TIMER=
USERID=
129
130
The remainder of the DRA modules reside in a load library that is dynamically allocated by DFSAERA0. The DDNAME and DSNAME of this load library are specified in the startup table. The default DSNAME (IMS.SDFSRESL) contains all the DRA code.
131
INIT Request
| | | | The INIT request initializes the DRA. The DRA startup parameter table contains all of the required parameters that you need to define the DRA. You can use the parameters given in the default module, DFSPZP00, or you can write your own module and bind it into the IMS.SDFSRESL. Related Reading: For more information, see Enabling the DRA for a CCTL on page 129.
132
After the INIT request and the startup table have been processed, the DRA returns the following data to the CCTL in the INIT PAPL: Field PAPLDBCT PAPLCTOK PAPLTIMO PAPLRETC PAPLDLEV Contents The IMS DB identifier (this is the IMSID parameter from system definition) The request token that identifies the CCTL to the DRA DRA TERM request timeout value (in seconds) A code returned to the CCTL specifying the status of the request A flag indicating to CCTL which functions the DRA supports. (For the latest version of PAPL mapping format see the IMS. library; member name is DFSPAPL.)
133
RESYNC Request
The RESYNC request tells IMS DB what to do with in-doubt UORs. The 4 following subfunction values indicate possible actions: PAPLRCOM PAPLRABT PAPLSCLD PAPLSUNK Commit the in-doubt UOR. Abort the in-doubt UOR. Changes made to any recoverable resource are backed out. The UOR was lost to the transaction manager due to a coldstart. The in-doubt UOR is unknown to the CCTL. This can occur when the CCTL's in-doubt period does not include the start of phase 1. (See Table 25 on page 126 for an illustration of in-doubt periods.)
You must fill in the following input fields of the PAPL: Field PAPLCTOK Contents Request token This token identifies the CCTL to the DRA. The DRA establishes the token and returns it to the CCTL in the parameter list on the startup INIT request. The request token must be passed on to the DRA for all RESYNC requests. PAPLRTOK Recovery token This 16-byte token is associated with a UOR. The first 8 bytes must be the transaction manager subsystem ID. The second 8 bytes must be unique for one CCTL thread. This is one of the in-doubt recovery tokens passed to the Control exit routine.
134
TERM Request
The TERM request results in a termination of the IMS DB/CCTL connection and a removal of the DRA from the CCTL environment. The DRA terminates after all threads have been resolved. No new DRA or thread requests are allowed, and current requests in progress must complete. You must fill in the following input fields in the PAPL: Field PAPLFUNC PAPLCTOK Contents PAPLTERM, DRA terminate function code The DRA request token (output from an INIT request)
After receiving the TERM request results, the CCTL may remove DFSPPRC0. The fields returned in the PAPL to the CCTL are: Field PAPLRETC PAPLMXNB PAPLMTNB PAPLHITH PAPLTIMX Contents The return code The number of times the maximum thread count was encountered during this DRA session The number of times the minimum thread count was encountered during this DRA session The largest number of thread TCBs that were scheduled during this DRA session The elapsed time at maximum thread for this DRA session
SCHED Request
The SCHED request schedules a PSB in IMS DB. The first SCHED request made by a CCTL thread requires a new DRA thread. If any existing DRA thread TCBs are not currently processing a DRA thread, one of these is used. If no TCBs are available, the DRA either creates a new thread TCB (until the maximum number of threads as specified by the MAXTHRD parameter in the INIT request is reached), or makes the SCHED request wait until a thread becomes available.
135
PAPLFTRD
136
CCTLs currently using the IMS Database Manager and migrating to DBCTL will experience a change in the PCBLIST and user PCB area on a schedule request. The first PCB pointer in the PCBLIST contains the address of an I/O PCB. The I/O PCB is internally allocated during the schedule process in a DBCTL environment. The I/O PCB is normally used for output messages or to request control type functions to be processed. The PCBLIST and the PCBs reside in a contiguous storage area known as UPSTOR. If the PSB was generated with LANG=PLI, the PCBLIST points to pointers for the PCBs. If LANG= was not PLI, the PCBLIST points to the PCBs directly.
IMS Request
This request makes an IMS or Fast Path database request against the currently scheduled PSB. You must fill in the following input fields in the PAPL: Field PAPLFUNC PAPLSFNC PAPLCTOK PAPLCTK2 PAPLTTOK PAPLRTOK Contents PAPLTFUN PAPLDLI, DL1 request subfunction code DRA request token (output from an INIT request) Thread Token number 2. This is the DRA request token that is part of the output from a SCHED request. Thread token set up by the CCTL RTOKEN
137
SYNTERM Request
This is a single-phase sync point request to commit the UOR. It also releases the PSB. You must fill in the following input fields in the PAPL: Field PAPLFUNC PAPLSFNC PAPLCTOK PAPLCTK2 PAPLTTOK PAPLRTOK Contents PAPLTFUN PAPLSTRM, sync point commit/terminate subfunction code DRA request token (output from INIT request) The thread request token number 2. This DRA token is the output from the SCHED request. The thread token set up by the CCTL A 16-byte UOR token (RTOKEN). For information on UORs see Sync Points on page 124.
You can specify the following, optional input fields: Field PAPLSTAT Contents Address of an area where transaction statistical data is returned to the CCTL.
The output fields returned in the PAPL to the CCTL are: Field PAPLRETC Contents Code returned
138
PREP Request
This is a phase 1 sync-point request that asks IMS DB if it is ready to commit this UOR. You must fill in the following input fields of the PAPL: Field PAPLFUNC PAPLSFNC PAPLCTOK PAPLCTK2 PAPLTTOK PAPLRTOK Contents PAPLTFUN PAPLPREP, sync-point prepare subfunction code DRA request token (output from an INIT request) Thread Token number 2. This is the DRA request token which is output from a SCHED request. The thread token set up by the CCTL A 16-byte UOR token (RTOKEN). See Sync Points on page 124 for more information about UORs.
The output fields returned in the PAPL to the CCTL are: Field PAPLRETC PAPLSTCD Contents Code returned Fast Path status code If the value in the PAPLRETC field is decimal 35, the PAPLSTCD field contains a status code that further describes the error.
COMTERM Request
This is a phase 2 sync-point request to commit the UOR. It also releases the PSB. You must issue a PREP request prior to issuing a COMTERM request. You must fill in the following input fields in the PAPL: Field PAPLFUNC PAPLSFNC PAPLCTOK PAPLCTK2 PAPLTTOK PAPLRTOK Contents PAPLTFUN PAPLCTRM, sync-point commit/terminate subfunction code DRA request token (output from an INIT request) Thread Token number 2. This is the DRA request token, which is output from a SCHED request. The thread token set up by the CCTL A 16-byte UOR token (RTOKEN). See Sync Points on page 124 for more information about UORs.
Specifying the following input field is optional: Field PAPLSTAT Contents Address of an area where transaction statistical data is returned to the CCTL
Chapter 6. The Database Resource Adapter (DRA)
139
ABTTERM Request
This is a phase 2 sync-point request for abort processing. It also releases the PSB. It does not require a preceding PREP request. You must fill in the following input fields of the PAPL: Field PAPLFUNC PAPLSFNC PAPLCTOK PAPLCTK2 PAPLTTOK PAPLRTOK Contents PAPLTFUN PAPLATRM, sync-point abort/terminate subfunction code DRA request token (output from an INIT request) Thread Token number 2. This is the DRA request token, which is output from a SCHED request. The thread token set up by the CCTL A 16-byte UOR token (RTOKEN). See Sync Points on page 124 for more information about UORs.
Specifying the following input field is optional: Field PAPLSTAT Contents Address of an area where transaction statistical data is returned to the CCTL.
The output fields returned in the PAPL to the CCTL are: Field PAPLRETC PAPLSTAT Contents Code returned The address of the transaction statistical data area. This address must be specified on the input field.
TERMTHRD Request
This request terminates the DRA thread. You must fill in the following input fields of the PAPL: Field PAPLFUNC PAPLSFNC PAPLCTOK PAPLCTK2 PAPLTTOK Contents PAPLTFUN PAPLTTHD, thread terminate subfunction code DRA request token (output from an INIT request) Thread Token number 2. This is the DRA request token which is output from a SCHED request. The thread token set up by the CCTL
140
The output fields returned in the PAPL to the CCTL are: Field PAPLRETC PAPLSTAT Contents Code returned The address of the transaction statistical data area. This address must be specified on the input field.
141
142
143
Table 27. Information Provided at UOR Termination: PAPL Field PAPLGU1 PAPLGN PAPLGNP PAPLGHU PAPLGHN PAPLGHNP PAPLISRT PAPLDLET PAPLREPL PAPLTOTC PAPLTENQ PAPLWTEQ PAPLTSDQ PAPLUENQ PAPLWUEQ PAPLUPDQ PAPLEXEQ PAPLWEXQ PAPLEXDQ PAPLDATS PAPLDATN PAPLDECL PAPLDERD PAPLMSCL PAPLOVFN PAPLUOWC PAPLBFWT PAPLUSSN Field Length (Hexadecimal) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 8 8 2 2 2 2 2 2 4 Contents Number of database GU calls issued Number of database GN calls issued Number of database GNP calls issued Number of database GHU calls issued Number of database GHN calls issued Number of database GHNP calls issued Number of database ISRT calls issued Number of database DLET calls issued Number of database REPL calls issued Total number of DL/I database calls Number of test enqueues Number of WAITS on test enqueues Number of test dequeues Number of update enqueues Number of WAITs on updates and enqueues Number of update dequeues Number of exclusive enqueues Number of WAITs on exclusive enqueues Number of exclusive dequeues STCK time schedule started STCK time schedule completed Number of DEDB calls Number of DEDB read operations Reserved for Fast Path Number of overflow buffers used Number of UOW contentions Number of WAITs for DEDB buffers Unique schedule sequence number
144
DRA Statistics
DRA statistics are contained in the returned PAPL as a result of a DRA TERM request, or in the Control exit routine's PAPL when it is called for DRA termination. This routine is called when the DRA fails or when a previous Control exit routine invocation resulted in return code 4. The statistics in the returned PAPL are: 1. The number of times the MAXTHRD value was reached. 2. The number of times the MINTHRD value was reached (only includes the times the value is reached when the thread TCB number is decreasing.) 3. The largest number of thread TCBs ever reached during this DRA session. (This is the number of TCBs, not the number of DRA threads, so it is at least the minimum thread value.) 4. The time (in seconds) during which the DRA thread TCB count was at the MAXTHRD value. You can find the field names for the previous statistics in the PAPL extensions for the TERM PAPL and control exit routine PAPL. Before attempting to evaluate the statistics DRA performance, remember: v If the DRA is using the maximum number of threads (MAXTHRD), when the DRA receives any new SCHED requests it will make these requests wait until a thread is available. v As active threads become available (for example, as a result of TERMTHRD call), some of the available threads might be collapsed. | | | These factors can adversely affect performance, but both improve IMS DB resource availability because fewer DRA threads require fewer IMS DB resources. The IMS DB resources (PSTs) are then available for other BMPs or other CCTLs to use. Statistics 1, 2, and 4 can serve as a measurement of the two factors, and will help you decide how to balance performance and resource usage. For the sake of this discussion, these statistics are presented solely from a performance point of view (for example, assume only 1 CCTL connected to a IMS DB).
145
Tracing
There is no tracing (logging) of activity in the DRA, but there is tracing in IMS DB of DL/I and Fast Path activity. The setup and invocation of DL/I tracing for IMS DB is the same as for IMS. The output trace records for CCTL threads contain the recovery token. Fast Path tracing in IMS DB is different from IMS. Fast Path tracing in IMS DB is activated when a SCHED request to the DRA has the PAPLFTRD equal to ON (Fast Path trace desired for this UOR). When this UOR completes, a trace output file is closed and sent to SYSOUT Class A. If a thread request fails during Fast Path processing, the DRA might return the PAPL with the PAPLFTRR field equal to ON. This recommends to the CCTL that it request the PAPLFTRD field be equal to ON (Fast Path trace desired) in the SCHED PAPL if this failing transaction is run again by the CCTL.
Problem Diagnosis
Failed DRA requests have a nonzero value in the PAPLRETC field of the PAPL returned to the CCTL. The format of PAPLRETC is:
HHSSSUUU
X'88'- No output SSS UUU All z/OS non-retryable abend codes (for example, 222, 13E) or, IMS abend codes (775, 777, 844, 849, 2478, 2479, 3303)
146
X'80'- SDUMP/SNAP provided SSS UUU All the z/OS retryable abend codes All IMS abend codes besides those listed for the format of PAPLRETC
Diagnostic information is provided by the DRA in the form of an SDUMP, or a SNAP data set output. For X'80', the SDUMP is attempted first. If it fails, SNAP is done. For X'84', no SDUMP is attempted, but a SNAP is attempted. A z/OS or IMS abend code failure results in DRA thread termination and thread TCB collapse. A IMS DB return code has no affect on the DRA itself or the thread TCB. DRA thread TCB failures that occur when not processing a thread request result in a SDUMP/SNAP process. DRA control TCB failures that occur when not processing a DRA request result in a SDUMP/SNAP process and the Control exit routine is called. For a SCHED type of thread request, a failure with X'80' or X'84' can result in either SNAP or SDUMP.
SDUMP
SDUMP output contains: v The IMS control region. v DLISAS address space. v Key 0 and key 7 CSA. v Selected parts of DRA private storage, including the ASCB, TCB, and RBs. You can format the IMS control blocks by using the Offline Dump Formatter (ODF). Related Reading: The ODF is described in IMS Version 9: Diagnosis Guide and Reference. The ODF will not format DRA storage. You can use IPCS to format the z/OS blocks in the CCTL's private storage. DRA SDUMPS have their own SDUMP options. As a result of this, any CHNGDUMP specifications cannot cause sections of DRA SDUMPs to be omitted. If these specifications aren't in the DRA's list of options, they can have an additive effect on DRA SDUMPS.
SNAP
The SNAP dump data sets are dynamically allocated whenever a SNAP dump is needed. A parameter in the DRA Startup Table defines the SYSOUT class. The SNAP output contains: v Selected parts of DRA private storage, including the ASCB, TCB, and RBs. v IMS DB's control blocks.
147
148
149
The distinction between the two ANDs applies only when the indexed field (the one defined as XDFLD in the DBD) is used in all qualifications. If one of the qualification statements uses another field, both ANDs work like the dependent AND. The next two sections give examples of the dependent and independent AND. Although the examples show only two qualification statements in the SSA, you can use more than two. No set limit exists for the number of qualification statements you can include in an SSA, but a limit on the maximum size of the SSA does exist. You specify this size on the SSASIZE parameter of the PSBGEN statement. For information on this parameter, see IMS Version 9: Utilities Reference: System.
150
To satisfy this call, IMS searches for one pointer segment with a value between 500 and 1000. IMS returns the PATIENT segment that is pointed to by that segment.
You want IMS to find two pointer segments in the index that point to the same PATIENT segment, one with ILLNAME equal to TONSILLITIS and one with ILLNAME equal to STREPTHRT. Use this call:
GU PATIENT (XILLNAME=TONSILITIS#XILLNAME= STREPTHRT)
151
152
153
Three types of segments are found in a logical relationship: v TREATMNT is called the logical parent segment. It is a physical dependent of ILLNESS, but it can be processed through the item hierarchy because a path is established by the logical child segment DISBURSE. The logical parent segment can be accessed through both hierarchies, but it is stored in only one place. v SHIPMENT is called a physical parent segment. The physical parent is the parent of the logical child in the physical database hierarchy. v DISBURSE is called a logical child segment. It establishes a path to the TREATMNT segment in the PATIENT hierarchy from the SHIPMENT segment in the ITEM hierarchy. Because a logical child segment points to its logical parent, two paths exist through which a program can access the logical parent segment: v When a program accesses the logical parent segment through the physical path, it reaches this logical parent segment through the segment's physical parent. Accessing the TREATMNT segment through ILLNESS is accessing the logical parent segment through its physical path. v When a program accesses the logical parent segment through the logical path, it reaches this logical parent segment through the segment's logical child. Accessing the TREATMNT segment through SHIPMENT is accessing the logical parent segment through its logical path. When a logical parent segment is accessed through the logical child, the logical child is concatenated with both the data from its logical parent segment and any data the user has chosen to associate with this pairing (intersection data) in a single segment I/O area, like this:
LL is the length field of the logical parent if this segment is a variable-length segment.
154
IX
RX
155
156
157
Byte Length 8 2 2 4 4 8 4
Length of key feedback area and undefined-length records area7 Number of sensitive segments8 Key feedback area9
4 8
N/A X
N/A X
N/A X
N/A X
N/A X
158
Notes: 1. Database Name. The name of the GSAM DBD. This field is 8 bytes and contains character data. 2. Segment Level Number. Not used by GSAM, but you must code it. It is 2 bytes. 3. Status Code. IMS places a two-character status code in this field after each call to a GSAM database. This code describes the results of the call. IMS updates this field after each call and does not clear it between calls. The application program should test this field after each call to find out whether the call was successful. If the call was completed successfully, this field contains blanks. 4. Processing Options. This is a 4-byte field containing a code that tells IMS the types of calls this program can issue. It is a security mechanism in that it can prevent a particular program from updating the database, even though the program can read the database. This value is coded in the PROCOPT parameter of the PCB statement when generating the PSB for the application program. The value does not change. For GSAM, the values are G, GS, L, or LS. 5. Reserved for IMS. This 4-byte field is used by IMS for internal linkage. It is not used by the application program. 6. Segment Name. This field is not used by GSAM, but it must be coded as part of the GSAM DB PCB mask. It is 8 bytes. 7. Length of Key Feedback Area and Undefined-Length Records Area. This is a 4-byte field that contains the decimal value of 12. This is the sum of the lengths of the 9 and 10. 8. Number of Sensitive Segments. This field is not used by GSAM, but it should be coded as part of the GSAM DB PCB mask. This field is 4 bytes. 9. Key Feedback Area. After a successful retrieval call, GSAM places the address of the record that is returned to your program in this field. This is called a record search argument (RSA). You can use it later if you want to retrieve that record directly by including it as one of the parameters on a GU call. This field is 8 bytes. 10. Undefined-Length Records Area. If you use undefined-length records (RECFM=U), the length in binary of the record you are processing is passed between your program and GSAM in this field. This field is 4 bytes long. When you issue a GU or GN call, GSAM places the binary length of the retrieved record in this field. When you issue an ISRT call, put the binary length of the record you are inserting in this field before issuing the ISRT call.
159
Before you can supply an RSA in a GU call to a GSAM database, that RSA must have previously been returned to you as a result of a GN or ISRT call. For GSAM to return an RSA, the GN or ISRT call must be issued with a fourth parameter that points to an eight-byte RSA save area in your program, as shown in Table 30 on page 163. Save this RSA until you want to retrieve that particular record. To retrieve that particular record, issue a GU call for the record and specify the address of its RSA as a fourth parameter of the GU call. GSAM returns the record to the I/O area that you named as one of the call parameters. GSAM Coding Considerations on page 163 provides a list of parameters you can use with GSAM database calls.
| | |
| | | | | | | | |
Restriction: Retrieve records directly from a GSAM database on DASD only. When using buffered I/O, buffer definitions for the output PCB may affect performance.
160
161
v OUTM for an output data set with machine control characters For GN, ISRT, and GU calls, the format of the I/O area depends on whether the record is fixed-length, undefined-length (valid only for BSAM), or variable-length. For each kind of record, you have the option of using control characters. The formats of an I/O area for fixed-length or undefined-length records are: v With no control characters, the I/O area contains only data. The data begins in byte 0. v With control characters, the control characters are in byte 0 and the data begins in byte 1. If you are using undefined-length records, the record length is passed between your program and GSAM in the PCB field that follows the key feedback area. When you are issuing an ISRT call, supply the length. When you are issuing a GN or GU call, GSAM places the length of the returned record in this field. This length field is 4 bytes long. The formats for variable-length records differ because variable-length records include a length field, which other records do not have. The length field is 2 bytes. Variable-length I/O areas, like fixed-length and undefined-length I/O areas, can have control characters. v Without control characters, bytes 0 and 1 contain the 2-byte length field, and the data begins in byte 2. v With control characters, bytes 0 and 1 still contain the length field, but byte 2 contains the control characters, and the data starts in byte 3.
162
163
Can supply function, gsam pcb, i/o address for RSA to area [,rsa name] be returned None function, gsam pcb, i/o area, rsa name
GU
Get Unique
ISRT
Insert
Can supply function, gsam pcb, i/o address for RSA to area [,rsa name] be returned Can specify printer or punch control characters function, gsam pcb [, open option]
OPEN
Open
164
165
Converting Data Sets From Non-Striped Data Sets to Striped Data Sets
| | | | | | | | | | | | | | | | | | | | Convert GSAM/BSAM non-striped data sets to striped data sets before you need to perform an extended restart when a system allocation limit is exceeded or a system X'37' error condition occurs. Non-striped data sets that are not managed by SMS extend beyond their initial primary or secondary allocation only by volume, but with non-striped GSAM/BSAM multiple volume data sets that are managed by SMS, the resulting new space allocation takes effect for all of the volumes in the data set. If you copy non-striped data sets that are managed by SMS after you change the space allocation values, the number of records in the new volumes will be different from the number of records in the old volume. The new primary and secondary allocation values are used with non-striped data sets. As the data is copied, all of the space that is allocated on the new volume is used before the data is copied to the next volume. If an error condition (System x37 or system allocation limit exceeded) occurs during the processing of a GSAM/BSAM non-striped data set, and the data set is converted to a striped data set after the error occurs, a restart after failure will not complete successfully. Because the issued checkpoint saved a TTRZ value in the log record for repositioning, the log record for striped data sets will be used by GSAM restart after failure, which requires a relative block number (RBN) to perform the repositioning.
166
167
EXEC DD DD DD DD DD DD DD DD DD . . .
PGM=DFSRRC00,PARM=[BMP|DBB|DLI],... DSN=executionlibrary-name,DISP=SHR DSN=pgmlib-name,DISP=SHR DSN=psblib-name,DISP=SHR DSN=dbdlib-name,DISP=SHR DSN=acblib-name,disp=shr (required for DBB) SYSOUT=A SYSOUT=A (add DD statements for required GSAM databases) (add DD statements for non-GSAM IMS databases for DLI/DBB)
168
Related Reading: For more information on the types of processing requirements the two types of Fast Path databases satisfy, see IMS Version 9: Administration Guide: Database Manager. This section contains information on how to write programs to access data in MSDBs and DEDBs.
169
Function Code DEQ FLD GU, GHU GN, GHN GNP, GHNP DLET ISRT POS REPL
DEDBs X
X X X
X X X
X X X X X
X X X X X X
170
Processing MSDBs and DEDBs Updating Segments: REPL, DLET, ISRT, and FLD
Three of the calls that you can use to update an MSDB or DEDB are the same ones that you use to update other IMS databases: REPL, DLET, and ISRT. You can issue a REPL call to a related MSDB or nonrelated MSDB, and you can issue any of the three calls for non-terminal-related MSDBs (without terminal-related keys) or DEDBs. When you issue REPL or DLET calls against an MSDB or DEDB, you must first issue a Get Hold call for the segment you want to update, just as you do when you replace or delete segments in other IMS databases. One call that you can use against MSDBs and DEDBs that you cannot use against other types of IMS databases is the Field (FLD) call, which enables you to access and change the contents of a field within a segment. The FLD call has two types: v FLD/VERIFY This type of call compares the value of the field in the target segment to the value you supply in the FSA. v FLD/CHANGE This type of call changes the value of the field in the target segment in the way that you specify in the FSA. A FLD/CHANGE call is only successful if the previous FLD/VERIFY call is successful.
171
172
The five fields in an FSA are: Field Name (FLD Name) This is the name of the field that you want to update. The field must be defined in the DBD. Status Code (SC) This is where IMS returns the status code for this FSA. If IMS successfully processes the FSA, it returns a blank status code. If IMS fails to process the FSA, it returns a FE status code to the PCB to indicate a nonblank status code in the FSA and returns a nonblank FSA status code. The FSA status codes that IMS might return to you on a FLD/VERIFY call are: | | | B The length of the data supplied in the field value is invalid, or the segment length of the data in the database is smaller than required to contain the fields as specified in the DBD. The verify check is unsuccessful. In other words, the answer to your query is no. The field value contains invalid data. The data you supplied in this field is not the same type of data that is defined for this field in the DBD. The requested field is not found in the segment.
D E
Operator (OP) This tells IMS how you want the two values compared. For a FLD/VERIFY call, you can specify: E G H L M N Verify that the value in the field is equal to the value you have supplied in the FSA. Verify that the value in the field is greater than the value you have supplied in the FSA. Verify that the value in the field is greater than or equal to the value you have supplied in the FSA. Verify that the value in the field is less than the value you have supplied in the FSA. Verify that the value in the field is less than or equal to the value you have supplied in the FSA. Verify that the value in the field is not equal to the value you have supplied in the FSA.
Field Value (FLD Value) This area contains the value that you want IMS to compare to the value in the segment field. The data that you supply in this area must be the same type of data in the field you have named in the first field of the FSA. The five types of data are: hexadecimal, packed decimal, alphanumeric (or a combination of data types), binary fullword, and binary halfword. The length of the data in this area must be the same as the length that is defined for this field in the DBD.
Chapter 9. Processing Fast Path Databases
173
174
The last character in the FSA is an asterisk, because this FSA will be followed by other FSAs. 2. Subtract $100 from the value in the BALANCE field if the first FSA is successful. If the first FSA is unsuccessful, IMS does not continue processing. To subtract the amount of the withdrawal from the amount of the balance, you use this FSA:
BALANCE -10000*
Again, the last character in the FSA is an asterisk, because this FSA is followed by a third FSA. 3. Add 1 to the transaction count for the account. To do this, use this FSA:
TRANCNT +001
In this FSA, the last character is a blank ( ), because this is the last FSA for this call. When you issue the FLD call, you do not reference each FSA individually; you reference the I/O area that contains all of them.
175
176
VSO Considerations
VSO is transparent to the processing of an application. Where the data resides is immaterial to the application.
177
178
Figure 41. Processing a Long Chain of Segment Occurrences with Subset Pointers
You can use subset pointers at any level of the database hierarchy, except at the root level. If you try to use subset pointers at the root level, they are ignored. Figure 42 and Figure 43 on page 180show some of the ways you can set subset pointers. Subset pointers are independent of one another, which means that you can set one or more pointers to any segment in the chain. For example, you can set more than one subset pointer to a segment, as shown in Figure 42.
You can also define a one-to-one relationship between the pointers and the segments, as shown inFigure 43 on page 180.
179
Figure 44 shows how the use of subset pointers divides a chain of segment occurrences under the same parent into subsets. Each subset ends with the last segment in the entire chain. For example, the last segment in the subset that is defined by subset pointer 1 is B7.
180
Before your program can set a subset pointer, it must establish a position in the database. A call must be fully satisfied before a subset pointer is set. The segment a pointer is set to depends on your current position at the completion of the call. If a call to retrieve a segment is not completely satisfied and a position is not established, the subset pointers remain as they were before the call was made. You can use subset pointer command codes in either an unqualified SSA or a qualified SSA. To use a command code in a call with an unqualified SSA, use the command code along with the number of the subset pointer you want, after the segment name. This is shown in Table 34.
Table 34. Unqualified SSA with Subset Pointer Command Code Seg Name 8 * 1 Cmd Code Variable Ssptr. Variable 1
To use a subset pointer command code with a qualified SSA, use the command code and subset pointer number immediately before the left parenthesis of the qualification statement, as shown in Table 35.
Table 35. Qualified SSA with Subset Pointer Command Code Seg Name 8 * 1 Cmd Code Variable Ssptr. Variable ( 1 Fld Name 8 R.O. 2 Fld Value Variable ) 1
The examples in this section use calls with unqualified SSA. The examples are based on Sample Application Program, which is described in Fast Path Coding Considerations on page 195.
181
To set subset pointer 1 to the new segment, you use the S command code along with the R command code, as shown in the following example:
ISRT A B (Akey *R1S1 = A1)
If the subset does not exist (subset pointer 1 is set to 0), the segment is added to the end of the segment chain. Deleting the Segment Pointed to by a Subset Pointer: If you delete the segment pointed to by a subset pointer, the subset pointer points to the next segment occurrence in the chain. If the segment you delete is the last segment in the chain, the subset pointer is set to 0. Combining Command Codes: You can use the S, M, and W command codes with other command codes, and you can combine subset pointer command codes with each other, as long as they do not conflict. For example, you can use R and S together, but you cannot use S and Z together because their functions conflict. If you combine command codes that conflict, IMS returns an AJ status code to your program. You can use one R command code for each SSA and one update command code (Z, M, S, or W) for each subset pointer.
182
183
Field 1 Field 1
Field 2 Field 2
Field 5
After a successful POS call, the I/O area contains: LL (Field 1) Area Name An 8-byte field giving the ddname from the AREA statement. (Field 2) Position An 8-byte field containing the position information for the most recently inserted sequential dependent segment. This field contains zeros if no sequential dependent exists for this root. Sequential dependent location from qualified SSA IMS places two pieces of data in this 8-byte field after a successful POS call. The first 4 bytes contain the cycle count, and the second 4 bytes contain the VSAM RBA. If the sequential dependent segment that is the target of the POS call is inserted in the same synchronization interval, no position information is returned. Bytes 11-18 contain X'FF'. Other fields contain normal data. (Field 3) (Not shown in table) A 2-byte field, in binary, containing the total length of the data in the I/O area.
184
185
P Processing Option
If the P processing option is specified in the PCB for your program, a GC status code is returned to your program whenever a call to retrieve or insert a segment causes a unit of work (UOW) boundary to be crossed. Related Reading: For more information on the UOW for DEDBs, see IMS Version 9: Administration Guide: Database Manager. Although crossing the UOW boundary probably has no particular significance for your program, the GC status code indicates that this is a good time to issue either a SYNC or CHKP call. The advantages of issuing a SYNC or CHKP call after your program receives a GC status code are: v Your position in the database is retained. Issuing a SYNC or CHKP call normally causes position in the database to be lost, and the application program must reestablish position before it can resume processing. v Commit points occur at regular intervals. When a GC status code is returned, no data is retrieved or inserted. In your program, you can either: v Issue a SYNC or CHKP call, and resume database processing by reissuing the call that caused the GC status code. v Ignore the GC status code, and resume database processing by reissuing the call that caused the status code.
H Processing Option
If the H processing option has been specified in the PCB for your call program, a GC status code is returned whenever a call to retrieve or insert a segment causes a unit of work (UOW) or an area boundary to be crossed. The program must cause a commit process before any other calls can be issued to that PCB. If a commit process is not caused, an FR status code results (total buffer allocation exceeded), and all database changes for this synchronization interval are washed (sync-point failure). A GC status code is returned when crossing the area boundary so that the application program can issue a SYNC or CHKP call to force cleanup of resources (such as buffers) that were obtained in processing the previous area. This cleanup might cause successive returns of a GC status code for a GN or GHN call, even if a SYNC or CHKP call is issued appropriately for the previous GC status code. When an application is running HSSP and proceeding through the DEDB AREA sequentially, a buffer shortage condition may occur due to large IOV chains. In this case, a FW status code is returned to the application. Usually, the application issues a commit request and position is set to the next UOW. However, this does not allow the previous UOW to finish processing. In order to finish processing the previous UOW, you can issue a commit request after the FW status code is received and set the position to remain in the same UOW. You must also reposition the application to the position that gave the FW status code. The following shows an example of the command sequence and corresponding application responses.
GN GN GN root1 root2 root3
186
Data Locking
For information on how data locking is handled for DEDBs, see Data Locking for MSDBs and DEDBs on page 177.
187
DEDBINFO DEDBSTR
The DL/I call that uses the standard interface with register 1 must point to IOAI_CA.
IOAI structure
The following figure shows the IOAI structure.
starting offset IOAI_START IOAI_NAME IOAI_#FPU IOAI_#FPI IOAI_SUBC * IOAI_BLEN IOAI_ILEN IOAI_IOAREA * IOAI_CALL IOAI_PCBI DS DC DC DC DC DC DC DC DC DC 0F CL4IOAI 0 CL4#FPU 4 CL8#FPUCDPI 8 CL8 10 A(0) A(0) A(0) A(0) A(0) 18 1C 20 24 28 note *1 *1 *1 *1 *1 *1 *1 *1 *1
188
CL8 48 CL8 50 CL8 58 input words. A(0) 60 A(0) 64 A(0) 68 A(0) 6C A(0) 70 feedback words A(0) 74 A(0) 78 A(0) 7C A(0) 80 A(0) 84 workareas. A(0) 88 A(0) 8C A(0) 90 A(0) 94 A(0) 98
DS 20F0 9C for future expansion IOAI_END_CHAR DC CL4IEND EC *1 IOAI_LEN len(DBFIOAI) = xF0 bytes
Notes: 1. The user is responsible for initializing these fields. 2. IMS uses these fields to return data to the caller. Fields types are dependent on the DL/I call type and are documented in the DL/I call types descriptions below. 3. Can be used to pass additional data on the DL/I call, as documented in the specific DL/I call types descriptions below. 4. These fields are unchanged and can be used as work areas by the application. The fields in table Table 38 must be initialized for all DEDB DL/I calls.
Table 38. Field initialization for DEDB DL/I calls Field IOAI_NAME IOAI_#FPU IOAI_#FPI IOAI_SUBC IOAI_BLEN Description The characters IOAI identifying this block. The characters #FPU indicating this is a #FPU call. The characters #FPUCDPI indicating this is a subset call. The DL/I call: AL_LEN, AREALIST, DS_LEN, DEDBSTR, DI_LEN or DEDBINFO. The total length of the IOAI (X'F0').
189
IOAI_USERVER
IOAI_END_CHAR
The fields in Table 39 are initialized for specific DL/I calls. If a specific call does not need an I/O area, these fields are ignored.
Table 39. Fields initialized for specific DEDB DL/I calls Field IOAI_ILEN IOAI_IOAREA I/O Area Description The total length of the I/O area, including prefix and suffix. Address of the I/O area. First word: The I/O area length (same as IOAI_ILEN). Last word: X'FFFFFFFF', which is an 'end of I/O area' marker. Five input words that might be required.
The fields in Table 40 are updated by IMS for all the DEDB DL/I call types.
Table 40. Fields updated by IMS for all DL/I call types Field IOAI_DLEN Description The length of the output data that is returned by IMS. This field is informational only. A 2-byte status code. A return code if needed. The maximum version of this call. The IMS level.
190
AL_LEN Call
The AL_LEN call returns the minimum length of the I/O area required for an AREALIST call.
Input
IOAI See IOAI structure on page 188. IOAI_IN0 Points to storage containing the DEB name.
Output
IOAI_STATUS Call status, ' ' means successful. IOAI_FDBK0 The minimum length of the I/O area. IOAI_FDBK1 The number of AREAS in this DEDB.
DI_LEN Call
Return the minimum length of the I/O area required for an DEDBINFO call.
Input
IOAI See IOAI structure on page 188. IOAI_IN0 Points to storage containing the DEB name.
Output
IOAI_STATUS Call status, ' ' means successful. IOAI_FDBK0 The minimum length of the I/O area.
DS_LEN Call
Return the minimum length of the I/O area required for a DEDBSTR call.
Input
IOAI See IOAI structure on page 188. IOAI_IN0 Points to storage containing the DEB name.
Output
IOAI_STATUS Call status, ' ' means successful. IOAI_FDBK0 The minimum length of the I/O area.
Chapter 9. Processing Fast Path Databases
191
AREALIST Call
Return a list of areas which are part of the specified DEDB, with each area mapped by DBFCDAL1.
Input
IOAI See IOAI structure on page 188. IOAI_IN0 Points to storage containing the DEB name. I/O Area Formatted as documented above.
Output
IOAI_STATUS Call status, ' ' means successful. IOAI_FDBK0 The minimum length of the I/O area. IOAI_FDBK1 The number of AREAS in this DEDB. The I/O Area
0 4 8 C 14 len-4 ______________________________________//_____________________ | I/O | offset| data | DEDB | area list | end of data | | area | to |length | name | using DBFCDAL1 | marker | | len | data | | | control blocks | xEEEEEEEE | ______________________________________//_____________________ len:4 4 4 8 variable 4
DEDBINFO Call
Return DEDB information from the DMCB, mapped by DBFCDDI1.
Input
IOAI See IOAI structure on page 188. IOAI_IN0 Points to storage containing the DEB name. I/O Area Formatted with length in the first word, and 'FFFFFFFF' as an end of I/O area marker.
Output
IOAI_FDBK0 The minimum length of the I/O area. IOAI_FDBK1 The minimum I/O area for the DEDBSTR call.
192
DEDSTR Call
Return a list of segments and segment data for a DEDB with each segment mapped by DBFCDDS1.
Input
IOAI See IOAI structure on page 188. IOAI_IN0 Points to storage containing the DEB name. I/O Area Formatted with length in the first word, and 'FFFFFFFF' as an end of I/O area marker.
Output
IOAI_STATUS The minimum length of the I/O area. IOAI_FDBK0 The minimum I/O area for the DEDBSTR call. IOAI_FDBK1 The minimum I/O area for the SEGMENTS call. The I/O Area
0 4 8 C 14 len-4 ______________________________________//_____________________ | I/O | offset| data | DEDB | segments | end of data | | area | to |length | name | in DBFCDDS1 | marker | | len | data | | | control blocks | xEEEEEEEE | ______________________________________//_____________________ len:4 4 4 offset 0F CL8 0XL4 XL1 X01 X02 X04 X08 X80 X40 X20 X10 XL1 XL1 00 08 08 Area name Flag Bytes Flags for area status: - Area is opened - Temporary bit for backout - Utility active on this area - Error recovery needed - Sequential dep. part full - I/O error - Area stop request - Area restart request Reserved for Flag Byte #2 Reserved for Flag Byte #3
Chapter 9. Processing Fast Path Databases
variable
DBFCDAL1 mapping: CDAL_START DS CDAL_ARNM DS CDAL_FLGS DS CDAL_FLG1 DS CDAL_F1OP EQU CDAL_F1BK EQU CDAL_F1UT EQU CDAL_F1ER EQU CDAL_F1AF EQU CDAL_F1EP EQU CDAL_F1ST EQU CDAL_F1RE EQU CDAL_FLG2 DS CDAL_FLG3 DS
09 0A
193
DBFCDDI0 mapping: CDDI_START DS CDDI_DBNM DS CDDI_ANR DS CDDI_HSLV DS CDDI_SGNR DS CDDI_SEGL DS CDDI_HBLK DS CDDI_RMNM DS CDDI_RMEP DS DS DS CDDI_LEN EQU DBFCDDS1 mapping: CDDS_START DS CDDS_GNAM DS CDDS_GDOF DS CDDS_MAX DS CDDS_MIN DS CDDS_DBOF DS CDDS_NRFLD DS CDDS_SC DS CDDS_PREF DS CDDS_FLG1 DS CDDS_FL1K EQU CDDS_FL1S EQU CDDS_FL1P EQU CDDS_FISRT DS CDDS_PARA DS CDDS_SBLP DS CDDS_LEVL DS CDDS_KEYL DS CDDS_KDOF DS CDDS_RSRVE DS CDDS_CMPC DS CDDS_FLG2 DS DS DS CDDS_END DS CDDS_LEN EQU
Database name Number of areas defined Max SEGM level in the DB Highest valid SEGM code Maximum IOA length Number of anchor blocks Randomizing module name Randomizing module entry point Reserved Align on double word boundary Length of this area (x40)
offset 0F CL8 00 SEGMENT NAME H 08 OFFSET FROM START SEQ TO DATA H 0A MAX SEG LEN H 0C MIN SEG LEN H 0E OFFSET TO SEG ENTRIES FL1 10 NUMBER OF FIELDS IN SEG FL1 11 SEGMENT CODE H 12 POINTER OFFSET IN PARENT PREF X 14 FLAG BYTE X80 KEY SEGMENT X40 SEQUENTIAL DEP SEGMENT X20 PCL POINTER TO PARENT X 15 INSERT RULES H 16 OFFSET TO PARENT SEGMENT F 18 SIBLING POINTER XL1 1C SEGMENT LEVEL XL1 1D KEY LENGTH - 1 H 1E OFFSET TO KEY FIELD IN SEGMENT XL4 20 FOR USE IN UMDR0 | RESERVED A 24 A(CMPC) XL1 28 FLAG BYTE 2 (fixed length) XL3 29 FOR GROWTH 5F 2C for growth 0F END *-&AA._START; len of SDB entry
The following status codes are specific to these new DL/I calls.
Table 42. Status codes for specific DEDB DL/I calls Status Code AA AB AC AD AE AF AG Description Invalid #FPU/#FPUCDPI call. Getmain error. DEDB name not found. The I/O area was not long enough to contain the data. IOAI_LEN was zeros. It must be filled by the caller. The I/O area address was not passed in by IOAI_IOAREA. The IOAI does not point to itself, IOAI_IOAI.
194
195
196
Part 2. Reference
Chapter 10. Command Code Reference . . . . 201 General Command Codes for DL/I Calls . . . . 202 C Command Code . . . . . . . . . . 203 D Command Code . . . . . . . . . . 204 F Command Code . . . . . . . . . . . 205 L Command Code . . . . . . . . . . . 206 N Command Code . . . . . . . . . . 207 P Command Code . . . . . . . . . . . 208 Q Command Code . . . . . . . . . . 208 U Command Code . . . . . . . . . . 211 V Command Code . . . . . . . . . . 212 NULL Command Code . . . . . . . . . 213 DEDB Command Codes for DL/I . . . . . . 213 Sample Application Program . . . . . . . 213 M Command Code . . . . . . . . . . 214 R Command Code. . . . . . . . . . . 215 S Command Code . . . . . . . . . . . 216 W Command Code . . . . . . . . . . 217 Z Command Code. . . . . . . . . . . 218 Chapter 11. DL/I Calls for Database Management . . . . . . . . Database Management Call Summary CIMS Call . . . . . . . . . Format . . . . . . . . . Parameters . . . . . . . . Usage . . . . . . . . . . CLSE Call . . . . . . . . . Format . . . . . . . . . Parameters . . . . . . . . Usage . . . . . . . . . . DEQ Call . . . . . . . . . . Format (Full Function) . . . . Format (Fast Path DEDB) . . . Parameters . . . . . . . . Usage . . . . . . . . . . Restrictions . . . . . . . . DLET Call . . . . . . . . . Format . . . . . . . . . Parameters . . . . . . . . Usage . . . . . . . . . . FLD Call . . . . . . . . . . Format . . . . . . . . . Parameters . . . . . . . . Usage . . . . . . . . . . FSAs . . . . . . . . . . GN/GHN Call . . . . . . . . Format . . . . . . . . . Parameters . . . . . . . . Usage: Get Next (GN) . . . . Usage: Get Hold Next (GHN) . . Usage: HDAM, PHDAM, or DEDB with GN . . . . . . . . . Restrictions . . . . . . . . GNP/GHNP Call . . . . . . . Format . . . . . . . . .
Copyright IBM Corp. 1974, 2011
. . . . . 219 . . . . . 219 . . . . . 221 . . . . . 221 . . . . . 221 . . . . . 222 . . . . . 223 . . . . . 223 . . . . . 223 . . . . . 223 . . . . . 224 . . . . . 224 . . . . . 224 . . . . . 224 . . . . . 224 . . . . . 225 . . . . . 225 . . . . . 225 . . . . . 225 . . . . . 226 . . . . . 226 . . . . . 226 . . . . . 227 . . . . . 227 . . . . . 227 . . . . . 229 . . . . . 229 . . . . . 229 . . . . . 230 . . . . . 232 Database . . . . . 232 . . . . . 233 . . . . . 233 . . . . . 233
| | | | |
Parameters . . . . . . . . . . Usage: Get Next in Parent (GNP) . . . Usage: Get Hold Next in Parent (GHNP) GU/GHU Call . . . . . . . . . . Format . . . . . . . . . . . Parameters . . . . . . . . . . Usage: Get Unique (GU). . . . . . Usage: Get Hold Unique (GHU) . . . Restrictions . . . . . . . . . . ISRT Call . . . . . . . . . . . . Format . . . . . . . . . . . Parameters . . . . . . . . . . Usage . . . . . . . . . . . . OPEN Call . . . . . . . . . . . Format . . . . . . . . . . . Parameters . . . . . . . . . . Usage . . . . . . . . . . . . POS Call . . . . . . . . . . . . Format . . . . . . . . . . . Parameters . . . . . . . . . . Usage . . . . . . . . . . . . Restrictions . . . . . . . . . . REPL Call . . . . . . . . . . . Format . . . . . . . . . . . Parameters . . . . . . . . . . Usage . . . . . . . . . . . . RLSE Call . . . . . . . . . . . Format . . . . . . . . . . . Parameters . . . . . . . . . . Usage . . . . . . . . . . . . Restrictions . . . . . . . . . . Chapter 12. DL/I Calls for System System Service Call Summary . . APSB Call . . . . . . . . Format . . . . . . . . Parameters . . . . . . . Usage . . . . . . . . . CHKP (Basic) Call . . . . . . Format . . . . . . . . Parameters . . . . . . . Usage . . . . . . . . . CHKP (Symbolic) Call . . . . Format . . . . . . . . Parameters . . . . . . . Usage . . . . . . . . . Restrictions . . . . . . . DPSB Call . . . . . . . . Format . . . . . . . . Parameters . . . . . . . Usage . . . . . . . . . GMSG Call . . . . . . . . Format . . . . . . . . Parameters . . . . . . . Usage . . . . . . . . . Restrictions . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
233 234 235 235 236 236 237 237 238 238 238 238 239 241 241 242 242 242 242 243 245 245 245 245 245 246 247 247 247 247 247
Services . . 249 . . . . . . 250 . . . . . . 252 . . . . . . 252 . . . . . . 252 . . . . . . 252 . . . . . . 253 . . . . . . 253 . . . . . . 253 . . . . . . 253 . . . . . . 254 . . . . . . 254 . . . . . . 254 . . . . . . 255 . . . . . . 255 . . . . . . 255 . . . . . . 255 . . . . . . 255 . . . . . . 256 . . . . . . 256 . . . . . . 256 . . . . . . 256 . . . . . . 257 . . . . . . 258
197
GSCD Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . ICMD Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . INIT Call . . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . INQY Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . LOG Call . . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . PCB Call (CICS Online Format . . . . Parameters . . . Usage . . . . . Restrictions . . . RCMD Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . ROLB Call . . . . Format . . . . Parameters . . . Restrictions . . . ROLL Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . ROLS Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . SETS/SETU Call . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . SNAP Call . . . . Format . . . . Parameters . . . Usage . . . . . Restrictions . . . STAT Call . . . . Format . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Programs Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
258 258 258 259 259 259 259 259 260 261 261 261 261 261 265 266 266 266 266 275 276 276 276 277 277 277 277 278 278 278 278 278 278 279 279 280 280 280 280 280 281 281 281 281 281 281 281 282 282 282 282 283 283 283 284 284 284 286 286 286 287
Parameters . Usage . . . Restrictions . SYNC Call . . Format . . Parameters . Usage . . . Restrictions . TERM Call (CICS Format . . Usage . . . Restrictions . XRST Call . . Format . . Parameters . Usage . . . Restrictions .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Online Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . Only) . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
287 288 288 288 289 289 289 289 289 289 290 290 290 290 290 291 293
Chapter 13. Relationship Between Calls and AIB and PCBs . . . . . . . . . . . . . . 295 Chapter 14. DL/I Test Program (DFSDDLT0) . . Control Statements . . . . . . . . . . . Planning the Control Statement Order . . . . . ABEND Statement. . . . . . . . . . . . Examples of ABEND 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 . . . . . . . . Examples of DFSDDLT0 Call Functions. . . . COMMENT Statement . . . . . . . . . . Conditional COMMENT Statement . . . . . Unconditional COMMENT Statement . . . . Example of COMMENT Statement . . . . . COMPARE Statement . . . . . . . . . . COMPARE DATA Statement . . . . . . . COMPARE AIB Statement . . . . . . . . COMPARE PCB Statement . . . . . . . . Examples of COMPARE DATA and COMPARE PCB Statements . . . . . . . . . . . IGNORE Statement . . . . . . . . . . . Example of IGNORE Statement Using N or . OPTION Statement . . . . . . . . . . . Example of OPTION Control Statement . . . PUNCH CTL Statement . . . . . . . . . . Example of PUNCH CTL Statement . . . . . Example of PUNCH CTL Statement for All Parameters . . . . . . . . . . . . . STATUS Statement . . . . . . . . . . . Examples of STATUS Statement . . . . . . WTO Statement . . . . . . . . . . . . Example of WTO Statement . . . . . . . WTOR Statement . . . . . . . . . . . . Example of WTOR Statement . . . . . . . 297 298 299 300 300 300 300 303 305 305 306 309 317 319 319 320 320 321 321 321 322 323 324 325 327 327 327 328 328 331 331 331 333 334 334 335 335
198
JCL Requirements . . . . . . . . . . . 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 Hints . . . . . . . . . . . Load a Database . . . . . . . . . . Print the Segments in a Database . . . . . Retrieve and Replace a Segment . . . . . Delete a Segment . . . . . . . . . . Do Regression Testing . . . . . . . . Use as a Debugging Aid. . . . . . . . Verify How a Call Is Executed. . . . . .
. . . . . . . . . . . . . . . .
335 336 336 337 337 337 339 339 339 340 340 340 341 341 341 341 343 344 344 345 347 347 349 349 349 350 351 352 353 354 355 357 358 359 360 360 362 362 363 364 365 366 368 370 375
Chapter 15. Adapter for REXX . . . . . . . Sample Exit Routine (DFSREXXU) . . . . . . Addressing Other Environments . . . . . . . REXX Transaction Programs . . . . . . . . IMS Adapter for REXX Overview Diagram . . IVPREXX Sample Application . . . . . . . REXXTDLI Commands . . . . . . . . . . REXXTDLI Calls . . . . . . . . . . . . Return Codes . . . . . . . . . . . . Parameter Handling . . . . . . . . . . Example DL/I 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. . . . . . . . . . . . . . Chapter 16. CICS-DL/I User Return Codes . . . . . Not-Open Conditions. . . Invalid Request Conditions .
Part 2. Reference
199
200
L M N P Q R S U
| |
V W Z -
Table 44 on page 202 shows the list of command codes with applicable calls.
201
Usage Supplies concatenated key in SSA Retrieves or inserts a sequence of segments Starts search with first occurrence Locates last occurrence Moves subset pointer forward to the next segment Prevents replacement of a segment on a path call Establishes parentage of present level Enqueues segment Retrieves first segment in the subset Sets subset pointer unconditionally Maintains current position Maintains current position at present level and higher
U V W Z
1 1
Sets subset pointer conditionally Sets subset pointer to 0 Reserves storage positions for program command codes in SSA
- (null) Note:
202
C Command Code
You can use the C command code to indicate to IMS that (instead of supplying a qualification statement) you are supplying the segments concatenated key as a means of identifying it. You can use either the C command code or a qualification statement, but not both. You can use the C command code for all Get calls and for the ISRT call. When you code the concatenated key, enclose it in parentheses following the *C, and place it in the same position that would otherwise contain the qualification statement. Example: Suppose you wanted to satisfy this request: Did Joan Carter visit the clinic on March 3, 1993? Her patient number is 07755. The PATIENT segments key field is the patient number, and the ILLNESS segments key field is the date field, so the concatenated key is 0775519930303. This number is comprised of four digits for the year, followed by two digits for both the month and the day. You issue a GU call with the following SSA to satisfy the request:
GU ILLNESS *C(0775519930303)
Using the C command code is sometimes more convenient than a qualification statement because it is easier to use the concatenated key than to move each part of the qualification statement to the SSA area during program execution. Using the segment's concatenated key is the equivalent of giving all the SSA in the path to the segment qualified on their keys. Example: Suppose that you wanted to answer this request: What treatment did Joan Carter, patient number 07755, receive on March 3, 1993? Using qualification statements, you would specify the following SSA with a GU call:
GU PATIENT (PATNO EQ07755) ILLNESS (ILLDATE EQ19930303) TREATMNT
Using a C command code, you can satisfy the previous request by specifying the following SSA on a GU call:
GU ILLNESS *C(0775519930303) TREATMNT
If you need to qualify a segment by using a field other than the key field, use a qualification statement instead of the C command code. Only one SSA with a concatenated key is allowed for each call. To return segments to your program in the path to the segment specified by the concatenated key, you can use unqualified SSA containing the D command code. Example: If you want to return the PATIENT segment for Joan Carter to your I/O area, in addition to the ILLNESS segment, use the call:
GU PATIENT *D ILLNESS *C(0775519930303)
203
D Command Code
You can use the D command code to retrieve or insert a sequence of segments in a hierarchic path with one call rather than retrieving or inserting each segment with a separate call. A call that uses the D command code is called a path call. For your program to use the D command code, the P processing option must be specified in the PCB, unless your program uses command code D when processing DEDBs. Related Reading: For more information on using the P processing option, see the description of PSB generation in IMS Version 9: Utilities Reference: System.
204
Each time you issue this call, your I/O area contains the patient segment, the billing segment, and the payment segment for a particular person.
Not only is the PATIENT segment added, but the segments following the PATIENT segment, ILLNESS and TREATMNT, are also added to the database. You cannot use the D command code to insert segments if a logical child segment in the path exists.
F Command Code
You can use the F command code to start the search with the first occurrence of a certain segment type or to insert a new segment as the first occurrence in a chain of segments.
205
Then you issue an ISRT call with the following SSA. This adds a new occurrence of the TREATMNT segment as the first occurrence of the TREATMNT segment type among those with equal keys.
ISRT PATIENT (PATNO ILLNESS *L TREATMNT*F = 06439)
This example applies to HDAM or PHDAM root segments and to dependent segments for any type of database.
L Command Code
You can use the L command code to retrieve the last occurrence of a particular segment type or to insert a segment as the last occurrence of a segment type. The following topics provide additional information: v Retrieving a Segment as the Last Occurrence v Inserting a Segment as the Last Occurrence on page 207
206
The first SSA gives IMS the number of the particular patient. The second SSA asks for the last occurrence (in this case, the first occurrence chronologically) of the ILLNESS segment for this patient.
N Command Code
The N command code prevents you from replacing a segment on a path call. In conjunction with the D command code, it lets the application program to process multiple segments using one call. Alone, the D command code retrieves a path of segments in your I/O area. With the N command code, the D command code lets you distinguish which segments you want to replace. Example: The following code only replaces the TREATMNT segment.
GHU PATIENT*D(PATNO = 06439) ILLNESS *D(ILLDATE =19930301) TREATMNT PATIENT*N(PATNO = 06439) ILLNESS *N(ILLDATE =19930301) TREATMNT
REPL
Restriction: If you use D and N command codes together, IMS retrieves the segment but does not replace it.
Chapter 10. Command Code Reference
207
P Command Code
Ordinarily, IMS sets parentage at the level of the lowest segment that is accessed during a call. To set parentage at a higher level, you can use the P command code in a GU, GN, or GNP call. The parentage that you set with P works just like the parentage that IMS sets: it remains in effect for subsequent GNP calls, and is not affected by ISRT, DLET, or REPL calls. It is only affected by GNP if you use the P command code in the GNP call. Parentage is canceled by a subsequent GU, GHU, GN, or GHN. Use the P command code at only one level of the call. If you mistakenly use P in multiple levels of a call, IMS sets parentage at the lowest level of the call that includes P. If IMS cannot fully satisfy the call that uses P (for example, IMS returns a GE status code), but the level that includes P is satisfied, P is still valid. If IMS cannot fully satisfy the call including the level that contains P, IMS does not set any parentage. You would receive a GP (no parentage established) if you then issued a GNP. If you use P with a GNP call, IMS processes the GNP call with the parentage that was already set by preceding calls. IMS then resets parentage with the parentage you specified using P after processing the GNP call. Example: If you want to send a current bill to all of the patients seen during the month, the determining value is in the ILLNESS segment. You want to look at only patients whose ILLNESS segments have dates after the first of the month. For patients who have been to the clinic during the month, you need to look at their addresses and the amount of charges in the BILLING segment so that you can print a bill. For this example, assume the date is March 31, 1993. Issue these two calls to process this information:
GN GNP PATIENT *PD ILLNESS (ILLDATE >=19930301) BILLING
After you locate a patient who has been to the clinic during the month, you issue the GNP call to retrieve that patient's BILLING segment. Then you repeat the GN call to find each patient who has been to the clinic during the month, until IMS returns a GB status code.
Q Command Code
Use the Q command code if you want to prevent another program from updating a segment until your program reaches a commit point. The Q command code tells IMS that your application program needs to work with a segment and that no other tasks can be allowed to modify the segment until the program has finished. This means that you can retrieve segments using the Q command code, then retrieve them again later, knowing that they have not been altered by another program. (You should be aware, however, that reserving segments for the exclusive use of your program can affect system performance.)
208
Exception: For Fast Path, the second byte of the lock class is not interpreted as lock class 'A'. After retrieving the item segments, your program can examine them to determine whether an adequate number of each item are on hand to place the order. Assume 100 of each item are on hand. Your program then places the order and updates the database accordingly. To update the segment, your program issues a GHU call for each segment and follows it immediately with a REPL call:
209
210
U Command Code
As IMS satisfies each level in a retrieval or ISRT call, a position on the segment occurrence that satisfies that level is established. The U command code prevents position from being moved from a segment during a search of its hierarchic dependents. If the segment has a unique sequence field, using this code is equivalent to qualifying the SSA so that it is equal to the current value of the key field. When a call is being satisfied, if the position is moved above the level that the U code was issued at, the code has no effect for the segment type whose parent changed position. U is especially useful when unkeyed dependents or non unique keyed segments are being processed. The position on a specific occurrence of an unkeyed or non unique keyed segment can be held by using this code. Example: Suppose you want to find out about the illness that brought a patient named Mary Warren to the clinic most recently, and about the treatments she received for that illness. Figure 45 shows the PATIENT, ILLNESS, and TREATMNT segments for Mary Warren.
To retrieve this information, retrieve the first ILLNESS segment and the TREATMNT segments associated with that ILLNESS segment. To retrieve the most recent ILLNESS segment, you can issue the following GU call:
Chapter 10. Command Code Reference
211
After this call, IMS establishes a position at the root level on the PATIENT segment with the key 05810 and on the last ILLNESS segment. Because other ILLNESS segments with the key 19860412 may exist, you can think of this one as the most recent ILLNESS segment. You might want to retrieve the TREATMNT segment occurrences that are associated with that ILLNESS segment. You can do this by issuing the GN call below with the U command code:
GN PATIENT *U ILLNESS *U TREATMNT
In this example, the U command code indicates to IMS that you want only TREATMNT segments that are dependents of the ILLNESS and PATIENT segments on which IMS has established position. Issuing the above GN call the first time retrieves the TREATMNT segment with the key of 19860412. Issuing the GN call the second time retrieves the TREATMNT segment with the key 19860418. If you issue the call a third time, IMS returns a not-found status code. The U command code tells IMS that, if it does not find a segment that satisfies the lower qualification under this parent, it cannot continue looking under other parents. If the U command code was not in the PATIENT SSA, the third GN call causes IMS to move forward at the root level in an attempt to satisfy the call. If you supply a U command code for a qualified SSA, IMS ignores the U. If used in conjunction with command code F or L, the U command code is disregarded at the level and all lower levels of SSA for that call.
V Command Code
Using the V command code on an SSA is similar to using a U command code in that SSA and all preceding SSA. Specifying the V command code for a segment level tells IMS that you want to use the position that is established at that level and above as a qualification for the call. Using the V command code is analogous to qualifying your request with a qualified SSA that specifies the current IMS position. Example: Suppose that you wanted to answer this request: Did Joan Carter, patient number 07755, receive any treatment on March 3, 1993? Using a qualified SSA, specify the following call:
GU PATIENT (PATNO = 07755) ILLNESS (ILLDATE =19930303) TREATMNT
If you have position established on the PATIENT segment for patient number 07755 and on the ILLNESS segment for March 3, 1993, you can use your position to retrieve the TREATMNT segments in which you are interested. You do this by specifying the V command code as follows:
GN PATIENT ILLNESS *V TREATMNT
212
Using the null command code lets you use the same set of SSAs for more than one purpose. However, dynamically modifying the SSA makes debugging more difficult.
213
M Command Code
To move the subset pointer forward to the next segment after your current position, your program issues a call with the M command code. Using the passbook account example, suppose that you want to post some, but not all, of the transactions, and that you want the subset pointer to be set to the first unposted transaction. The following command sets subset pointer 1 to segment B6, as shown in Figure 47.
GU B A *R1M1 (AKEY
If the current segment is the last in the chain, and you use an M command code, IMS sets the pointer to 0.
214
Figure 47. Moving the Subset Pointer to the Next Segment after Your Current Position
R Command Code
To retrieve the first segment occurrence in the subset, your program issues a Get call with the R command code. The R command code does not set or move the pointer. It indicates to IMS that you want to establish position on the first segment occurrence in the subset. The R command code is like the F command code, except that the R command code applies to the subset instead of to the entire segment chain. Using the passbook account example, suppose that Bob Emery visits the bank and brings his passbook; you want to post all of the unposted transactions. Because subset pointer 1 was previously set to the first unposted transaction, your program uses the following call to retrieve that transaction:
GU A B (AKEY *R1 = A1)
As shown by Figure 48 on page 216, this call retrieves segment B5. To continue processing segments in the chain, you can issue GN calls as you would if you were not using subset pointers. If the subset does not exist (subset pointer 1 has been set to 0), IMS returns a GE status code, and your position in the database will be immediately following the last segment in the chain. Using the passbook example, the GE status code tells
Chapter 10. Command Code Reference
215
You can specify only one R command code for each SSA. If you use more than one R in a SSA, IMS returns an AJ status code to your program. You can use R with other command codes, except F and Q. Other command codes in a SSA take effect after the R command code has been processed, and after position has been successfully established on the first segment in the subset. If you use the L and R command codes together, the last segment in the segment chain is retrieved. (If the subset pointer that was specified with the R command code, IMS returns a GE status code instead of the last segment in the segment chain.) Do not use the R and F command codes together. If you do, you will receive an AJ status code. The R command code overrides all insert rules, including LAST.
S Command Code
To set a subset pointer unconditionally, regardless of whether it is already set, your program issues a call with the S command code. W Command Code on page 217 describes how to set a subset pointer only if it is not already set. When your program issues a call that includes the S command code, IMS sets the pointer to your current position. Example: To retrieve the first B segment occurrence in the subset defined by subset pointer 1 and to reset pointer 1 at the next B segment occurrence, you would issue the following commands:
GU GN A B B (AKEY *R1 *S1 = B1)
After you issue this call, instead of pointing to segment B5, subset pointer 1 points to segment B6, as shown in Figure 49 on page 217.
216
Figure 49. Unconditionally Setting the Subset Pointer to Your Current Position
W Command Code
Like the S command code, the W command code sets the subset pointer conditionally. Unlike the S command code, the W command code updates the subset pointer only if the subset pointer is not already set to a segment. Example: Using the passbook example, suppose that Bob Emery visits the bank and forgets to bring his passbook. You add the unposted transactions to the database. You want to set the pointer to the first unposted transaction, so that later, when you post the transactions, you can immediately access the first one. The following call sets the subset pointer to the transaction you are inserting if it is the first unposted one.
ISRT A B (AKEY *W1 = A1)
217
Figure 50. Conditionally Setting the Subset Pointer to Your Current Position
Z Command Code
The Z command code sets the value of the subset pointer to 0. After your program issues a call with the Z command code, the pointer is no longer set to a segment, and the subset defined by that pointer no longer exists. (IMS returns a status code of GE to your program if you try to use a subset pointer having a value of 0.) Example: Using the passbook example, suppose that you used the R command code to retrieve the first unposted transaction. You then process the chain of segments, posting the transactions. After posting the transactions and inserting any new ones into the chain, use the Z command code to set the subset pointer to 0 as shown in the following call:
ISRT A B (AKEY *Z1 = A1)
After this call, subset pointer 1 is set to 0, which indicates to a program that subsequently updates the database that no unposted transactions exist.
218
219
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
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
ISRT
Insert
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
220
RLSE
Release
Releases all locks held function, db pcb or for unmodified data. aib, i/o area, [ssa]
CIMS Call
The CIMS call is used to initialize and terminate the ODBA interface in a z/OS application region.
Format
CIMS aib
DB/DC X
IMS DB X
DCCTL
DB Batch
TM Batch
Parameters
aib 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 length. This field must contain the actual length of the AIB that the application program obtained. AIBRSNM1 Character value. This field is optional. AIBSFUNC Subfunction code. This field must contain one of the 8-byte subfunction codes as follows: | | | | | | | | | CONNECT AIBRSA1. Address of the CONNECT parameter list.
Table 47. 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.
221
DB Call: CIMS
| | | | | | | | | | | | | | | | | | | | | | | |
X'08' X'0C' X'10' X'04' X'04' X'04' Output Output Output Table 48. CIMS CONNECT table entry format Offset X'00' X'04' Length X'04' X'04' Field Input Input Usage description 1- to 4-character IMS alias name (cccc) from the startup properties table DFScccc0, where cccc is the alias name. 0 or the 4-byte address of the connection properties table (DFSPRP). A value of 0 indicates that ODBA loads a startup properties table named DFScccc0, where cccc is the alias name. This member is constructed by specifying the DFSPRP macro in DFScccc0, then assembling and linking the member. This member must be in the STEPLIB or JOBLIB of the ODBA application job. A non-zero value indicates that the caller supplies the address of the connection properties parameter table. The table is mapped by the DFSPRP macro. Connect request return code for this entry. Return codes are those documented for AIBRETRN. Connect request return code for this entry. Return codes are those documented for AIBREASN Connect request error extension code for this entry. The error extension might contain additional diagnostic information specific to the return and reason codes.
INIT AIBRSNM2. A 4-character ID of the ODBA startup table (optional). TERM AIBRSNM2. A 4-character ID of the ODBA startup table representing the IMS connection that is to be terminated. TALL Terminate all IMS connections.
Usage
The CIMS call is used by an application program that is running in an application address space to establish or terminate the ODBA environment. | | | | | | | | | | CONNECTb Use the CIMS CONNECT call to initialize the ODBA environment within the ODBA address space and to subsequently connect to one or more IMS DBCTL or IMS DB or TM subsystems. The CIMS CONNECT can be issued instead of, or in addition to, the CIMS INIT call. The CIMS CONNECT call performs ODBA initialization if it has not already been done. The call can be issued with AIBRSA1 set to -1 (X'FFFFFFFF') to perform initialization only. The connect request table contains one or more connect request entries in contiguous storage. The format of the connect request table entries is described in Table 48. 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 is the member named DFSxxxx0 where xxxx is equal to the 4-character ID. If AIBRSNM2 is specified, ODBA will attempt to establish a
222
DB Call: CIMS
connection to the IMS specified in the DFSxxxx0 member after the ODBA environment has been initialized in the z/OS application address space. TERMbbbb The CIMS subfunction TERM can be issued to terminate one and only one IMS connection. AIBRSNM2 specifies the 4-character ID of the startup table member representing the IMS connection to be terminated. Upon completion of the TERM subfunction the ODBA environment will remain 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 experience 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 Call
The close (CLSE) call is used to explicitly close a GSAM database. For more information on GSAM, see Chapter 8, Processing GSAM Databases, on page 157.
Format
CLSE gsam pcb aib
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
gsam 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.
Usage
For information on using CLSE, see Explicit Open and Close Calls to GSAM on page 161.
223
DB Call: DEQ
DEQ Call
The Dequeue (DEQ) call is used to release a segment that is retrieved using the Q command code.
DB/DC X
DBCTL X
DCCTL
DB Batch X
TM Batch
Parameters
DEDB 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.
Usage
The 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
224
DB Call: DEQ
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 Reserving Segments for the Exclusive Use of Your Program on page 118.
Restrictions
In 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 Call
The Delete (DLET) call is used to remove a segment and its dependents from the database.
Format
DLET 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
Parameters
db 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.
225
DB Call: DLET
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.
Usage
The 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. 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 Call
The Field (FLD) call is used to access a field within a segment for MSDBs or DEDBs.
Format
FLD db pcb aib i/o area
ssa
DB/DC X X
DBCTL
DCCTL
DB Batch
TM Batch
226
DB Call: FLD
Parameters
db 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.
Usage
Use 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 Updating Segments: REPL, DLET, ISRT, and FLD on page 171. You can also use the FLD call in application programs for DEDBs, instead of the combination of GHU, REPL, and DL/I calls.
FSAs
The 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.
227
DB Call: FLD
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 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.
228
DB Call: FLD
For more information on the FLD call and some examples, see Processing MSDBs and DEDBs on page 171.
GN/GHN Call
The 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.
Format
GN 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
Parameters
db 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
229
DB Call: GN/GHN
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 GSAM Databases on page 85 for more information on RSAs.
230
DB Call: GN/GHN
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. 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
231
DB Call: GN/GHN
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.
232
DB Call: GN/GHN
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.
Restrictions
You can use GN to retrieve the next record of a GSAM database, but GHN is not valid for GSAM.
GNP/GHNP Call
The 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.
Format
GNP 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
Parameters
db 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
233
DB Call: GNP/GHNP
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.
234
DB Call: GNP/GHNP
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 Figure 27 on page 100, assume segment B11 is the established parent. Neither of these two ISRT calls would affect parentage:
ISRT A B C A B C D (AKEY (BKEY (AKEY (BKEY (CKEY = A1) = B11) = A1) = B11) = C111)
ISRT
The following ISRT call would cancel parentage, because the F segment is not a direct dependent of B, the established parent:
ISRT A F (AKEY = A1)
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.
GU/GHU Call
The 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.
235
DB Call: GU/GHU
Format
GU 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
Parameters
db 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. 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.
236
DB Call: GU/GHU
rsa Specifies the area in your program that contains the record search argument. This required input parameter is only used for GSAM. See GSAM Databases on page 85 for more information on RSAs.
237
DB Call: GU/GHU
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.
Restrictions
You can use GU to retrieve the record with the RSA you provide with a GSAM database, but GHU is not valid for GSAM.
ISRT Call
The 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: For MSDB: ISRT ISRT ISRT ISRT DB/DC X X X X DBCTL X X X X X DCCTL DB Batch X X X TM Batch
Parameters
db 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 .
238
DB Calls: ISRT
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 segment in this area before issuing the ISRT call. This area must be long enough to hold the longest segment that IMS returns to this area. For example, if none of the segments your program retrieves or updates is longer than 48 bytes, your I/O area should be 48 bytes. If your program issues any path calls, the I/O area must be long enough to hold the longest concatenated segment 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 ISRT call with GSAM, the area named by the i/o area parameter contains the record you want to add. The area must be long enough to hold these records. 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 on the call. This parameter is required. rsa Specifies the area in your program where the RSA should be returned by DL/I. This output parameter is used for GSAM only and is optional. See GSAM Databases on page 85 for more information on RSAs.
Usage
Your program uses the ISRT call to initially load a database and to add information to an existing one. The call looks the same in either case. However, the way it is used is determined by the processing option in the PCB. This section explains how you use ISRT to add segments to an existing database. ISRT can add new occurrences of an existing segment type to a HIDAM, PHIDAM, HISAM, HDAM, PHDAM, DEDB, or MSDB database. Restriction: New segments cannot be added to a HSAM database unless you reprocess the whole database or add the new segments to the end of the database. Before you issue the ISRT call, build the new segment in the I/O area. The new segment fields must be in the same order and of the same length as defined for the segment. (If field sensitivity is used, they must be in the order defined for the application program's view of the segment.) The DBD defines the fields that a segment contains and the order in which they appear in the segment.
239
DB Calls: ISRT
are inserting is not a root, but you have just inserted its parent, you can insert the child segment by issuing an ISRT call with an unqualified SSA. You must build the new segment in your I/O area before you issue the ISRT call. Also, you use an unqualified SSA when you insert a root. When you are adding new segment occurrences to an existing database, the segment type must have been defined in the DBD. You can add new segment occurrences directly or sequentially after you have built them in the program's I/O area. At least one SSA is required in an ISRT call; the last (or only) SSA specifies the segment being inserted. To insert a path of segments, you can set the D command code for the highest-level segment in the path.
Insert Rules
If the segment type you are inserting has a unique key field, the place where IMS adds the new segment occurrence depends on the value of its key field. If the segment does not have a key field, or if the key is not unique, you can control where the new segment occurrence is added by specifying either the FIRST, LAST, or HERE insert rule. Specify the rules on the RULES parameter of the SEGM statement of DBDGEN for this database. Related Reading: For information on performing a DBDGEN, see IMS Version 9: Utilities Reference: Database and Transaction Manager. The rules on the RULES parameter are as follows: FIRST IMS inserts the new segment occurrence before the first existing occurrence of this segment type. If this segment has a nonunique key, IMS inserts the new occurrence before all existing occurrences of that segment that have the same key field. IMS inserts the new occurrence after the last existing occurrence of the segment type. If the segment occurrence has a nonunique key, IMS inserts the new occurrence after all existing occurrences of that segment type that have the same key. IMS assumes you have a position on the segment type from a previous IMS call. IMS places the new occurrence before the segment occurrence that was retrieved or deleted by the last call, which is immediately before current position. If current position is not within the occurrences of the segment type being inserted, IMS adds the new occurrence before all existing occurrences of that segment type. If the segment has a nonunique key and the current position is not within the occurrences of the segment type with equal key value, IMS adds the new occurrence before all existing occurrences that have equal key fields.
LAST
HERE
You can override the insert rule of FIRST with the L command code. You can override the insert rule of HERE with either the F or L command code. This is true for HDAM and PHDAM root segments and for dependent segments in any type of database that have either nonunique keys or no keys at all. An ISRT call must have at least one unqualified SSA for each segment that is added to the database. Unless the ISRT is a path call, the lowest-level SSA specifies the segment being inserted. This SSA must be unqualified. If you use the D command code, all the SSAs below and including the SSA containing the D command code must be unqualified.
240
DB Calls: ISRT
Provide qualified SSAs for higher levels to establish the position of the segment being inserted. Qualified and unqualified SSAs can be used to specify the path to the segment, but the last SSA must be unqualified. This final SSA names the segment type to be inserted. If you supply only one unqualified SSA for the new segment occurrence, you must be sure that current position is at the correct place in the database to insert that segment.
OPEN Call
The OPEN call is used to explicitly open a GSAM database.
Format
OPEN gsam pcb aib i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
241
DB Call: OPEN
Parameters
gsam 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 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 of a GSAM 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 kind of data set you are opening. This parameter is an input parameter.
Usage
For more information, see Explicit Open and Close Calls to GSAM on page 161.
POS Call
A qualified Position (POS) call is used to retrieve the location of a specific sequential dependent segment. In addition to location, a qualified POS call using an SSA for a committed segment will return the sequential dependent segment (SDEP) time stamp and the ID of the IMS owner that inserted it. For more information about the qualified POS call, refer to tableLocating the Last Inserted Sequential Dependent Segment on page 183. An unqualified POS points to the logical end of the sequential dependent segment (SDEP) data. By default, an unqualified POS call returns the DMACNXTS value, which is the next SDEP CI to be allocated. Because this CI has not been allocated, its specification without the EXCLUDE keyword will often result in a DFS2664A message from the SDEP utilities.
Format
|
POS db pcb aib keyword i/o area ssa
DB/DC X
DBCTL X
DCCTL
DB Batch
TM Batch
242
DB Call: POS
Parameters
db pcb Specifies the DB PCB for the DEDB that you are using for this call. This parameter is an input and output parameter. aib Specifies the AIB for the DEDB that you are using for this 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. | | | | keyword Specifies the Keyword for the DEDB that you are using for this call. Returns six words containing field codes to I/O area. Table 49 lists the five keywords and the corresponding output. i/o area Specifies the I/O area in your program that you want to contain the positioning information that is returned by a successful POS call. This parameter is an output parameter. The I/O area should be long enough to contain all the returned entries. IMS returns an entry for each area in the DEDB. | | | | | | | | | | The I/O area returned on POS call contained six words with nine potential fields of data for each return output. Each field is four or eight bytes. When the successful POS is an unqualified call, the I/O area consists of a 2 byte field that contains the length of the data area (LL), followed by 24 bytes of positioning information. The I/O data area will have 24 bytes of positioning information for every area in the DEDB. By selecting one of the five keywords in position zero of the input I/O area, the user specifies the kind of data in the return I/O area. Table 49 lists the five keywords and the data that an unqualified POS call returns based on the keyword you choose for position zero of the input I/O area.
Table 49. Unqualified POS Call: Keywords and Map of the I/O Area Return Output Keyword <null> V5SEGRBA PCSEGRTS PCSEGHWM PCHSEGTS PCLBSGTS byte 2 LL LL LL LL LL LL word 0 word 1 Field 1 Field 1 Field 1 Field 1 Field 1 Field 1 word 2 word 3 Field 2 Field 3 Field 3 Field 3 Field 8 Field 9 word 4 Field 4 word 5 Field 5 <null> Field 6 Field 7 Field 6 Field 6
243
DB Call: POS
| | | Field 1 Area name This 8-byte field contains the ddname from the AREA statement. Field 2 | | | | Sequential dependent next to allocate CI This field is the default if no keyword is specified in position zero of the I/O area. The data returned is the 8-byte cycle count and RBA (CC+RBA) acquired from the global DMACNXTS field. This data represents the next pre-allocated CI as a CI boundary. Field 3 | | | Local sequential dependent next segment The data returned is the 8-byte CC+RBA segment boundary of the most recently committed SDEP segment. This data is specific to only the IMS that executes the POS call. Its scope is for local IMS use only. Field 4 Unused CIs in sequential dependent part This 4-byte field contains the number of unused control intervals in the sequential dependent part. Field 5 Unused CIs in independent overflow part This 4-byte field contains the number of unused control intervals in the independent overflow part. Field 6 | | | | | | | Sequential dependent segment time stamp The data returned is the 8-byte time stamp of the most recently committed SDEP segment across all IMS partners, or for a local SDEP, the time stamp of the first pre-allocated SDEP CI dummy segment of the local IMS. If the area (either local or shared) has not been opened, or a /DBR was performed without any subsequent SDEP segment inserts, the current time is returned. Field 7 | | | Sequential dependent High Water Mark (HWM) This 8-byte field contains the cycle count plus RBA (CC+RBA) of the last pre-allocated SDEP CI which is the High Water Mark (HWM) CI. Field 8 | | | | | | Highest committed SDEP segment The data returned is the 8-byte cycle count plus RBA (CC+RBA) for the most recently committed SDEP segment across all IMS partners, or for a local SDEP, the CC+RBA of the most recently committed SDEP segment of the local IMS. If the area (either local or shared) has not been opened, or a /DBR was performed without any subsequent SDEP segment inserts, the HWM CI is returned. Field 9 | | Logical begin time stamp This 8-byte field contains the logical begin time stamp from the DMACSDEP_LOGICALBEGIN_TS field. ssa Specifies the SSA that you want to use in this call. This parameter is an input
244
DB Call: POS
parameter. The format of SSA in POS calls is the same as the format of SSA in DL/I calls. You can use only one SSA in this parameter. This parameter is optional for the POS call.
Usage
The POS call: v Retrieves the location of a specific sequential dependent segment. v Retrieves the location of last-inserted sequential dependent segment, its time stamp, and the IMS ID. v Retrieves the time stamp of a sequential dependent segment or Logical Begin. v Tells you the amount of unused space within each DEDB area. For example, you can use the information that IMS returns for a POS call to scan or delete the sequential dependent segments for a particular time period. If the area which the POS call specifies is unavailable, the I/O area is unchanged, and the status code FH is returned.
Restrictions
You can only use the POS call with a DEDB.
REPL Call
The Replace (REPL) call is used to change the values of one or more fields in a segment.
Format
REPL db pcb aib i/o area
ssa
Call Name For Full-Function: For DEDB: For MSDB: REPL REPL REPL
DB/DC X X X
DBCTL X X
DCCTL
DB Batch X
TM Batch
Parameters
db 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.
Chapter 11. DL/I Calls for Database Management
245
DB Call: REPL
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 area in your program that communicates with IMS. This parameter is an input parameter. When you want to replace an existing segment in the database with a new segment, you first issue a Get Hold call to place the new segment in the I/O area. You can modify the data in the I/O area, and then issue the REPL call to replace the segment in the database. 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 SSA for the call. You can use up to 15 SSAs in this parameter. This parameter is optional for the REPL call.
Usage
A REPL call must be preceded by one of the three Get Hold calls. After you retrieve the segment, you modify it in the I/O area, and then issue a REPL call to replace it in the database. IMS replaces the segment in the database with the segment you modify in the I/O area. You cannot change the field lengths of the segments in the I/O area before you issue the REPL call. For example, if you do not change one or more segments that are returned on a Get Hold call, or if you change the segment in the I/O area but do not want the change reflected in the database, you can inform IMS not to replace the segment. Specify an unqualified SSA with an N command code for that segment, which tells IMS not to replace the segment. The N command enables you to tell IMS not to replace one or more of the multiple segments that were returned using the D command code. However, you can specify an N command code even if there were no D command codes on the preceding Get Hold call. You should not include a qualified SSA on a REPL call. If you do, you receive an AJ status code. For your program to successfully replace a segment, the segment must have been previously defined as replace-sensitive by PROCOPT=A or PROCOPT=R on the SENSEG statement in the PCB. | | | | | If no fields in the segment were changed by the REPL call, the lock is released when the application moves to another database record. Use the Q command code if you need to preserve the segment for the exclusive use of your program. Related Reading: For more information on the PROCOPT option, see IMS Version 9: Utilities Reference: System. If your program attempts to do a path replace of a segment where it does not have replace sensitivity, and command code N is not specified, the data for the segment in the I/O area for the REPL call must be the same as the segment returned on the preceding Get Hold call. If the data changes in this situation, your program receives the status code, AM, and data does not change as a result of the REPL call.
246
DB Call: RLSE
| | | | | | | | For Full-Function: | For DEDB: | | | | | | | | | | | | | | | | | | | | | | | |
Call Name RLSE RLSE DB/DC X X DBCTL X X DCCTL DB Batch X X TM Batch
RLSE Call
The Release (RLSE) call is used to release all locks held for unmodified data.
Format
RLSE db pcb aib
Parameters
db 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. The following 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.
Usage
You use the RLSE call in Fast Path (FP) database applications to release all of the unmodified locks that are owned by the application. For Full-Function (FF) database applications, these are the locks held by the DB PCB referenced in the call. If the lock is protecting a resource that has been updated, the lock will not be released. After the RLSE call position in the database is lost.
Restrictions
The RLSE call has to be issued using a DB PCB. The PCB cannot be an I/O PCB or an MSDB PCB.
247
248
v ROLS Call on page 281 v SETS/SETU Call on page 282 v v v v v SNAP Call on page 284 STAT Call on page 286 SYNC Call on page 288 TERM Call (CICS Online Programs Only) on page 289 XRST Call on page 290
Related Reading: For specific information about coding your program in assembler language, C language, COBOL, Pascal, and PL/I, see Chapter 3, Defining Application Program Elements, on page 53 for the complete structure. For information on calls that apply to TM, see IMS Version 9: Application
Copyright IBM Corp. 1974, 2011
249
function, i/o pcb or aib, i/o area function, i/o pcb or aib, i/o area len, i/o area[, area len, area]
GMSG
Get Message
Retrieves a message function, aib, i/o area from the AO exit routine. Waits for an AOI message when none is available Gets address of system contents directory Issues an IMS command and retrieves the first command response segment function, db pcb, i/o pcb or aib, i/o area function, aib, i/o area
DB/DC and DCCTL (BMP, MPP, IFP), DB/DC and DBCTL (DRA thread), DBCTL (BMP non-message driven), ODBA DB Batch, TM Batch
GSCD1
ICMD
DB/DC and DCCTL (BMP, MPP, IFP), DB/DC and DBCTL (DRA thread), DBCTL (BMP non-message driven), ODBA DB batch, TM batch, BMP, MPP, IFP, DBCTL, ODBA
INIT
Initialize application
Receives data function, i/o pcb or aib, i/o area availability and deadlock occurrence status codes and checks each PCB database for data availability
250
LOG
Log
function, i/o pcb or aib, i/o area function, psb name, uibptr, [,sysserve]
DB batch, TM batch, BMP, MPP, IFP, DBCTL, ODBA CICS (DBCTL or DB/DC) DB/DC and DCCTL (BMP, MPP, IFP), DB/DC and DBCTL (DRA thread), DBCTL (BMP non-message driven), ODBA DB batch, TM batch, BMP, MPP, IFP
PCB
RCMD
Retrieves the second function, aib, i/o area and subsequent command response segments resulting from an ICMD call Eliminates database function, i/o pcb or updates and returns aib, i/o area last message to i/o area Eliminates database updates Issues call using name of DB PCB or i/o PCB and backs out database changes to SETS points function function, db pcb, i/o pcb or aib, i/o area, token
ROLB
Roll back
ROLL ROLS
DB batch, TM batch, BMP, MPP, IFP DB batch, TM batch, BMP, MPP, IFP, DBCTL, ODBA
SETS/SETU
Cancels all existing function, i/o pcb or backout points and aib, i/o area, token establishes as many as nine intermediate backout points Collects diagnostic information; choose SNAP options function, db pcb or aib, i/o area function, db pcb or aib, i/o area, stat function function, i/o pcb or aib
SNAP2
DB batch, BMP, MPP, IFP, CICS (DBCTL or DB/DC), ODBA DB batch, BMP, MPP, IFP, DBCTL, ODBA
STAT3
Statistics
Retrieves IMS system statistics; choose type and format Releases locked resources and requests commit-point processing Releases a PSB so another can be scheduled to commit database changes
SYNC
Synchronization
BMP
TERM
Terminate
function
251
Specifies up to function, i/o pcb or seven areas to be aib, i/o area len, i/o saved. Works with area[, area len, area] symbolic checkpoint to restart application program
Note: 1. GSCD is a Product-sensitive programming interface. 2. SNAP is a Product-sensitive programming interface. 3. STAT is a Product-sensitive programming interface.
APSB Call
The Allocate PSB (APSB) calls are used to allocate a PSB for an ODBA application.
Format
APSB aib
DB/DC X
IMS DB X
DCCTL
DB Batch
TM Batch
Parameters
aib 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 Resource name. This 8-byte, left-justified field must contain the PSB name. AIBRSNM2 This is the 4-character ID of ODBA startup table representing the target IMS of the APSB.
Usage
The ODBA application must load or be link edited with the ODBA application interface AERTDLI. The APSB call must be issued prior to any DLI calls. The APSB call uses the AIB to allocate a PSB for ODBA application programs.
252
Format
CHKP i/o pcb aib i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
i/o pcb Specifies the I/O PCB for the call. A basic CHKP call must refer to the I/O PCB. 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 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 Specifies your program's I/O area that contains the 8-byte checkpoint ID. This parameter is an input parameter. If the program is an MPP or a message-driven BMP, the CHKP call implicitly returns the next input message to this I/O area. Therefore, the area must be large enough to hold the longest returned message.
Usage
Basic CHKP commits the changes your program has made to the database and establishes places in your program from which you can restart your program, if it terminates abnormally.
253
Format
CHKP i/o pcb aib i/o area length i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
i/o pcb Specifies the I/O PCB for the call. This parameter is an input and output parameter. A symbolic CHKP call must refer to the I/O PCB. 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 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 length This parameter is no longer used by IMS. For compatibility reasons, this parameter must be included in the call, and it must contain a valid address. You can get a valid address by specifying the name of any area in your program. i/o area Specifies the I/O area in your program that contains the 8-byte ID for this checkpoint. This parameter is an input parameter. If the program is a message-driven BMP, the CHKP call implicitly returns the next input message into this I/O area. Therefore, the area must be large enough to hold the longest returned message. area length Specifies a 4-byte field in your program that contains the length (in binary) of the area to checkpoint. This parameter is an input parameter. You can specify up to seven area lengths. For each area length, you must also specify the area
254
Usage
The symbolic CHKP call commits the changes your program has made to the database and establishes places in your program from which you can restart your program, if it terminates abnormally. In addition, the CHKP call: v Works with the Extended Restart (XRST) call to restart your program if it terminates abnormally v Enables you to save as many as seven data areas in your program, which are restored when your program is restarted An XRST call is required before a CHKP call to indicate to IMS that symbolic check points are being taken. The XRST call must specify a checkpoint ID of blanks. For more information, see XRST Call on page 290.
Restrictions
The Symbolic CHKP call is allowed only from batch and BMP applications.
DPSB Call
The DPSB call is used to deallocate IMS DB resources.
Format
DPSB aib
DB/DC X
IMS DB X
DCCTL
DB Batch
TM Batch
Parameters
aib 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 Resource name. This 8-byte, left-justified field must contain the PSB name.
255
Usage
The DPSB call is used by an application running in a z/OS application region to deallocate a PSB. If the PREP subfunction is not used, the application must activate sync-point processing prior to issuing the DPSB. Use the RRS/MVS SRRCMIT/ATRCMIT calls to activate the sync-point process. Refer to MVS Programming: Resource Recovery for more information on these calls. If the DPSB is issued before changes are committed, and, or locks released, the application will receive:
AIBRETRN = X'00000104' AIBREASN = X'00000490'
The thread will not be terminated. The application should issue a SRRCMIT or SRRBACK call, and retry the DPSB. The PREP sub-function allows the application to issue the DPSB prior to activating the sync-point process. The sync-point activation can occur at a later time, but still must be issued.
GMSG Call
A Get Message (GMSG) call is used in an automated operator (AO) application program to retrieve a message from the AO exit routine DFSAOE00.
Format
GMSG aib i/o area
Parameters
aib Specifies the application interface block (AIB) to be used for this call. This parameter is an input and output parameter. You must initialize the following fields in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .
AIBLEN AIB lengths. This field must contain the length of the AIB the application actually obtained. AIBSFUNC Subfunction code. This field must contain one of these 8-byte subfunction codes: 8-blanks (null) When coded with an AOI token in the AIBRSNM1 field, indicates IMS is to return when no AOI message is available for the application program.
256
Usage
GMSG is used in an AO application program to retrieve a message associated with an AOI token. The AO application program must pass an 8-byte AOI token to IMS in order to retrieve the first segment of the message. IMS uses the AOI token to associate messages from AO exit routine DFSAOE00 with the GMSG call from an AO application program. IMS returns to the application program only those messages associated with the AOI token. By using different AOI tokens, DFSAOE00 can direct messages to different AO application programs. Note that your installation defines the AOI token. Related Reading: For more information on the AOI exits, see IMS Version 9: Customization Guide. To retrieve the second through the last segments of a multisegment message, issue GMSG calls with no token specified (set the token to blanks). If you want to retrieve all segments of a message, you must issue GMSG calls until all segments are retrieved. IMS discards all nonretrieved segments of a multisegment message when a new GMSG call that specifies an AOI token is issued. Your AO application program can specify a wait on the GMSG call. If no messages are currently available for the associated AOI token, your AO application program waits until a message is available. The decision to wait is specified by the AO
Chapter 12. DL/I Calls for System Services
257
Restrictions
A CPI-C driven program must issue an allocate PSB (APSB) call before issuing GMSG.
GSCD Call
This section contains product-sensitive programming interface information. A Get System Contents Directory (GSCD) call retrieves the address of the IMS system contents directory for batch programs. The ODBA interface does not support this call.
Format
GSCD db pcb i/o pcb aib i/o area
DB/DC
DBCTL
DCCTL
DB Batch X
TM Batch X
Parameters
db pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. i/o pcb Specifies the I/O 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. The these fields must be initialized in the AIB: AIBID Eye catcher. This 8-byte field must contain DFSAIB .
258
Usage
IMS does not return a status code to a program after it issues a successful GSCD call. The status code from the previous call that used the same PCB remains unchanged in the PCB. For more information on GSCD, see IMS Version 9: Application Programming: Design Guide.
Restrictions
The GSCD call can be issued only from batch application programs.
ICMD Call
An Issue Command (ICMD) call enables an automated operator (AO) application program to issue an IMS command and retrieve the first command response segment.
Format
ICMD aib i/o area
Parameters
aib Specifies the application interface block (AIB) for this 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. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. This field is not changed by IMS.
259
Usage
ICMD enables an AO application to issue an IMS command and retrieve the first command response segment. When using ICMD, put the IMS command that is to be issued in your application program's I/O area. After IMS has processed the command, it returns the first segment of the response message to your AO application program's I/O area. To retrieve subsequent segments (one segment at a time) use the RCMD call. Some IMS commands that complete successfully result in a DFS058 message indicating that the command is complete. Some IMS commands that are processed asynchronously result in a DFS058 message indicating that the command is in progress. For a command entered on an ICMD call, neither DFS058 message is returned to the AO application program. In this case, the AIBOAUSE field is set to 0 to indicate that no segment was returned. So, your AO application program must check the AIBOAUSE field along with the return and reason codes to determine if a response was returned. Related Reading: For more information on the AOI exits, see IMS Version 9: Customization Guide. Table 52 shows, by IMS environment, the types of AO application programs that can issue ICMD. ICMD is also supported from a CPI-C driven program.
Table 52. ICMD Support by Application Region Type IMS Environment Application Region Type DRA thread BMP (nonmessage-driven) BMP (message-driven) MPP IFP DBCTL Yes Yes N/A N/A N/A DB/DC Yes Yes Yes Yes Yes DCCTL N/A Yes Yes Yes Yes
260
Restrictions
Before issuing ICMD, a CPI-C driven program must issue an allocate PSB (APSB) call.
INIT Call
The Initialize (INIT) call allows an application to receive status codes regarding deadlock occurrences and data availability (by checking each DB PCB).
Format
INIT i/o pcb aib i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
i/o pcb Specifies the I/O PCB for the call. INIT must refer to the I/O PCB. 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 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 Specifies the I/O area in your program that contains the character string or strings indicating which INIT functions are requested. This parameter is an input parameter. INIT function character strings include DB QUERY, STATUS GROUPA, and STATUS GROUPB.
Usage
You can use the call in any application program, including IMS batch in a sharing environment. Specify the function in your application program with a character string in the I/O area.
Chapter 12. DL/I Calls for System Services
261
Note: The LL value of X'0B' is a hexadecimal representation of decimal 11. ZZ fields are binary.
Table 54 contains a sample I/O area for the INIT call with DBQUERY for PL/I.
Table 54. INIT DBQUERY: I/O Area Example for PLITDLI L 00 L 00 L 00 L 0B Z 00 Z 00 Character String DBQUERY
Note: The LL value of X'0B' is a hexadecimal representation of decimal 11. ZZ fields are binary.
LL or LLLL
A 2-byte field that contains the length of the character string, plus two bytes for LL. For the PLITDLI interface, use the 4-byte field LLLL. When you use the AIB interface (AIBTDLI), PL/I programs require only a 2-byte field. A 2-byte field of binary zeros.
ZZ
One of the following status codes is returned for each database PCB: NA At least one of the databases that can be accessed using this PCB is not available. A call made using this PCB probably results in a BA or BB status code if the INIT STATUS GROUPA call has been issued, or in a DFS3303I message and 3303 pseudoabend if it has not. An exception is when the database is not available because dynamic allocation failed. In this case, a call results in an AI (unable to open) status code. In a DCCTL environment, the status code is always NA. NU At least one of the databases that can be updated using this PCB is unavailable for update. An ISRT, DLET, or REPL call using this PCB might result in a BA status code if the INIT STATUS GROUPA call has been issued, or in a DFS3303I message and 3303 pseudoabend if it has not. The database that caused the NU status code might be required only for delete processing. In that case, DLET calls fail, but ISRT and REPL calls succeed.
262
Note: The LL value of X'11' is a hexadecimal representation of decimal 17. ZZ fields are binary.
Table 56 contains a sample I/O area for the INIT call for PL/I.
Table 56. INIT I/O Area Examples for PLITDLI L 00 L 00 L 00 L 11 Z 00 Z 00 Character String STATUS GROUPA
Note: The LL value of X'11' is a hexadecimal representation of decimal 17. ZZ fields are binary.
263
The value for LLZZ data or LLLLZZ data is always 4 bytes (for LLZZ or LLLLZZ), plus data length. Recommendation: You should be familiar with data availability. Related Reading: For more information about data availability, see IMS Version 9: Application Programming: Design Guide. When the INIT call is issued with the character string STATUS GROUPA in the I/O area, the application program informs IMS that it is prepared to accept status codes regarding data unavailability. IMS then returns a status code rather than a resultant pseudoabend if a subsequent call requires access to unavailable data. The status codes that are returned when IMS encounters unavailable data are BA and BB. Status codes BA and BB both indicate that the call could not be completed because it required access to data that was not available. DEDBs can receive the BA or BB status code. In response to status code BA, the system backs out only the updates that were done for the current call before it encountered the unavailable data. If changes have been made by a previous call, the application must decide to commit or not commit to these changes. The state of the database is left as it was before the failing call was issued. If the call was a REPL or DLET call, the PCB position is unchanged. If the call is a Get type or ISRT call, the PCB position is unpredictable. In response to status code BB, the system backs out all database updates that the program made since the last commit point and cancels all nonexpress messages that were sent since the last commit point. The PCB position for all PCBs is at the start of the database.
Note: The LL value of X'11' is a hexadecimal representation of decimal 17. ZZ fields are binary.
Table 58 contains a sample I/O area for the INIT call for PL/I.
Table 58. INIT I/O Area Examples for PLITDLI L 00 L 00 L 00 L 11 Z 00 Z 00 Character String STATUS GROUPB
Note: The LL value of X'11' is a hexadecimal representation of decimal 17. ZZ fields are binary.
264
The value for LLZZ data or LLLLZZ data is always four bytes (for LLZZ or LLLLZZ), plus data length. When the INIT call is issued with the character string STATUS GROUPB in the I/O area, the application program informs IMS that it is prepared to accept status codes regarding data unavailability and deadlock occurrences. The status codes for data unavailability are BA and BB, as described under Enabling Data Availability Status Codes: INIT STATUS GROUPA on page 263. When a deadlock occurs in batch and the INITSTATUS GROUPB call has been issued, the following occurs: v If no changes were made to the database, the BC status code is returned. v If updates were made to the database, and if a datalog exists and BKO=YES is specified, the BC status code is returned. v If changes were made to the database, and a disklog does not exist or BKO=YES is not specified, a 777 pseudoabend occurs. When the application program encounters a deadlock occurrence, IMS: v Backs out all database resources (with the exception of GSAM and DB2) to the last commit point. Although GSAM PCBs can be defined for pure batch or BMP environments, GSAM changes are not backed out. Database resources are backed out for DB2 only when IMS is the sync-point coordinator. When you use INIT STATUS GROUPB in a pure batch environment, you must specify the DISKLOG and BACKOUT options. v Backs out all output messages to the last commit point. v Requeues all input messages as follows: Environment MPP and BMP Action All input messages are returned to the message queue. The application program no longer controls its input messages. All input messages are returned to IMS Fast Path (IFP) balancing group queues (BALGRP), making them available to any other IFP region on the BALGRP. The IFP that is involved in the deadlock receives the next transaction or message that is available on the BALGRP.
IFP
Action is limited to resources that are managed by DBCTL, for example, database updates. v Returns a BC status code to the program in the database PCB. DBCTL
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL. You should be familiar with deadlock occurrences as described in IMS Version 9: Administration Guide: System.
265
INQY Call
The Inquiry (INQY) call is used to request information regarding execution environment, destination type and status, and session status. INQY is valid only when using the AIB interface.
Format
INQY aib i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
aib Specifies the address of the application interface block (DFSAIB) 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. AIBSFUNC Subfunction code. This field must contain one of the 8-byte subfunction codes as follows: v v v v v DBQUERY ENVIRON FIND LERUNOPT PROGRAM Not supported with the ODBA interface.
AIBRSNM1 Resource name. This 8-byte, left-justified field must contain the name of any named PCB in the PSB. AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. This field is not changed by IMS. i/o area Specifies the data output area to use with the call. This parameter is an output parameter. An I/O area is required for INQY subfunctions ENVIRON and PROGRAM . It is not required for subfunctions DBQUERY and FIND .
Usage
The INQY call operates in both batch and online IMS environments. IMS application programs can use the INQY call to request information regarding the output destination, the session status, the current execution environment, the availability of databases, and the PCB address, which is based on the PCB name. You must use
266
BK
| | | | | | | | | | |
The INQY FIND call returns the following status for each PCB: NA At least one of the databases that can be accessed using this PCB is not available. A call that is made using this PCB probably results in a BA or BB status code if the INIT STATUS GROUPA call has been issued, or in a DFS3303I message and 3303 pseudoabend if the call has not been issued. An exception is when the database is not available because dynamic allocation failed. In this case, a call results in an AI (unable to open) status code. In a DCCTL environment, the status code is always NA. NU At least one of the databases that can be updated using this PCB is unavailable for update. An ISRT, DLET, or REPL call using this PCB might
Chapter 12. DL/I Calls for System Services
267
268
Length in Bytes 4 8 8 8
Actual Value
Explanation Provides the region identifier. For example, X'00000001'. Provides the name of the application program being run. Provides the name of the PSB currently allocated. Provides the name of the transaction. Indicates that no associated transaction exists.
User Identifier
Group Name
Provides the group name. Indicates that the group name is unavailable.
A B
Indicates an INIT STATUS GROUPA call is issued. Indicates an INIT STATUS GROUPB call is issued. Indicates that a status group is not initialized.
4 4 0
Provides the address of the LL field, followed by the recovery token. Provides the address of the LL field, followed by the application program parameter string. Indicates that the APARM= parameter is not coded in the execution parameters of the dependent region JCL. Indicates IMS is not using Shared Queues. SHRQ Indicates IMS is using Shared Queues. Userid of dependent address space. The Userid Indicator field has one of four possible values. This value indicates the contents of the userid field. U L P O Indicates the users identification from the source terminal during sign-on. Indicates the LTERM name of the source terminal in sign-on is not active. Indicates the PSBNAME of the source BMP or transaction. Indicates some other name. Reserved for IMS. Indicates IMS has not expressed interest in the UR with RRS. Therefore, the application should refrain from performing any work that causes RRS to become the syncpoint manager for the UR because IMS will not be involved in the commit scope. For example, the application should not issue any outbound protected conversations. RRS Indicates IMS has expressed interest in the UR with RRS. Therefore, IMS will be involved in the commit scope if RRS is the syncpoint manager for the UR.
8 1
1 RRS Indicator 1 1 1 1 1
269
| 2. The pointer is an address that identifies a length field (LL) which contains the length of the recovery token or application program parameter string in binary, including the two bytes required for LL. Use this pointer to set | up addressability of the AIB between releases in a batch program. | | | | | | | | | |
| Table 60. INQY MSGINFO data output | Information returned | Version number | Origin IMSID | | | Reserved for IMS | | | | | | | | | | | | | | | |
68
270
271
272
273
END; PUT SKIP LIST (START S1CSTP FIND CALL); AIB.PCBNAME = XXCSTP; AIB.SUB_FUNC = FIND ; AIB.OUT_LEN_TOT = 2000; CALL AIBTDLI($3,INQY,AIB,IO_AREA); PUT SKIP LIST(INQY S1CSTP FIND READY TO BE CALLED); IF AIB.RETURN = 0 THEN PUT SKIP LIST(INQY S1CSTP FIND CALLED - 0 RC); ELSE DO; PUT SKIP LIST (AIB RETURN CODE ,AIB.RETURN); PUT SKIP LIST (AIB REASON CODE ,AIB.REASON); PUT SKIP LIST (CSTP_PCB STATUS CODE ,CSTP_PCB.STATUS_CODE); PUT SKIP LIST (INQY S1CSTP FIND UNSUCCESSFULL); END; PUT SKIP LIST (CSTP STATUS ,CSTP_PCB.STATUS_CODE); PUT SKIP LIST (IO PCB , IO_PCB.STATUS_CODE); SELECT (CSTP_PCB.STATUS_CODE); WHEN ( ) DO; PUT SKIP DATA (CSTP_PCB.STATUS_CODE); PUT SKIP DATA (IO_AREA); END; WHEN (NA) PUT SKIP LIST (NA STATUS ON S1CSTP CSTPPCB.STATUS_CODE); WHEN (NU) PUT SKIP LIST (NU STATUS ON S1CSTP CSTPPCB.STATUS_CODE); OTHERWISE DO; PUT SKIP LIST (INQY FAILED ,IO_PCB.STATUS_CODE); END; END;
| Figure 52. Sample PL/I Program to retrieve database status values (Part 3 of 3)
274
Restrictions
The INQY call is valid only when using the AIB. An INQY call issued through the PCB interface is rejected with an AD status code.
275
LOG Call
The Log (LOG) call is used to send and write information to the IMS system log.
Format
LOG io pcb aib i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
i/o pcb Specifies the I/O 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 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 Specifies the area in your program that contains the record that you want to write to the system log. This is an input parameter. This record must follow the format shown in Table 62and Table 63.
Table 62. Log Record Formats for COBOL, C, Assembler, Pascal, and PL/I Programs for the AIBTDLI, ASMTDLI, CBLTDLI, CEETDLI, CTDLI, and PASTDLI Interfaces LL 2 ZZ 2 C 1 Text Variable
Table 63. Log Record Formats for COBOL, C, Assembler, Pascal, and PL/I Programs for the PLITDLI Interface LLLL 4 ZZ 2 C 1 Text Variable
The fields must be: LL or LLLL Specifies a 2-byte field (or, for PL/I, a 4-byte-long field) to contain the length of the record. The length of the record is
276
Usage
An application program can write a record to the system log by issuing the LOG call. When you issue the LOG call, specify the I/O area that contains the record you want written to the system log. You can write any information to the log, and you can use different log codes to distinguish between different types of information. You can issue the LOG call: v In a batch program, and the record is written to the IMS log v In an online program in the DBCTL environment, and the record is written to the DBCTL log v In the IMS DB/DC environment, and the record is written to the IMS log
Restrictions
The length of the I/O area (including all fields) cannot be larger than the logical record length (LRECL) for the system log data set, minus four bytes, or the I/O area specified in the IOASIZE keyword of the PSBGEN statement of the PSB. For function shipping in the CICS environment, the local and remote CICS must both be DBCTL.
Format
PCB psb name uibptr sysserve
DB/DC X
DBCTL X
DCCTL
DB Batch
TM Batch
277
Parameters
The AIB is not valid for PCB calls. psb name Specifies the PSB. An asterisk can be used for the parameter to indicate the default. This parameter is an input parameter. uibptr Specifies a pointer, which is set to the address of the UIB after the call. This parameter is an output parameter. sysserve Specifies an optional 8-byte field that contains either IOPCB or NOIOPCB. This parameter is an input parameter.
Usage
Before a CICS online program can issue any DL/I calls, it must indicate to DL/I its intent to use a particular PSB. A PCB call accomplishes this and also obtains the address of the PCB list in the PSB. When you issue a PCB call, specify: v The call function: PCB v The PSB you want to use, or an asterisk to indicate that you want to use the default name. The default PSB name is not necessarily the name of the program issuing the PCB call, because that program could have been called by another program. v A pointer, which is set to the address of the UIB after the call. For more information on defining and establishing addressability to the UIB, see Specifying the UIB (CICS Online Programs Only) on page 77. v The system service call parameter that names an optional 8-byte field that contains either IOPCB or NOIOPCB.
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL.
RCMD Call
A Retrieve Command (RCMD) call enables an automated operator (AO) application program retrieve the second and subsequent command response segments after an ICMD call.
Format
RCMD aib i/o area
Parameters
aib Specifies the application interface block (AIB) used for this 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 .
278
Usage
RCMD lets an AO application program retrieve the second and subsequent command response segments resulting from an ICMD call. Related Reading For more information on the AOI exits, see IMS Version 9: Customization Guide. Table 64 shows, by IMS environment, the types of AO application programs that can issue RCMD. RCMD is also supported from a CPI-C driven program.
Table 64. RCMD Support by Application Region Type IMS Environment Application Region Type DRA thread BMP (nonmessage-driven) BMP (message-driven) MPP IFP DBCTL Yes Yes N/A N/A N/A DB/DC Yes Yes Yes Yes Yes DCCTL N/A Yes Yes Yes Yes
RCMD retrieves only one response segment at a time. If you need additional response segments, you must issue RCMD one time for each response segment that is issued by IMS.
Restrictions
An ICMD call must be issued before an RCMD call.
279
ROLB Call
The Roll Back (ROLB) call is used to dynamically back out database changes and return control to your program. For more information on the ROLB call, see Maintaining Database Integrity (IMS Batch, BMP, and IMS Online Regions) on page 112. The ODBA interface does not support this call.
Format
ROLB i/o pcb aib i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
i/o pcb Specifies the I/O 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 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 Specifies the area in your program where IMS returns the first message segment. This parameter is an output parameter.
Restrictions
The AIB must specify the I/O PCB for this call.
ROLL Call
The Roll (ROLL) call is used to abnormally terminate your program and to dynamically back out database changes. For more information on the ROLL call, see Maintaining Database Integrity (IMS Batch, BMP, and IMS Online Regions) on page 112.
280
Format
ROLL
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
The only parameter required for the ROLL call is the call function.
Usage
When you issue a ROLL call, IMS terminates the application program with a U0778 abend.
Restrictions
Unlike the ROLB call, the ROLL call does not return control to the program.
ROLS Call
The Roll Back to SETS (ROLS) call is used to back out to a processing point set by a prior SETS or SETU call. For more information on the ROLS call, see Maintaining Database Integrity (IMS Batch, BMP, and IMS Online Regions) on page 112.
Format
ROLS i/o pcb aib db pcb i/o area token
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
db pcb Specifies the DB PCB for the call. This parameter is an input and output parameter. i/o pcb Specifies the I/O 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 .
281
Usage
When you use the Roll Back to SETS (ROLS) call to back out to a processing point set by a prior SETS or SETU, the ROLS enables you to continue processing or to back out to the prior commit point and place the input message on the suspend queue for later processing. Issuing a ROLS call for a DB PCB can result in the user abend code 3303.
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL. The ROLS call is not valid when the PSB contains a DEDB or MSDB PCB, or when the call is made to a DB2 database.
SETS/SETU Call
The Set a Backout Point (SETS) call is used to set an intermediate backout point or to cancel all existing backout points. The SET Unconditional (SETU) call operates like the SETS call, except that the SETU call is accepted even if unsupported PCBs exist or an external subsystem is used. For more information on the SETS and SETU calls, see Maintaining Database Integrity (IMS Batch, BMP, and IMS Online Regions) on page 112.
Format
SETS SETU i/o pcb aib i/o area token
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
282
Parameters
i/o pcb Specifies the I/O PCB for the call. SETS and SETU must refer to the I/O PCB. 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 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 Specifies the area in your program that contains the data to be returned on the corresponding ROLS call. This parameter is an input parameter. token Specifies the area in your program that contains a 4-byte identifier. This parameter is an input parameter.
Usage
The SETS and SETU format and parameters are the same, except for the call functions, SETS and SETU. The SETS and SETU calls provide the backout points that IMS uses in the ROLS call. The ROLS call operates with the SETS and SETU call backout points. The meaning of the SC status code for SETS and SETU is as follows: SETS The SETS call is rejected. The SC status code in the I/O PCB indicates that either the PSB contains unsupported options or the application program made calls to an external subsystem.
SETU The SETU call is not rejected. The SC status code indicates either that unsupported PCBs exist in the PSB or the application program made calls to an external subsystem.
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL. The SETS call is not valid when the PSB contains a DEDB or MSDB PCB, or when the call is made to a DB2 database. The SETU call is valid, but not functional, if unsupported PCBs exist in the PSB or if the program uses an external subsystem. | | Before a ROLS call, you can specify a maximum of 255 SETS calls with the same token and still back out to the correct message level. After 255 SETS calls, the
Chapter 12. DL/I Calls for System Services
283
SNAP Call
This section contains product-sensitive programming interface information. The SNAP call is used to collect diagnostic information.
Format
SNAP db pcb aib i/o area
DB/DC X
DBCTL X
DCCTL
DB Batch X
TM Batch
Parameters
db pcb Specifies the address that refers to a full-function PCB that is defined in a calling program PSB. 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 full-function 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 area in your program that contains SNAP operation parameters. This parameter is an input parameter. Figure 53 on page 285 shows the SNAP operation parameters you specify, including: v Length for bytes 1 through 2 v Destination for bytes 3 through 10 v Identification for bytes 11 through 18 v SNAP options for bytes 19 through 22
284
12 10 2
If you specify another length, IMS uses default values for the destination, identification, and SNAP operation parameters. 3-10 This 8-byte field tells IMS where to send SNAP output. You can direct output to the IMS log by specifying LOG or Directs the output to the IMS log. This is the default destination. dcbaddr Directs the output to the data set defined by this DCB address. The application program must open the data set before the SNAP call refers to it. This option is valid only in a batch environment. The output data set must conform to the rules for a z/OS SNAP data set. ddname Directs the output to the data set defined by the corresponding DD statement. The DD statement must conform to the rules for a z/OS SNAP data set. The data set specified by ddname is opened and closed for this SNAP request. In a DB/DC environment, you must supply the DD statement in the JCL for the control region. If the destination is invalid, IMS directs output to the IMS log.
285
19-22 19
cccc
19-21 22
ALL
N S
After the SNAP call, IMS can return the AB, AD, or (blank) status code. For a description of these codes and the response required, see IMS Version 9: Application Programming: EXEC DLI Commands for CICS and IMS.
Usage
Any application program can issue this call.
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL.
STAT Call
This sectioncontains product-sensitive programming interface information.
286
Format
STAT db pcb aib i/o area stat function
DB/DC X
DBCTL X
DCCTL
DB Batch X
TM Batch
Parameters
db pcb Specifies the DB PCB used to pass status information to the application program. The VSAM statistics used by the data sets associated with this PCB are not related to the type of statistics that is returned from the STAT call. This PCB must reference a full-function database. 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 full-function 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 an area in the application program that is large enough to hold the requested statistics. This parameter is an output parameter. In PL/I, this parameter should be specified as a pointer to a major structure, array, or character string. stat function Specifies a 9-byte area whose content describes the type and format of the statistics required. The first 4 bytes define the type of statistics requested and byte 5 defines the format to be provided. The remaining 4 bytes contain EBCDIC blanks. If the stat function that is provided is not one of the defined functions, an AC status code is returned. This parameter is an input parameter. The 9-byte field contains: v 4 bytes that define the type of statistics you want: DBAS OSAM database buffer pool statistics DBES OSAM database buffer pool statistics, enhanced or extended VBAS VSAM database subpool statistics
Chapter 12. DL/I Calls for System Services
287
O S
Full statistics to be unformatted. If you specify U, your I/O area must be at least 72 bytes. v 4 bytes of EBCDIC blanks for normal or enhanced STAT call, or E1 , for extended STAT call. U Restriction: The extended format parameter is supported by the DBESO, DBESU, and DBESF functions only. Extended OSAM buffer pool statistics can be retrieved by including the parameter E1 following the enhanced call function. The extended STAT call returns all of the statistics returned with the enhanced call, plus the statistics on the coupling facility buffer invalidates, OSAM caching, and sequential buffering IMMED and SYNC read counts.
Usage
The STAT call can be helpful in debugging because it retrieves IMS database statistics. It is also helpful in monitoring and tuning for performance. The STAT call retrieves OSAM database buffer pool statistics and VSAM database buffer supports. When you request VSAM statistics, each issued STAT call retrieves the statistics for a subpool. Statistics are retrieved for all VSAM local shared resource pools in the order in which they are defined. For each local shared resource pool, statistics are retrieved in ascending order based on buffer size. Statistics for index subpools always follow those for data subpools if any index subpool exists in the shared resource pool. The index subpools are also retrieved in ascending order based on buffer size. For more information on the STAT call, see IMS Version 9: Application Programming: Design Guide.
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL.
SYNC Call
The Synchronization Point (SYNC) call is used to release resources that IMS has locked for the application program. The ODBA interface does not support this call.
288
Format
SYNC i/o pcb aib
DB/DC X
DBCTL X
DCCTL X
DB Batch
TM Batch
Parameters
i/o pcb Specifies the IO 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 PCB name, IOPCB .
Usage
SYNC commits the changes your program has made to the database, and establishes places in your program from which you can restart, if your program terminates abnormally.
Restrictions
The SYNC call is valid only in non-message driven BMPs; you cannot issue a SYNC call from an CPI-C driven application program. For important considerations about using the SYNC call, see IMS Version 9: Administration Guide: Database Manager.
Format
TERM
DB/DC X
DBCTL X
DCCTL
DB Batch
TM Batch
289
Usage
If your program needs to use more than one PSB, you must issue a TERM call to release the first PSB it uses and then issue a second PCB call to schedule the second PSB. The TERM call also commits database changes. The only parameter in the TERM call is the call function: TERM or T . When your program issues the call, CICS terminates the scheduled PSB, causes a CICS sync point, commits changes, and frees resources for other tasks.
Restrictions
For function shipping in the CICS environment, the local and remote CICS must both be DBCTL.
XRST Call
The Extended Restart (XRST) call is used to restart your program. If you use the symbolic Checkpoint call in your program, you must precede it with an XRST call that specifies checkpoint data of blanks. The ODBA interface does not support this call.
Format
XRST i/o pcb aib i/o area length i/o area
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Parameters
i/o pcb Specifies the I/O PCB for the call. XRST must refer to the I/O PCB. 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 PCB name, IOPCB . AIBOALEN I/O area length. This field must contain the length of the I/O area specified in the call list. This parameter is not used during the XRST call. For compatibility reasons, this parameter must still be coded.
290
Usage
Programs that wish to issue Symbolic Checkpoint calls (CHKP) must also issue the Extended Restart call (XRST). The XRST call must be issued only once and should be issued early in the execution of the program. It does not need to be the first call in the program. However, it must precede any CHKP call. Any Database calls issued before the XRST call are not within the scope of a restart. To determine whether to perform a normal start or a restart, IMS evaluates the I/O area provided by the XRST call or CKPTID= value in the PARM field on the EXEC statement in your program's JCL.
291
292
Restrictions
If your program is being started normally, the first 5 bytes of the I/O area must be set to blanks. If your program is restarted and the CKPTID= value in the PARM field of the EXEC statement is not used, then the right-most bytes beyond the checkpoint ID being used in the I/O area must be set to blanks. The XRST call is allowed only from Batch and BMP application programs.
293
294
AIB X X X X X X X X X X X X X X X X X X X X X X
FF PCBs
MSDB PCBs
DEDB PCBs
I/O PCBs
GSAM PCBs
X X X X X X
X X X X X X X
X X X X
X X X X
X X X X
X X X X
X X X
X X
X X X X X X
X X
X X X X X
X X
X X
SYNC
295
AIB
FF PCBs
MSDB PCBs
DEDB PCBs
I/O PCBs
GSAM PCBs
296
v STATUS Statement on page 331 v WTO Statement on page 334 v WTOR Statement on page 335 v JCL Requirements on page 335 v Execution of DFSDDLT0 in IMS Regions on page 339 v Explanation of DFSDDLT0 Return Codes on page 339 v DFSDDLT0 Hints on page 339
297
Control Statements
Control Statements
DFSDDLT0 processes control statements to control the test environment. DFSDDLT0 can issue calls to IMS full-function databases and Fast Path databases, as well as DC calls. Table 67 gives an alphabetical summary of the types of control statements DFSDDLT0 uses. A detailed description of each type of statement follows.
Table 67. Summary of DFSDDLT0 Control Statements Control Statement ABEND CALL L
1
Code ABEND
Description Causes user abend 252. There are two types of CALL statements: CALL FUNCTION identifies the type of IMS call function to be made and supplies information to be used by the call. CALL DATA provides IMS with additional information.
COMMENT T
There are two types of COMMENT statements: Conditional allows a limited number of comments that are printed or not depending on how the STATUS statement is coded and the results of the PCB or DATA COMPARE. Unconditional allows an unlimited number of comments, all of which are printed. There are three types of COMPARE statements: E COMPARE DATA verifies that the correct segment was retrieved by comparing the segment returned by IMS with data in this statement. COMPARE AIB compares values that IMS returns to the AIB. COMPARE PCB checks fields in the PCB and calls for a snap dump of the DL/I blocks, the I/O buffer pool, or the batch region if the compare is unequal.
U1 COMPARE
IGNORE OPTION1
N or . O
The program ignores statements that contain an N or . (period) in column 1. Shows which control blocks are to be dumped, the number of unequal comparisons allowed, whether dumps are produced, number of lines printed per page, and the SPA size. PUNCH CTL produces an output data set consisting of the COMPARE PCB statements, the COMPARE AIB statements, the DATA statements, and all other control statements read. Establishes print options and selects the PCB or AIB against which subsequent calls are to be issued. Sends a message to the z/OS console without waiting for reply. Sends a message to the z/OS console and waits for a reply before proceeding.
PUNCH1
CTL
S WTO WTOR
1. These control statements are acted on immediately when encountered in an input stream. Do not code them where they will interrupt call sequences. (See Planning the Control Statement Order on page 299.)
The control statements from Table 67 are described below: v The CALL statement is the central DFSDDLT0 statement. The CALL statement has two parts: CALL FUNCTION and CALL DATA. CALL FUNCTION identifies the type of IMS call function and supplies information about segment
298
Control Statements
search arguments (SSAs). CALL DATA provides more information required for the type of call identified by CALL FUNCTION. v The STATUS statement controls the PCB, AIB, and handling of output. v The three types of COMPARE statements, DATA, PCB, and AIB, compare different values: If you want specific data from a call, use COMPARE DATA to check the segment data for mismatches when the call is made. Use COMPARE PCB to check status codes, segment levels, and feedback keys. It also indicates mismatches when you specify output. Use COMPARE AIB to compare values that IMS returns to the AIB. v The two COMMENT statements, Conditional and Unconditional, allow you to set limits on the number of comments on the DFSDDLT0 job stream and to specify whether you want the comments printed. v The OPTION statement controls several overall functions such as the number of unequal comparisons allowed and the number of lines printed per page. v The remaining statements, ABEND, IGNORE, CTL, WTO and WTOR, are not as important as the others at first. Read the sections describing these statements so that you can become familiar with the functions they offer. When you are coding the DFSDDLT0 control statements, keep these items in mind: v If you need to temporarily override certain control statements in the DFSDDLT0 streams, go to the JCL requirements section and read about SYSIN/SYSIN2 processing under SYSIN2 DD Statement on page 336. v You must fill in column 1 of each control statement. If column 1 is blank, the statement type defaults to the prior statement type. DFSDDLT0 attempts to use any remaining characters as it would for the prior statement type. v Use of reserved fields can produce invalid output and unpredictable results. v Statement continuations are important, especially for the CALL statement. v Sequence numbers are not required, but they can be very useful for some DFSDDLT0 functions. To understand how to use sequence numbers, see PUNCH CTL Statement on page 328, SYSIN DD Statement on page 336 and SYSIN2 DD Statement on page 336. v All codes and fields in the DFSDDLT0 statements must be left justified followed by blanks, unless otherwise specified.
299
ABEND Statement
The ABEND statement causes IMS to issue an abend and terminate DFSDDLT0. Table 68 shows the format of the ABEND statement.
Table 68. ABEND Statement Column 1-5 6-72 73-80 Function Identifies control statement Reserved Sequence indication nnnnnnnn For SYSIN2 statement override. Code ABEND Description Issues abend U252. (No dump is produced unless you code DUMP on the OPTION statement.)
CALL Statement
The CALL control statement has two parts: CALL FUNCTION and CALL DATA. v The CALL FUNCTION statement supplies the DL/I call function, the segment search arguments (SSAs), and the number of times to repeat the call. SSAs are coded according to IMS standards. v With the CALL DATA statement you provide any data (database segments, z/OS commands, checkpoint IDs) required by the DL/I call specified in the CALL FUNCTION statement. See CALL DATA Statement on page 303.
300
CALL Statement
Table 69. CALL FUNCTION Statement (continued) Column 2 3 Function Reserved SSA level n 4 5-8 Reserved Repeat count nnnn If blank, repeat count defaults to 1. 'nnnn' is the number of times to repeat this call. Range is 1 to 9999, right-justified, with or without leading zeros. SSA level (optional) Range of hexadecimal characters allowed is 1-F Code Description
9 10-13
Reserved Identifies DL/I call function xxxx Continue SSA CONT If blank, use function from previous CALL statement. 'xxxx' is a DL/I call function. Continuation indicator for SSAs too long for a single CALL FUNCTION statement. Column 72 of the preceding CALL FUNCTION statement must have an entry. The next CALL statement should have CONT in columns 10 - 13 and the SSA should continue in column 16.
Reserved SSA name Token MOD name Subfunction Statistics type Statistics format SETO ID1 SETO IOAREA SIZE xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxx x SETx nnnn Must be left-justified. Token name (SETS/ROLS). Modname (PURG+ISRT). nulls, DBQUERY, FIND, ENVIRON, PROGRAM (INQY). DBAS/DBES-OSAM or VBAS/VBES-VSAM (STAT).2 F - Formatted U- Unformatted S - Summary. Where x is 1, 2, or 3. Specified on SETO and CHNG calls as defined in Note. Value of 0000 to 8192. If a value greater than 8192 is specified, it defaults to 8192. If no value is specified, the call is made with no SETO size specified.
2471
Remainder of SSA
Unqualified SSAs must be blank. Qualified search arguments should have either an '*' or a '(' in column 24 and follow IMS SSA coding conventions. No continuations for this statement. x Alone, it indicates multiple SSAs each beginning in column 16 of successive statements. With CONT in columns 10-13 of the next statement, indicates a single SSA that is continued beginning in column 16 of the following statement.
72
Continuation column
301
CALL Statement
Table 69. CALL FUNCTION Statement (continued) Column 73-80 Note: 1. SETO CALL: The SETO ID (SET1, SET2, or SET3) is required on the SETO call if DFSDDLT0 is to keep track of the text unit address returned on the SETO call that would be passed on the CHNG call for option parameter TXTU. If the SETO ID is omitted on the SETO call, DFSDDLT0 does not keep track of the data returned and is unable to reference it on a CHNG call. CHNG CALL: The SETO ID (SET1, SET2, or SET3) is required on the CHNG call if DFSDDLT0 is to place the address of the SETO ID I/O area returned on the SETO call. This is the SETO call of the text unit returned on the SETO call with a matching SETO ID for this CHNG call into the TXTU=ADDR field of the option parameter in the CHNG call. When the SETO ID is specified on the CHNG call, DFSDDLT0 moves the address of that text unit returned on the SETO call using the same SETO ID. Code the OPTION statement parameter TXTU as follows: TXTU=xxxx where xxxx is any valid non-blank character. It cannot be a single quote character. Suggested value for xxxx could be SET1, SET2, or SET3. This value is not used by DFSDDLT0. 2. STAT is a Product-sensitive programming interface. Function Sequence indication Code nnnnnnnn Description For SYSIN2 statement override.
This information applies to different types of continuations: v Column 3, the SSA level, is usually blank. If it is blank, the first CALL FUNCTION statement fills SSA 1, and each following CALL FUNCTION statement fills the next lower SSA. If column 3 is not blank, the statement fills the SSA at that level, and the following CALL FUNCTION statement fills the next lower one. v Columns 5 through 8 are usually blank, but if used, must be right justified. The same call is repeated as specified by the repeat call function. v Columns 10 through 13 contain the DL/I call function. The call function is required only for the first CALL FUNCTION statement when multiple SSAs are in a call. If left blank, the call function from the previous CALL FUNCTION statement is used. v Columns 16 through 23 contain the segment name if the call uses a SSA. v If the DL/I call contains multiple SSAs, the statement must have a nonblank character in column 72, and the next SSA must start in column 16 of the next statement. The data in columns 1 and 10 through 13 are blank for the second through last SSAs. Restriction: On ISRT calls, the last SSA can have only the segment name with no qualification or continuation. v If a field value extends past column 71, put a nonblank character in column 72. (This character is not read as part of the field value, only as a continuation character.) In the next statement insert the keyword CONT in columns 10 through 13 and continue the field value starting at column 16. v Maximum length for the field value is 256 bytes, maximum size for a SSA is 290 bytes, and the maximum number of SSAs for this program is 15, which is the same as the IMS limit. v If columns 5 through 8 in the CALL FUNCTION statement contain a repeat count for the call, the call will terminate when reaching that count, unless it first encounters a GB status code.
302
CALL Statement
Related Reading: See CALL FUNCTION Statement with Column-Specific SSAs on page 317 for another format supported by DFSDDLT0.
Format options
P Z U
5-8
nnnn
This value must be right justified but need not contain leading zeros. If you do not specify a length, DFSDDLT0 will use the number of DATA statements read multiplied by 56 to derive the length.
9 10-13 14-15
Reserved Identifies CALL DATA statement Reserved DATA Identifies this as a DATA statement.
303
CALL Statement
Table 70. CALL DATA Statement (continued) Column 16-71 or 16-23 or 16-23 or 16 72 DEQ option Continuation column x 73-80 Sequence indication nnnnnnnn DEQ options (A,B,C,D,E,F,G,H,I, or J). If no more continuations for this segment. If more data for this segment or more segments. For SYSIN2 statement override. Destination name Destination name (CHNG). Checkpoint ID Checkpoint ID (SYNC). Function Data area Code xxxx Description Data that goes in the I/O area.
When inserting variable-length segments or including variable-length data for a CHKP or LOG call: v You must use a V or M in column 4 of the CALL DATA statement. v Use V if only one variable-length segment is being processed. v You must enter the length of the data with leading zeros, right justified, in columns 5 through 8. The value is converted to binary and becomes the first 2 bytes of the segment data. v You can continue a CALL DATA statement into the next CALL DATA statement by entering a nonblank character in column 72. For subsequent statements, leave columns 1 through 15 blank, and start the data in column 16. If multiple variable-length segments are required (that is, concatenation of logical child and logical parent segments, both of which are variable-length) for the first segment: v You must enter a V in column 4. v You must enter the length of the first segment in columns 5 through 8. v If the first segment is longer than 56 bytes, continue the data as described for inserting variable-length segments. Exceptions: The last CALL DATA statement to contain data for this segment must have a nonblank character in column 72. The next CALL DATA statement applies to the next variable-length statement and must contain an M in column 4 and the length of the segment in columns 5 through 8. You can concatenate any number of variable-length segments in this manner. Enter M or V and the length (only in CALL DATA statements that begin data for a variable-length segment). When a program is inserting or replacing through path calls: v Enter a P in column 4 to specify that the length field is to be used as the length the segment will occupy in the user I/O area.
304
CALL Statement
v You only need to use P in the first statement of fixed-length-segment CALL DATA statements in path calls that contain both variable- and fixed-length segments. v You can use V, M, and P in successive CALL DATA statements. For INIT, SETS, ROLS, and LOG calls: v The format of the I/O area is
LLZZuser-data
where LL is the length of the data in the I/O area, including the length of the LLZZ portion. v If you want the program to use this format for the I/O area, enter a Z in column 4 and the length of the data in columns 5 through 8. The length in columns 5 through 8 is the length of the data, not including the 4-byte length of LLZZ.
305
CALL Statement
Table 72. FEEDBACK DATA Statement (continued) Column 4 Function Format option Z 5-8 Length of feedback area nnnn Code Description Feedback area contains LLZZ. Length of feedback area will be computed and the LLZZ will be added to the feedback area. This value must be right justified but need not contain leading zeros. If you do not specify a length, DFSDDLT0 uses the number of FDBK inputs read multiplied by 56 to derive the length.
Reserved Identifies Reserved Feedback area Continuation column x xxxx Contains user pre-defined initialized area. If no more continuations for feedback. If more feedback data exists in following statement. For SYSIN2 statement override. FDBK Identifies this as feedback statement and continuation of feedback statement.
73-80
Sequence number
nnnnnnnn
Description Checkpoint. Change alternate PCB. Contains the alternate PCB name option statement and feedback statement optional. Issue IMS command. This call defaults to I/O PCB. Dequeue segments locked with the Q command code. For full function, this call defaults to the I/O PCB, provided a DATA statement containing the class to dequeue immediately follows the call. For Fast Path, the call is issued against a DEDB PCB. Do not include a DATA statement immediately following the DEQ call. Delete. If the data statement is present, it is used. If not, the call uses the data from the previous Get Hold Unique (GHU). Fieldfor Fast Path MSDB calls using FSAs. This call references MSDBs only. If there is more than one FSA, put a nonblank character in column 34, and put the next FSA in columns 16-34 of the next statement. A DATA statement containing FSA is required. Get command response. This call defaults to I/O PCB. Get Hold Next. Get Hold Next in Parent. Get Hold Unique.
DLET FLD
yes yes
yes yes
O R
N O O O
2 2 2
306
CALL Statement
Table 73. DL/I Call Functions (continued) Call GMSG
3
PCB Support no
Data Stmt R
Description Get Message is used in an automated operator (AO) application program to retrieve a message from AO exit routine DFSAOE00. The DATA statement is required to allow for area in which to return data. The area must be large enough to hold this returned data. Get Next segment. Get Next in Parent. Get Unique segment. Issue Command enables an automated operator (AO) application program to issue an IMS command and retrieve the first command response segment. The DATA statement is required to contain the input command and to allow for area in which to return data. The area must be large enough to hold this returned data. Initialization This call defaults to I/O PCB. A DATA statement is required. Use the LLZZ format. Request environment information using the AIB and the ENVIRON subfunction. The DATA statement is required to allow for area in which to return data. The area must be large enough to hold this returned data. Request database information using the AIB and the DBQUERY subfunction, which is equivalent to the INIT DBQUERY call. The DATA statement is required to allow for area in which to return data. The area must be large enough to hold this returned data. Insert.
GN GNP GU ICMD
3
O2 O O R
2 2
INIT INQY3
yes yes
yes no
R R
ISRT
yes
yes R O R
DB PCB, DATA statement required. I/O PCB using I/O area with MOD name, if any, in columns 16-23. Alt PCB. Log system request. This call defaults to I/O PCB. DATA statement is required and can be specified in one of two ways. Position - for DEDBs to determine a segment location. This call references DEDBs only. Purge.
R N
This call defaults to use I/O PCB. If column 16 is not blank, MOD (message output descriptor) name is used and a DATA statement is required. If column 16 is blank, the DATA statement is optional. Retrieve Command enables an automated operator (AO) application program to retrieve the second and subsequent command response segments after an ICMD call. The DATA statement is required to allow for area in which to return data. The area must be large enough to hold this returned data. ReplaceThis call references DB PCBs only. The DATA statement is required. Roll Back call.
O RCMD
3
yes
no
REPL ROLB
yes yes
yes yes
R O
307
CALL Statement
Table 73. DL/I Call Functions (continued) Call ROLL ROLS AIB Support no yes PCB Support yes yes Data Stmt O O
1
Description Roll Back call and issue U778 abend. Back out updates and issue 3303 abend. Uses the I/O PCB. Can be used with the SETS call function. To issue a ROLS with an I/O area and token as the fourth parameter, specify the 4-byte token in column 16 of the CALL statement. Leaving columns 16-19 blank will cause the call to be made without the I/O area and the token. (To issue a ROLS using the current DB PCB, use ROLX.) Roll call against the DB PCB (DFSDDLT0 call function). This call is used to request a Roll Back call to DB PCB, and is changed to ROLS call when making the DL/I call. Set options. OPTION statement required. FEEDBACK statement optional. Create or cancel intermediate backout points. Uses I/O PCB. To issue a SETS with an I/O area and token as the fourth parameter, specify the four-byte token in column 16 of the CALL statement and include a DATA statement. Leaving columns 16-19 blank will cause the call to be made without the I/O area and the token. Sets the identification and destination for snap dumps. If a SNAP call is issued without a CALL DATA statement, a snap of the I/O buffer pools and control blocks will be taken and sent to LOG if online and to PRINTDD DCB if batch. The SNAP ID will default to SNAPxxxx where xxxx starts at 0000 and is incremented by 1 for every SNAP call without a DATA statement. The SNAP options default to YYYN. If a CALL DATA statement is used, columns 16-23 specify the SNAP destination, columns 24-31 specify the SNAP identification, and columns 32-35 specify the SNAP options. SNAP options are coded using Y to request a snap dump and N to prevent it. Column 32 snaps the I/O buffer pools, columns 33 and 34 snap the IMS control blocks and column 35 snaps the entire region. The SNAP call function is only supported for full-function database PCB. The STAT call retrieves statistics on the IMS system. This call must reference only full-function DB PCBs. See the examples on 317. Statistics type is coded in columns 16-19 of the CALL FUNCTION statement. DBAS For OSAM database buffer pool statistics.
ROLX
yes
yes
SETO SETS/SETU
yes yes
yes yes
N O
SNAP4
yes
yes
STAT5
yes
yes
VBAS For VSAM database subpool statistics. Statistics format is coded in column 20 of the CALL FUNCTION statement. F U S SYNC XRST yes yes yes yes R R For the full statistics to be formatted if F is specified, the I/O area must be at least 360 bytes. For the full statistics to be unformatted if U is specified, the I/O area must be at least 72 bytes. For a summary of the statistics to be formatted if S is specified, the I/O area must be at least 120 bytes.
Synchronization. Restart.
308
CALL Statement
Table 73. DL/I Call Functions (continued) Call Notes: 1. R = required; O = optional; N = none 2. The data statement is required on the AIB interface. 3. Valid only on the AIB interface. 4. SNAP is a Product-sensitive programming interface. 5. STAT is a Product-sensitive programming interface. AIB Support PCB Support Data Stmt
1
Description
Symbolic CHKP Call with Two Data Areas to Checkpoint: Use a CALL FUNCTION statement to contain the CHKP function, a CALL DATA statement to contain the checkpoint ID data, and two CALL DATA statements to contain the data that you want to checkpoint. You also need to use an XRST call when you use the symbolic CHKP call. Prior usage of an XRST call is required when using the symbolic CHKP call, as the CHKP call keys on the XRST call for symbolic CHKP. Recommendation: Issue an XRST call as the first call in the application program.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L XRST L . L . L . L CHKP L DATA TSTCHKP2 X L 8 DATA STRING2X L 16 DATA STRING2-STRING2U EIGHT BYTES OF DATA (STRING2-) IS CHECKPOINTED AND U SIXTEEN BYTES OF DATA (STRING2-STRING2-) IS CHECKPOINTED ALSO
CHNG Call: Use a CALL FUNCTION statement to contain the CHNG function and a CALL DATA statement to contain the new logical terminal name.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L CHNG SET1 L OPT IAFP=A1M,PRTO=LLOPTION1,OPTION2, L CONT OPTION4 L Z0023 DATA DESTNAME LL is the hex value of the length of LLOPTION,.........OPTION4.
The following is an example of a CHNG statement using SETO ID SET2, OPTION statement, DATA statement with MODNAME, and FDBK statement.
309
CALL Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L CHNG SET2 L OPT IAFP=A1M,TXTU=SET2 L Z0023 DATA DESTNAME L Z0095 FDBK FEEDBACK AREA
CMD Call: Use a CALL FUNCTION statement to contain the CMD function and a CALL DATA statement to contain the Command data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L CMD L ZXXXX DATA COMMAND DATA WHERE XXXX = THE LENGTH OF THE COMMAND DATA
DEQ Call: For full function, use a CALL FUNCTION statement to contain the DEQ function and a CALL DATA statement to contain the DEQ value (A,B,C,D,E,F,G,H,I or J).
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L DEQ L DATA A
For Fast Path, use a CALL FUNCTION statement to contain the DEQ function.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L DEQ
DLET Call: Use a CALL FUNCTION statement to contain the DLET function. The data statement is optional. If there are intervening calls to other PCBs between the Get Hold call and the DLET call, you must use a data statement to refresh the I/O area with the segment to be deleted.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L DLET
FLD Call: Use a CALL FUNCTION statement to contain the FLD function and ROOTSSA, and a CALL DATA statement to contain the FSAs.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L FLD ROOTA (KEYA =ROOTA) L DATA ??????? X L DATA
GCMD Call: Use a CALL FUNCTION statement to contain the GCMD function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GCMD
GHN Call: Use a CALL FUNCTION statement to contain the GHN function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GHN 10103210
GHNP Call: Use a CALL FUNCTION statement to contain the GHNP function; no CALL DATA statement is required.
310
CALL Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GHNP 10103210
GHU Call with a Continued SSA: Use two CALL FUNCTION statements to contain the single SSA.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GHU SEGG (FILLRG = G131G131G131G131G131G131G131G131G131G* CONT 131G131G131G131G131G131G131 )
GMSG Call: Use a CALL FUNCTION statement to contain the GMSG function. Use a CALL DATA statement to retrieve messages from AO exit routine.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GMSG TOKEN111 WAITAOI L Z0132 DATA L GMSG L Z0132 DATA
GN Call: Use a CALL FUNCTION statement to contain the GN function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GN 10103210
GNP Call: Use a CALL FUNCTION statement to contain the GNP function; no CALL DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GNP 10103210
GU Call with a Single SSA and a Relational Operator: Use a CALL FUNCTION statement to contain the GU function; no CALL DATA statement is required. The qualified SSA begins in column 24 and is contained in parentheses.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU SEGF (KEYF > F131*KEYF < F400)
GU Call with a Single SSA and a Relational Operator Extended Across Multiple Inputs with Boolean Operators: Use a CALL FUNCTION statement to contain the GU function and three additional continuation of CALL FUNCTION input to continue with Boolean operators. No CALL DATA statement is required. The qualified SSA begins in column 24 and is contained in parentheses. This type of SSA can continue over several statements.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU SEGG (FILLRG > G131G131G131G131G131G131G131G131G131G* CONT 131G131G131G131G131G131G131 &FILLRG < G400G400G4* CONT 00G400G400G400G400G400G400G400G400G400G400G400G400G400 * CONT )
GU Path Call: Use a CALL FUNCTION statement to contain the GU function and three additional continuation of CALL function input to continue with two additional SSAs. No CALL DATA statement is required. The call uses command codes in columns 24 and 25 to construct the path call. This type of call cannot be made with the column-specific SSA format.
311
CALL Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU SEGA *D(KEYA = A200) * SEGF *D(KEYF = F250) * SEGG *D(KEYG = G251)
ICMD Call: Use a CALL FUNCTION statement to contain the ICMD function. Use a CALL DATA statement to contain the command.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ICMD L Z0132 DATA /DIS ACTIVE
INIT Call: Use a CALL FUNCTION statement to contain the INIT call and a CALL DATA statement to contain the INIT function DBQUERY, STATUS GROUPA, or STATUS GROUPB.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L INIT 10103210 L Z0011 DATA DBQUERY
INQY Call: Use a CALL FUNCTION statement to contain the INQY call and either the DBQUERY or ENVIRON subfunction. The subfunctions are in the call input rather than the data input as in the INIT call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L INQY ENVIRON 10103210 L V0256 DATA 10103211 L 10103212 |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L INQY DBQUERY 10103210 L V0088 DATA 10103211 L 10103212
ISRT Call: Use two CALL FUNCTION statements to contain the multiple SSAs and a CALL DATA statement to contain the segment data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT STOCKSEG(NUMFIELD =20011) X10103210 ITEMSSEG 10103211 L V0018 DATA 3002222222222222 10103212
ISRT Containing Only One Fixed-Length Segment: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and two CALL DATA statements to contain the fixed-length segment. When inserting only one fixed-length segment, leave columns 4 through 8 blank and put data in columns 16 through 71. To continue data, put a nonblank character in column 72, and the continued data in columns 16 through 71 of the next statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT JOKESSEG 10103210 L DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103211 XJUMPEDOVERTHELAZYDOGSIR 10103212
ISRT Containing Only One Variable-Length Segment: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and two CALL DATA statements to contain the variable-length segment. When only one segment of variable-length is being processed, you must enter a V in column 4, and columns 5 through 8 must contain the length of the segment data. The length in columns 5 through 8 is converted to binary and becomes the first two bytes of the segment
312
CALL Statement
data. To continue data, put a nonblank character in column 72, and the continued data in columns 16 through 71 of the next statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT JOKESSEG 10103210 L V0080 DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103211 XJUMPEDOVERTHELAZYDOGSIR 10103212
ISRT Containing Multiple Variable-Length Segments: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and four CALL DATA statements to contain the variable-length segments. For the first segment, you must enter a V in column 4 and the length of the segment data in columns 5 through 8. If the segment is longer than 56 bytes, put a nonblank character in column 72, and continue data on the next statement. The last statement to contain data for this segment must have a nonblank character in column 72. The next DATA statement applies to the next variable-length segment and it must contain an M in column 4, the length of the new segment in columns 5 through 8, and data starting in column 16. Any number of variable-length segments can be concatenated in this manner. If column 72 is blank, the next statement must have the following: v An L in column 1 v An M in column 4 v The length of the new segment in columns 5 through 8 v The keyword DATA in columns 10 through 13 v Data starting in column 16
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT AAAAASEG 10103210 L V0080 DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103211 XJUMPEDOVERTHELAZYDOGSIR *10103212 M0107 DATA NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRYNOW*10103213 ISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY 10103214
ISRT Containing Multiple Segments in a PATH CALL: Use a CALL FUNCTION statement to contain the ISRT function and segment name, and seven CALL DATA statements to contain the multiple segments in the PATH CALL. When DFSDDLT0 is inserting or replacing segments through path calls, you can use V and P in successive statements. The same rules apply for coding multiple variable-length segments, but fixed-length segments must have a P in column 4 of the DATA statement. This causes the length field in columns 5 through 8 to be used as the length of the segment, and causes the data to be concatenated in the I/O area without including the LL field. Rules for continuing data in the same segment or starting a new segment in the next statement are the same as those applied to the variable-length segment.
313
CALL Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT LEV01SEG*D *10103210 LEV02SEG *10103211 LEV03SEG *10103212 LEV04SEG 10103213 L V0080 DATA THEQUICKBLACKDOGJUMPEDONTOTHECRAZYFOXOOPSTHEQUICKBROWNFO*10103214 XJUMPEDOVERTHELAZYDOGSIR *10103215 M0107 DATA NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRYNOW*10103216 ISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY *10103217 L P0039 DATA THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOGSIR *10103218 L M0107 DATA NOWISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRYNOW*10103219 ISTHETIMEFORALLGOODMENTOCOMETOTHEAIDOFTHEIRCOUNTRY 10103220
LOG Call Using an LLZZ Format: Use a CALL FUNCTION statement to contain the LOG function and a CALL DATA statement to contain the LLZZ format of data to be logged. When you put a Z in column 4, the first word of the record is not coded in the DATA statement. The length specified in columns 5 through 8 must include the 4 bytes for the LLZZ field that is not in the DATA statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L LOG 10103210 L Z0016 DATA ASEGMENT ONE 10103211
The A in column 16 becomes the log record ID. POS Call: Use a CALL FUNCTION statement to contain the POS function and SSA; CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L POS SEGA (KEYA =A300)
PURG Call with MODNAME and Data: Use a CALL FUNCTION statement to contain the PURG function and MOD name. Use the CALL DATA statement to contain the message data. If MOD name is provided, a DATA statement is required.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L PURG MODNAME1 L DATA FIRST SEGMENT OF NEW MESSAGE
PURG Call with Data and no MODNAME: Use a CALL FUNCTION statement to contain the PURG function; a DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L PURG L DATA FIRST SEGMENT OF NEW MESSAGE
PURG Call without MODNAME or Data: Use a CALL FUNCTION statement to contain the PURG function; CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L PURG
RCMD Call: Use a CALL FUNCTION statement to contain the RCMD function. Use a CALL DATA statement to retrieve second and subsequent command response segments resulting from an ICMD call.
314
CALL Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L RCMD L Z0132 DATA
REPL Call: Use a CALL FUNCTION statement to contain the REPL function. Use a CALL DATA statement to contain the replacement data.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L REPL L V0028 DATA THIS IS THE REPLACEMENT DATA
ROLB Call Requesting Return of First Segment of Current Message: Use a CALL FUNCTION statement to contain the ROLB function. Use the CALL DATA statement to request first segment of current message.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ROLB L DATA THIS WILL BE OVERLAID WITH FIRST SEGMENT OF MESSAGE
ROLB Call Not Requesting Return of First Segment of Current Message: Use a CALL FUNCTION statement to contain the ROLB function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ROLB
ROLL Call: Use a CALL FUNCTION statement to contain the ROLL function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ROLL
ROLS Call with a Token: Use a CALL FUNCTION statement to contain the ROLS function and token, and the CALL DATA statement to provide the data area that will be overlaid by the data from the SETS call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ROLS TOKEN1 L Z0046 DATA THIS WILL BE OVERLAID WITH DATA FROM SETS
ROLS Call without a Token: Use a CALL FUNCTION statement to contain the ROLS function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ROLS
ROLX Call: Use a CALL FUNCTION statement to contain the ROLX function. The CALL DATA statement is optional. The ROLX function is treated as a ROLS call with no token.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ROLX
SETO Call: Use a CALL FUNCTION statement to contain the SETO function. The DATA statement is optional; however, if an OPTION statement is passed on the call, the DATA statement is required. Also, if a FEEDBACK statement is passed on the call, then both the DATA and OPTION statements are required. The following is an example of a SETO statement using the OPTION statement and SETO token
Chapter 14. DL/I Test Program (DFSDDLT0)
315
CALL Statement
of SET1.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SETO SET1 5000 L OPT PRTO=11OPTION1,OPTION2, L CONT OPTION3, L CONT OPTION4
11 is the hex value of the length of 11OPTION,.........OPTION4. The following is an example of a SETO statement using the OPTION statement and SETO token of SET1.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SETO SET1 7000 L OPT PRTO=11OPTION1,OPTION2,OPTION3,OPTION4
11 is the hex value of the length of 11OPTION,.........OPTION4. The following is an example of a SETO statement using the OPTION statement and SETO token of SET2 and FDBK statement.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SETO SET2 5500 L OPT PRTO=11OPTION1,OPTION2,OPTION3,OPTION4 L Z0099 FDBK OPTION ERROR FEEDBACK AREA
11 is the hex value of the length of 11OPTION,.........OPTION4. SETS Call with a Token: Use a CALL FUNCTION statement to contain the SETS function and token; use the CALL DATA statement to provide the data that is to be returned to ROLS call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SETS TOKEN1 L Z0033 DATA RETURN THIS DATA ON THE ROLS CALL
SETS Call without a Token: Use a CALL FUNCTION statement to contain the SETS function; CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SETS
This section (SNAP call) contains product-sensitive programming interface information. SNAP Call: Use a CALL FUNCTION statement to contain the SNAP function and a CALL DATA statement to contain the SNAP data.
316
CALL Statement
STAT Call: OSAM statistics require only one STAT call. STAT calls for VSAM statistics retrieve only one subpool at a time, starting with the smallest. See IMS Version 9: Application Programming: Design Guide for further information about the statistics returned by STAT.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L STAT DBASF L STAT VBASS L STAT VBASS L STAT VBASS L STAT VBASS
SYNC Call: Use a CALL FUNCTION statement to contain the SYNC function. The CALL DATA statement is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SYNC
Initial XRST Call: Use a CALL FUNCTION statement to contain the XRST FUNCTION and a CALL DATA statement that contains a checkpoint ID of blanks to indicate that you are normally starting a program that uses symbolic checkpoints.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L XRST 10101400 L DATA L CKPT L DATA YOURID01
Basic XRST Call: Use a CALL FUNCTION statement to contain the XRST function and a CALL DATA statement to contain the checkpoint ID.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L XRST 10101400 L DATA TESTCKPT
Symbolic XRST Call: Use a CALL FUNCTION statement to contain the XRST function, a CALL DATA statement to contain the checkpoint ID data, and one or more CALL DATA statements where the data is to be returned. The XRST call is used with the symbolic CHKP call.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L XRST L DATA TSTCHKP2 X L 8 DATA OVERLAY2 X L 16 DATA OVERLAY2OVERLAY2 U EIGHT BYTES OF DATA (OVERLAY2) SHOULD BE OVERLAID WITH CHECKPOINTED DATA U SIXTEEN BYTES OF DATA (OVERLAY2OVERLAY2) IS OVERLAID ALSO
317
CALL Statement
Table 74. CALL FUNCTION Statement (Column-Specific SSAs) Column 1 2 3 4 5-8 Function Identifies control statement Reserved Reserved Reserved Repeat Count nnnn If blank, repeat count defaults to 1. 'nnnn' is the number of times to repeat this call. Range 1 to 9999, right-justified but need not contain leading zeros. If blank, use function from previous CALL statement. xxxx CONT 'xxxx' is a DL/I call function. Continuation indicator for SSAs too long for a single CALL FUNCTION statement. Column 72 of preceding CALL FUNCTION statement must contain a nonblank character. The next CALL statement should have CONT in columns 10 through 13 and the SSA should continue in column 16. Code L Description Call statement (see columns 10-13).
10-13
Reserved SSA name Reserved Start character for SSA SSA field name Reserved DL/I call operator(s) Reserved Field value End character for SSA Continuation column x nnnnn ) name ( f-name s-name Required if call contains SSA. Separator field. Required if segment is qualified. Required if segment is qualified. Separator field. Required if segment is qualified. Separator field. Required if segment is qualified. Note: Do not use '5D' or ')' in field value. Required if segment is qualified. No continuations for this statement. Alone, it indicates multiple SSAs each beginning in column 16 of successive statements. With CONT in columns 10-13 of the next statement, indicates a single SSA that is continued beginning in column 16 of the following statement For SYSIN2 statement override.
73-80
Sequence indication
nnnnnnnn
If a CALL FUNCTION statement contains multiple SSAs, the statement must have a nonblank character in column 72 and the next SSA must start in column 16 of the next statement. If a field value extends past column 71, put a nonblank character in column 72. In the next statement insert the keyword CONT in columns 10 through 13 and continue the field value starting at column 16. Maximum length for field value is 256 bytes, maximum size for a SSA is 290 bytes, and the maximum number of SSAs for this program is 15, which is the same as the IMS limit.
318
CALL Statement
9 10-15
Reserved Special call function STAK END SKIP START Stack control statements for later execution. Stop stacking and begin execution. Skip statements until START function is encountered. Start processing statements again. For SYSIN2 statement override.
73-80
Sequence indication
nnnnnnnn
319
CALL Statement
//BATCH.SYSIN DD * 10000700 |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< O SNAP= ,ABORT=0 10000800 S 1 1 1 1 1 10001000 L GU SEGA (KEYA =A300) 10001100 L 0003 STAK 10001150 WTO THIS IS PART OF THE STAK 10001200 T THIS COMMENT IS PART OF THE STAK 10001300 L GN 10001400 L END 10001450 U THIS COMMENT SHOULD GET PRINTED AFTER THE STAK IS DONE 3 TIMES 10001500 L 0020 GN 10001600 /*
SKIP/START Call: The following example demonstrates the use of the SKIP and START call functions in SYSIN2 to override and stop the processing of the STAK and END call functions in SYSIN. DFSDDLT0 executes the GU call function in SYSIN, skips the processing of STACK, WTO, T comment, GN, and END in SYSIN, and goes to the COMMENT.
//BATCH.SYSIN DD * 10000700 |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< O SNAP= ,ABORT=0 10000800 S 1 1 1 1 1 10001000 L GU SEGA (KEYA =A300) 10001100 L 0003 STAK 10001150 WTO THIS IS PART OF THE STAK 10001200 T THIS COMMENT IS PART OF THE STAK 10001300 L GN 10001400 L END 10001450 U THIS COMMENT SHOULD GET PRINTED AFTER THE STAK IS DONE 3 TIMES 10001500 L 0020 GN 10001600 /* //BATCH.SYSIN2 DD * |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L SKIP 10001150 L START 10001450 U THIS COMMENT SHOULD REPLACE THE STAK COMMENT 10001500 U ********THIS COMMENT SHOULD GET PRINTED BECAUSE OF SYSIN2********* 10001650 /*
COMMENT Statement
Use the COMMENT statement to print comments in the output data. The two types of COMMENT statements, conditional and unconditional are described. Table 76 on page 321 shows the format of the COMMENT statement.
320
COMMENT Statement
COMPARE Statement
The COMPARE statement compares the actual results of a call with the expected results. The three types of COMPARE statements are the COMPARE PCB, COMPARE DATA, and COMPARE AIB. When you use the COMPARE PCB, COMPARE DATA, and COMPARE AIB statements you must: v Code COMPARE statements in the DFSDDLT0 stream immediately after either the last continuation, if any, of the CALL DATA statement or another COMPARE statement. v Specify the print option for the COMPARE statements in column 7 of the STATUS statement. For all three COMPARE statements: v The condition code returned for a COMPARE gives the total number of unequal comparisons. v For single fixed-length segments, DFSDDLT0 uses the comparison length to perform comparisons if you provide a length. The length comparison option (column 3) is not applicable. When you use the COMPARE PCB statement and you want a snap dump when there is an unequal comparison, request it on the COMPARE PCB statement. A snap dump to a log with SNAP ID COMPxxxx is issued along with the snap dump options specified in column 3 of the COMPARE PCB statement.
Chapter 14. DL/I Test Program (DFSDDLT0)
321
COMPARE Statement
The numeric part of the SNAP ID is initially set to 0000 and is incremented by 1 for each SNAP resulting from an unequal comparison.
Segment length option V For a variable-length segment only, or for the first variable-length segment of multiple variable-length segments in a path call, or for a concatenated logical-childlogical-parent segment. For the second or subsequent variable-length segment of a path call, or for a concatenated logical-childlogicalparent segment. For fixed-length segments in path calls. For message segment. Length to be used for comparison. (Required for length options V, M, and P if L is coded in column 3.)
| | | | | | | | |
9 10-13
Reserved Identifies type of statement DATA Required for the first I/O COMPARE statement and the first statement of a new segment if data from previous I/O COMPARE statement is not continued.
14-15 16-71 72
Reserved String of data Continuation column x Data against which the segment in the I/O area is to be compared. If blank, data is NOT continued. If not blank, data will be continued, starting in columns 16-71 of the subsequent statements for a maximum of 3840 bytes. For SYSIN2 statement override.
73-80
Sequence indication
nnnnnnnn
322
COMPARE Statement
Table 77. COMPARE DATA Statement (continued) Column Notes: v If you code an L in column 3, the value in columns 5 through 8 is converted to binary and compared against the LL field of the returned segment. If you leave column 3 blank and the segment is not in a path call, then the value in columns 5 through 8 is used as the length of the comparison. v If you code column 4 with a V, P, or M, you must enter a value in columns 5 through 8. v If this is a path call comparison, code a P in column 4. The value in columns 5 through 8 must be the exact length of the fixed segment used in the path call. v If you specify the length of the segment, this length is used in the COMPARE and in the display. If you do not specify a length, DFSDDLT0 uses the shorter value for the length of the comparison and display of: The length of data supplied in the I/O area by IMS The number of DATA statements read times 56 Function Code Description
Note for COMPARE AIB Statement: To execute the same COMPARE AIB after a series of calls, put an H in column 2. When you specify an H, the COMPARE statement executes after each call. The H COMPARE statement is particularly useful when comparing with the same status code on repeated calls. The H COMPARE statement stays in effect until another COMPARE AIB statement is read.
323
COMPARE Statement
nn
'nn' is the segment level for COMPARE PCB. A leading zero is required.
Allow blank status code only. Allow specified status code only. Do not check status code. blank, GA, GC, or GK allowed.
nnnn
'nnnn' is length of the feedback key. Concatenated key feedback for DB PCB compare. User identification for TP PCB.
324
COMPARE Statement
Table 79. COMPARE PCB Statement (continued) Column 72 Function Continuation column x 73-80 Note: 1. SNAP is a Product-sensitive programming interface. Sequence indication nnnnnnnn Code Description If blank, key feedback is not continued. If not blank, key feedback is continued, starting in columns 16-71 of subsequent statements. For SYSIN2 statement override.
Blank fields are not compared to the corresponding field in the PCB, except for the status code field. (Blanks represent a valid status code.) To accept the status codes blank, GA, GC, or GK as a group, put OK in columns 8 and 9. To stop comparisons of status codes, put XX in columns 8 and 9. To execute the same compare after a series of calls, put an H in column 2. This executes the COMPARE statement after each call. This is particularly useful to compare to a blank status code only when loading a database. The H COMPARE statement stays in effect until another COMPARE PCB statement is read.
COMPARE PCB Statement for SSA Level, Status Code, Segment Name, Concatenated Key Length, and Concatenated Key: The COMPARE PCB statement is a request to compare the SSA level, a status code of OK (which includes blank, GA, GC, and GK), segment name of SEGA, concatenated key length of 0004, and a concatenated key of A100.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU E 01 OK SEGA 0004A100
COMPARE PCB Statement for SSA Level, Status Code, Segment Name, Concatenated Key Length, and Concatenated Key: The COMPARE PCB statement causes the job step to terminate based on the 8 in column 3 when any of the fields in the COMPARE PCB statement are not equal to the corresponding field in the PCB.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU 10105100 E 8 01 OK SEGK 0004A100 10105200
COMPARE PCB Statement for Status Code with Hold Compare: The COMPARE PCB statement is a request to compare the status code of OK (which includes blank, GA, GC, and GK) and hold that compare until the next COMPARE PCB statement. The compare of OK is used on GN following GU and is also used on a GN that has a request to be repeated six times.
325
COMPARE Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU SEGA (KEYA = A300) 20201100 L GN 20201300 EH OK 20201400 L 0006 GN 20201500
COMPARE DATA Statement for Fixed-Length Segment: The COMPARE DATA statement is a request to compare the data returned. 72 bytes of data are compared.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU E DATA A100A100A100A100A100A100A100A100A100A100A100A100A100A100X10102200 E A100A100A100A100 10102300
COMPARE DATA Statement for Fixed-Length Data for 64 Bytes: The COMPARE DATA statement is a request to compare 64 bytes of the data against the data returned.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU 10101600 E 0064 DATA A100A100A100A100A100A100A100A100A100A100A100A100A100A100X10101700 E A100A100B111B111 10101800
COMPARE DATA Statement for Fixed-Length Data for 72 Bytes: The COMPARE DATA statement is a request to compare 72 bytes of the data against the data returned.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L GU 10103900 E LP0072 DATA A100A100A100A100A100A100A100A100A100A100A100A100A100A100X10104000 E A100A100A100A100 10104100
COMPARE DATA Statement for Variable-Length Data of Multiple-Segments Data and Length Fields: The COMPARE DATA statement is a request to compare 36 bytes of the data against the data returned for segment 1 and 16 bytes of data for segment 2. It compares the length fields of both segments.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT D (DSS = DSS01) X38005500 L DJ (DJSS = DJSS01) X38005600 L QAJAXQAJ 38005700 L V0036 DATA QSS02QASS02QAJSS01QAJASS97*IQAJA** *38005800 L M0016 DATA QAJSS01*IQAJ** 38005850 L GHU D (DSS = DSS01) X38006000 DJ (DJSS = DJSS01) X38006100 QAJAXQAJ (QAJASS = QAJASS97) 38006200 E LV0036 DATA QSS02QASS02QAJSS01QAJASS97*IQAJA** *38006300 E LM0016 DATA QAJSS01*2QAJ** 38006350
COMPARE DATA Statement for Variable-Length Data of Multiple Segments with no Length Field COMPARE: The COMPARE DATA statement is a request to compare 36 bytes of the data against the data returned for segment 1 and 16 bytes of data for segment 2 with no length field compares of either segment.
326
COMPARE Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT D (DSS = DSS01) X38005500 L DJ (DJSS = DJSS01) X38005600 L QAJAXQAJ 38005700 L V0036 DATA QSS02QASS02QAJSS01QAJASS97*IQAJA** *38005800 L M0016 DATA QAJSS01*IQAJ** 38005850 L GHU D (DSS = DSS01) X38006000 DJ (DJSS = DJSS01) X38006100 QAJAXQAJ (QAJASS = QAJASS97) 38006200 E V0036 DATA QSS02QASS02QAJSS01QAJASS97*IQAJA** *38006300 M0016 DATA QAJSS01*2QAJ** 38006350
COMPARE DATA Statement for Variable-Length Data of Multiple Segments and One Length Field COMPARE: The COMPARE DATA statement is a request to compare 36 bytes of the data against the data returned for segment 1 and 16 bytes of data for segment 2. It compares the length field of segment 1 only.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< L ISRT D (DSS = DSS01) X38005500 L DJ (DJSS = DJSS01) X38005600 L QAJAXQAJ 38005700 L V0036 DATA QSS02QASS02QAJSS01QAJASS97*IQAJA** *38005800 L M0016 DATA QAJSS01*IQAJ** 38005850 L GHU D (DSS = DSS01) X38006000 DJ (DJSS = DJSS01) X38006100 QAJAXQAJ (QAJASS = QAJASS97) 38006200 E LV0036 DATA QSS02QASS02QAJSS01QAJASS97*IQAJA** *38006300 M0016 DATA QAJSS01*2QAJ** 38006350
IGNORE Statement
DFSDDLT0 ignores any statement with an N or a period (.) in column 1. You can use the N or . (period) to comment out a statement in either the SYSIN or SYSIN2 input streams. Using N or . (period) in a SYSIN2 input stream causes the SYSIN input stream to be ignored as well. See SYSIN2 DD Statement on page 336 for information on how to override SYSIN input. Table 80 gives the format of the IGNORE statement. An example of the statement follows.
Table 80. IGNORE Statement Column 1 2-72 73-80 Function Identifies control statement Ignored Sequence indication nnnnnnnn For SYSIN2 statement override. Code N or . Description IGNORE statement.
OPTION Statement
Use the OPTION statement to override various default options. Use multiple OPTION statements if you cannot fit all the options you want in one statement. No continuation character is necessary. Once you set an option, it remains in effect until you specify another OPTION statement to change the first parameter. Table 81 on page 328 shows the format of the OPTION statement. An example follows.
Chapter 14. DL/I Test Program (DFSDDLT0)
327
OPTION Statement
Table 81. OPTION Statement Column 1 2 3-72 Function Identifies control statement Reserved Keyword parameters: ABORT= v 0 v 1 to 9999 LINECNT= SNAP1 10 to 99 x v Turns the ABORT parameter off. v Number of unequal compares before aborting job. Initial default is 5. Number of lines printed per page. Must be filled with zeros. Initial default 54. SNAP option default, when results of compare are unequal. To turn the SNAP option off, code 'SNAP='. See COMPARE PCB Statement on page 324 for the appropriate values for this parameter. (Initial default is 5 if this option is not coded. This causes the I/O buffer pool and the DL/I blocks to be dumped with a SNAP call.) Produce/do not produce dump if job abends. Default is NODUMP. v H v C v Hexadecimal representation for lower case characters. This is the initial default. v Character representation for lower case characters. STATCD/NOSTATCD Issue/do not issue an error message for the internal, end-of-job stat call that does not receive a blank or GA status code. NOSTATCD is the default. Issue/do not issue a DFSDDLT0 ABENDU0249 when an invalid status code is returned for any of the internal end-of-job stat calls in a batch environment. NOABU249 is the default. nnnnnnnn For SYSIN2 statement override. Code O Description OPTION statement (free-form parameter fields).
DUMP/NODUMP LCASE=
ABU249/NOABU249
73 - 80 Note:
Sequence indication
328
PUNCH Statement
Table 82. PUNCH CTL Statement Column 1-3 4-9 10-13 Function Identifies control statement Reserved Punch control PUNC NPUN 14-15 16-72 Reserved Keyword parameters: OTHER Reproduces all input control statements except: v CTL (PUNCH) statements. v N or . (IGNORE) statements. v COMPARE statements. v CALL statements with functions of SKIP and START. Any control statements that appear between SKIP and START CALLs are not punched. (See SKIP/START (skipping) Control Statements on page 319). v CALL statements with functions of STAK and END. Control statements that appear between STAK and END CALLS are saved and then punched the number of times indicated in the STAK CALL. (See STAK/END (stacking) Control Statements on page 319). DATAL Create a full data COMPARE using all of the data returned to the I/O area. Multiple COMPARE statements and continuations are produced as needed. Create a single data COMPARE statement using only the first 56 bytes of data returned to the I/O area. Create a full PCB COMPARE using the complete key feedback area returned in the PCB. Multiple COMPARE statements and continuations are produced as needed. Begin punching (no default values). Stop punching (default value). Code CTL Description PUNCH statement.
DATAS
PCBL
329
PUNCH Statement
Table 82. PUNCH CTL Statement (continued) Column Function PCBS Code Description Create a single PCB COMPARE statement using only the first 48 bytes of the key feedback area returned in the PCB. If a GB status code is returned on a Fast Path call while in STAK, but prior to exiting STAK, this function issues or does not issue SYNC. 00000001 to 99999999. This is the starting sequence number to be used for the punched statements. Eight numeric bytes must be coded. INCR= 1 to 9999. Increment the sequence number of each punched statement by this value. Leading zeros are not required. AIB 73-80 Sequence indication nnnnnnnn Create an AIB COMPARE statement. For SYSIN2 statement override.
SYNC/NOSYNC
START=
To change the punch control options while processing a single DFSDDLT0 input stream, always use PUNCH CTL statements in pairs of PUNC and NPUN. One way to use the PUNCH CTL statement is as follows: 1. Code only the CALL statements for a new test. Do not code the COMPARE statements. 2. Verify that each call was executed correctly. 3. Make another run using the PUNCH CTL statement to have DFSDDLT0 merge the proper COMPARE statements and produce a new output data set that can be used as input for subsequent regression tests. You can also use PUNCH CTL if segments in an existing database are changed. The control statement causes DFSDDLT0 to produce a new test data set that has the correct COMPARE statements rather than you having to manually change the COMPARE statements. Parameters in the CTL statement must be the same length as described in Table 82, and they must be separated by commas.
330
PUNCH Statement
The DD statement for the output data set is labeled PUNCHDD. The data sets are fixed block with LRECL=80. Block size as specified on the DD statement is used. If not specified, the block size is set to 80. If the program is unable to open PUNCHDD, DFSDDLT0 issues abend 251.
STATUS Statement
With the STATUS statement, you establish print options and name the PCB that you want subsequent calls to be issued against. Table 83 shows the format of the STATUS statement.
Table 83. STATUS Statement Column 1 2 Function Identifies control statement Output device option 1 A 3 Print comment option 1 2 4 Print AIB option 1 2 5 Print call option 1 2 6 7 Reserved Print compare option 1 2 8 9 Reserved Print PCB option 1 2 Do not print. Print for each call. Print only if compare done and unequal. Do not print. Print for each call. Print only if compare done and unequal. Code S Description STATUS statement. Use PRINTDD when in a DL/I region; use I/O PCB in MPP region. Use PRINTDD in MPP region if DD statement is provided; otherwise, use I/O PCB. Same as if 1, and disregard all other fields in this STATUS statement. Do not print. Print for each call. Print only if compare done and unequal. Do not print. Print for each call. Print only if compare done and unequal. Do not print. Print for each call. Print only if compare done and unequal.
331
STATUS Statement
Table 83. STATUS Statement (continued) Column 10 11 Function Reserved Print segment option 1 2 12 Set task and real time 1 2 13-14 15 Reserved PCB selection option 1 2 3 4 5 PCB name passed in columns 16-23 (use option 1). DBD name passed in columns 16-23 (use option 2). Relative DB PCB passed in columns 16-23 (use option 3). Relative PCB passed in columns 16-23 (use option 4). $LISTALL passed in columns 16-23 (use option 5). If column 15 is blank, DFSDDLT0 selects options 2 through 5 based on content of columns 16-23. Opt. 1 16-23 PCB selection PCB name alpha These columns must contain the name of the label on the PCB at PSBGEN, or the name specified on the PCBNAME= operand for the PCB at PSBGEN time. The default PCB is the first database PCB in the PSB. If columns 16-23 are blank, current PCB is used. If DBD name is specified, this must be the name of a database DBD in the PSB. When columns 16 through 18 are blank, columns (19-23) of this field are interpreted as the relative number of the DB PCB in the PSB. This number must be right-justified to column 23, but need not contain leading zeros. When columns 16 through 18 = 'TP ', columns (19-23) of this field are interpreted as the relative number of the PCB from the start of the PCB list. This number must be right-justified to column 23, but need not contain leading zeros. I/O PCB is always the first PCB in the PCB list in this program. Prints out all PCBs in the PSB for test script. Use print options to print this STATUS statement. 1 Do not use print options in this statement; print this STATUS statement. Do not print. Print for each call. Print only if compare done and unequal. Do not time Time each call. Time each call if compare done and unequal. Code Description
Opt. 2 16-23
alpha
numeric
TP numeric
Opt. 5 16-23 24
$LISTALL
332
STATUS Statement
Table 83. STATUS Statement (continued) Column Function Code 2 3 25-28 PCB processing option xxxx Description Do not print this STATUS statement but use print options in this statement. Do not print this STATUS statement and do not use print options in this statement. This is optional and is only used when two PCBs have the same name but different processing options. If not blank, it is used in addition to the PCB name in columns 16 through 23 to select which PCB in the PSB to use.
29 30-32
Reserved AIB interface AIB Indicates that the AIB interface is used and the AIB is passed rather than passing the PCB. (Passing the PCB is the default.) Note: When the AIB interface is used, the PCB must be defined at PSBGEN with PCBNAME=name. IOPCB is the PCB name used for all I/O PCBs. DFSDDLT0 recognizes that name when column 15 contains a 1 and columns 16 through 23 contain IOPCB.
33 37-72 73-80
If DFSDDLT0 does not encounter a STATUS statement, all default print options (columns 3 through 12) are 2 and the default output device option (column 2) is 1. You can code a STATUS statement before any call sequence in the input stream, changing either the PCB to be referenced or the print options. The referenced PCB stays in effect until a subsequent STATUS statement selects another PCB. However, a call that must be issued against an I/O PCB (such as LOG) uses the I/O PCB for that call. After the call, the PCB changes back to the original PCB.
To Print Each CALL Statement, Select a PCB: The following STATUS statements tell DFSDDLT0 to print the COMMENTS, CALL, COMPARE, PCB, and SEGMENT DATA options for all calls, and select a PCB. The 1 in column 15 is required for PCBNAME. If omitted, the PCBNAME is treated as a DBDNAME.
333
STATUS Statement
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< S 1 1 1 1 1 1PCBNAME |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< S 1 1 1 1 1 1PCBNAME AIB
To print each CALL statement, select PCB based on a DBD name: The following STATUS statements tell DFSDDLT0 to print the COMMENTS, CALL, COMPARE, PCB, and SEGMENT DATA options for all calls, and select a PCB by a DBD name. The 2 in column 15 is optional.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< S 1 1 1 1 1 2DBDNAME |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< S 1 1 1 1 1 2DBDNAME AIB
If you do not use the AIB interface, you do not need to change STATUS statement input to existing streams; existing call functions will work just as they have in the past. However, if you want to use the AIB interface, you must change the STATUS statement input to existing streams to include AIB in columns 30 through 32. The existing DBD name, Relative DB PCB, and Relative PCB will work if columns 30 through 32 contain AIB and the PCB has been defined at PSBGEN with PCBNAME=name.
WTO Statement
The WTO (Write to Operator) statement sends a message to the z/OS console without waiting for a reply. Table 84 shows the format for the WTO statement.
Table 84. WTO Statement Column 1-3 4 5-72 73-80 Function Identifies control statement Reserved Message to send Sequence indication nnnnnnnn Message to be written to the system console. For SYSIN2 statement override. Code WTO Description WTO statement.
334
WTOR Statement
WTOR Statement
The WTOR (Write to Operator with Reply) statement sends a message to the z/OS system console and waits for a reply. Table 85 shows the format of the WTOR statement.
Table 85. WTOR Statement Column 1-4 5 6-72 73-80 Function Identifies control statement Reserved Message to send Sequence indication nnnnnnnn Message to be written to the system console. For SYSIN2 statement override. Code WTOR Description WTOR statement.
JCL Requirements
This section defines the DD statements that DFSDDLT0 uses. Execution JCL depends on the installation data set naming standards as well as the IMS environment (batch or online). See Figure 54.
//SAMPLE JOB ACCOUNTING,NAME,MSGLEVEL=(1,1),MSGCLASS=3,PRTY=8 33001100 //GET EXEC PGM=DFSRRC00,PARM=DLI,DFSDDLT0,PSBNAME 33001200 //STEPLIB DD DSN=IMS.SDFSRESL,DISP=SHR 33001300 //IMS DD DSN=IMS2.PSBLIB,DISP=(SHR,PASS) 33001400 // DD DSN=IMS2.DBDLIB,DISP=(SHR,PASS) 33001500 //DDCARD DD DSN=DATASET,DISP=(OLD,KEEP) 33001600 //IEFRDER DD DUMMY 33001700 //PRINTDD DD SYSOUT=A 33001800 //SYSUDUMP DD SYSOUT=A 33001900 //SYSIN DD * 33002000 |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< U THIS IS PART OF AN EXAMPLE 33002100 S 1 1 1 1 1 PCB-NAME 33002200 L GU 33002300 /* //SYSIN2 DD * |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< ABEND 33002300 /* Figure 54. Example JCL Code for DD Statement Definition
Figure 55 on page 336 is an example of coding JCL for DFSDDLT0 in a BMP. Use of a procedure is optional and is only shown here as an example.
335
JCL Requirements
//SAMPLE JOB ACCOUNTING,NAME,MSGLEVEL=(1,1),MSGCLASS=A 00010047 //************************************************************* //* BATCH DL/I JOB TO RUN FOR RSR TESTING * //************************************************************* //BMP EXEC IMSBATCH,MBR=DFSDDLT0,PSB=PSBNAME //BMP.PRINTDD DD SYSOUT=A //BMP.PUNCHDD DD SYSOUT=B //BMP.SYSIN DD * U ***THIS IS PART OF AN EXAMPLE OF SYSIN DATA 00010000 S 1 1 1 1 1 1 00030000 L GU 00040000 L 0099 GN 00050000 /* |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< //BMP.SYSIN2 DD * U ***THIS IS PART OF AN EXAMPLE OF SYSIN2 DATA ******************* 00020000 ABEND 00050000 /* Figure 55. Example JCL Code for DFSDDLT0 in a BMP
SYSIN DD Statement
The data set specified by the SYSIN DD statement is the normal input data set for DFSDDLT0. When processing input data that is on direct-access or tape, you may want to override certain control statements in the SYSIN input stream or to add other control statements to it. You do this with a SYSIN2 DD statement and the control statement sequence numbers. Sequence numbers in columns 73 to 80 for SYSIN data are optional unless a SYSIN2 override is used. If a SYSIN2 override is used, follow the directions for using sequence numbers as described in SYSIN2 DD Statement.
SYSIN2 DD Statement
DFSDDLT0 does not require the SYSIN2 DD statement, but if it is present in the JCL, DFSDDLT0 will read and process the specified data sets. When using SYSIN2: v The SYSIN DD data set is the primary input. DFSDDLT0 attempts to insert the SYSIN2 control statements into the SYSIN DD data set. v You must code the control groups and sequence numbers properly in columns 73 to 80 or the merging process will not work. v Columns 73 and 74 indicate the control group of the statement. v Columns 75 to 80 indicate the sequence number of the statement. v Sequence numbers must be in numeric order within their control group. v Control groups in SYSIN2 must match the SYSIN control groups, although SYSIN2 does not have to use all the control groups used in SYSIN. DFSDDLT0 does not require that control groups be in numerical order, but the control groups in SYSIN2 must be in the same order as those in SYSIN. v When DFSDDLT0 matches a control group in SYSIN and SYSIN2, it processes the statements by sequence number. SYSIN2 statements falling before or after a SYSIN statement are merged accordingly. v If the sequence number of a SYSIN2 statement matches the sequence number of a SYSIN statement in its control group, the SYSIN2 overrides the SYSIN. v If the program reaches the end of SYSIN before it reaches the end of SYSIN2, it processes the records of SYSIN2 as if they were an extension of SYSIN.
336
JCL Requirements
v Replacement or merging occurs only during the current run. The original SYSIN data is not changed. v During merge, if one of the control statements contains blanks in columns 73 through 80, DFSDDLT0 discards the statement containing blanks, sends a message to PRINTDD, and continues the merge until end-of-file is reached.
PRINTDD DD Statement
The PRINTDD DD statement defines output data set for DFSDDLT0, including displays of control blocks using the SNAP call. It must conform to the z/OS SNAP data set requirements.
PUNCHDD DD Statement
The DD statement for the output data set is labeled PUNCHDD. The data sets are fixed block with LRECL=80. Block size as specified on the DD statement is used; if not specified, the block size is set to 80. If the program is unable to open PUNCHDD, DFSDDLT0 issues abend 251. Here is an example of the PUNCHDD DD statement.
//PUNCHDD DD SYSOUT=B
337
JCL Requirements
L ISRT 01000160 L Z0080 DATA -SYNC INTERVAL 1 SEG 2 -END EOM 1 X01000170 L P DATA 11111111111111111111111111111111111111111111111 01000180 U********************************************************************** 01000190 U* ENDING FIRST SYNC INTERVAL 01000200 U********************************************************************** 01000210 L GU 01000220 E QC 01000230 L GU 01000240 E OK 01000250 S11 1 1 1 1 DBPCBXXX 01000260 WTO GETTING DATA BASE SEGMENT 1 FROM DBPCBXXX 01000270 L U GHU 01000280 E DATA INIT-LOAD UOW. 1 A.P. 1 01000290 E OK 01000300 L U0003 GN 01000310 E OK 01000320 S11 1 1 1 1 TP 1 01000330 L ISRT 01000340 L Z0080 DATA -SYNC INTERVAL 2 SEG 1 -MESSAGE 1 X01000350 L P DATA 22222222222222222222222222222222222222222222211 01000360 L ISRT 01000370 L Z0080 DATA -SYNC INTERVAL 2 SEG 2 -END EOM 1 X01000380 L P DATA 22222222222222222222222222222222222222222222211 01000390 U********************************************************************** 01000400 U* ENDING SECOND SYNC INTERVAL 01000410 U********************************************************************** 01000420 L GU 01000430 E QC 01000440 L GU 01000450 E OK 01000460 S11 1 1 1 1 DBPCBXXX 01000470 S11 1 1 1 1 TP 1 01000480 L ISRT 01000490 L Z0080 DATA -SYNC INTERVAL 3 SEG 1 -MESSAGE 1 X01000500 L P DATA 33333333333333333333333333333333333333333333311 01000510 L ISRT 01000520 L Z0080 DATA -SYNC INTERVAL 3 SEG 2 -END EOM 1 X01000530 L P DATA 33333333333333333333333333333333333333333333311 01000580 U********************************************************************** 01000590 U* ENDING THIRD SYNC INTERVAL 01000600 U********************************************************************** 01000610 L GU 01000620 E QC 01000630 //MPP.SYSIN2 DD * |---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----< ABEND 01000430 /*
Notes for the SYSIN/SYSIN2 and PREINIT examples: 1. The PREINIT= parameter coded in the EXEC statement invokes the restart process. 2. When DFSDDLT0 starts processing, it substitutes the SYSIN2 ABEND statement for the statement in SYSIN with the same sequence number. (It is the GU call with sequence number 01000430.) 3. DFSDDLT0 begins with statement 01000000 and processes until it encounters the ABEND statement (statement number 01000430). The GU calls to the I/O PCB have already been tracked in the checkpoint field (statements 01000060, 01000220, and 01000240). 4. When DFSDDLT0 is rescheduled, it examines the checkpoint field and finds 01000240. DFSDDLT0 begins processing at the next GU call to the I/O PCB, statement 01000450.
338
JCL Requirements
If the statement currently numbered 01000240 did not have a sequence number, DFSDDLT0 would restart from statement 01000000 when it was rescheduled.
DFSDDLT0 Hints
This section describes loading a database, printing, retrieving, replacing, and deleting segments, regression testing, using a debugging aid, and verifying how a call is executed.
Chapter 14. DL/I Test Program (DFSDDLT0)
339
DFSDDLT0 Hints
Load a Database
Use DFSDDLT0 for loading only very small databases because you must to provide all the calls and data rather than have them generated. The following example shows CALL FUNCTION and CALL DATA statements that are used to load a database.
|---+----1----+----2----+----3----+----4----+----5----+----6----+----7---+-----< O SNAP= ,ABORT=0 S 1 2 2 1 1 L ISRT COURSE L DATA FRENCH L ISRT COURSE L DATA COBOL L ISRT CLASS L DATA 12 L ISRT CLASS L DATA 27 L ISRT STUDENT L DATA SMITH THERESE L ISRT STUDENT L DATA GRABOWSKY MARION
Both examples request the GN to be repeated 9999 times. Note that the first example uses a COMPARE PCB of EH8 while the second uses a COMPARE PCB of EH. The difference between these two examples is that the first halts the job step the first time the status code is not blank, GA, GC, or GK. The second example halts repeating the GN and goes on to process any remaining DFSDDLT0 control statements when a GB status code is returned or the GN has been repeated 9999 times.
340
DFSDDLT0 Hints
|----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8---S 1 1 1 1 1 COURSEDB L GHU COURSE (TYPE =FRENCH) X CLASS (WEEK =27) X STUDENT (NAME =SMITH) L REPL L DATA SMITH THERESE
Delete a Segment
Use the following sequence of control statements to delete a segment.
|----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8---S 1 1 1 1 1 4 L GHU COURSE (TYPE =FRENCH) X CLASS *L X INSTRUC (NUMBER =444) L DLET
Do Regression Testing
DFSDDLT0 is ideal for doing regression testing. By using a known database, DFSDDLT0 can issue calls and then compare the results of the call to expected results using COMPARE statements. The program then can determine if DL/I calls are executed correctly. If you code all the print options as 2's (print only if comparisons done and unequal), only the calls not properly satisfied are displayed.
341
DFSDDLT0 Hints
342
| |
343
344
Related Reading: For more information on addressing environments, see IBM TSO Extensions for MVS/REXX Reference.
This example uses a GPSB, but you could use any PSB that you have defined. The GPSB provides a generic PSB that has an TP PCB and a modifiable alternate PCB. It does not have any database PCBs. The language type of ASSEM is specified because no specific language type exists for a REXX application. Recommendation: For a REXX application, specify either assembler language or COBOL. IMS schedules transactions using a load module name that is the same as the PSB name being used for MPP regions or the PGM name for other region types. You must use this load module even though your application program consists of the REXX EXEC. The IMS adapter for REXX provides a load module for you to use. This module is called DFSREXX0. You can: v Copy to a steplib data set with the same name as the application PSB name. Use either a standard utility intended for copying load modules (such as IEBCOPY or SAS), or the Linkage Editor. v Use the Linkage Editor to define an alias for DFSREXX0 that is the same as the application PGM name. | | Example: Figure 56 shows a section from the PGM setup job that uses the binder to perform the copy function to the name IVPREXX. The example uses the IVP.
//* REXXTDLI SAMPLE - GENERIC APPLICATION DRIVER //* //LINK EXEC PGM=IEWL, // PARM=XREF,LIST,LET,SIZE=(192K,64K) //SYSPRINT DD SYSOUT=* //SDFSRESL DD DISP=SHR,DSN=IMS.SDFSRESL //SYSLMOD DD DISP=SHR,DSN=IMS1.PGMLIB //SYSUT1 DD UNIT=(SYSALLDA,SEP=(SYSLMOD,SYSLIN)), // DISP=(,DELETE,DELETE),SPACE=(CYL,(1,1)) //SYSLIN DD * INCLUDE SDFSRESL(DFSREXX0) ENTRY DFSREXX0 NAME IVPREXX(R) /* Figure 56. Using the Binder to Copy the Name IVPREXX
345
346
IVPREXX Example 1
Entry:
IVPREXX execname
or
IVPREXX execname arguments
Response:
347
IVPREXX Example 2
Entry:
IVPREXX LEAVE
Response:
Transaction IVPREXX leaving dependent region.
IVPREXX Example 3
Entry:
IVPREXX HELLOHELLO
Response:
One-to-eight character EXEC name must be specified.
IVPREXX Example 4
Entry:
IVPREXX
or
IVPREXX ?
Response:
TRANCODE TRANCODE TRANCODE TRANCODE EXECNAME <Arguments> LEAVE TRACE level ROLL Run specified EXEC Leave Dependent Region 0=None,1=Some,2=More,3=Full Issue ROLL call
When an EXEC name is supplied, all of the segments it inserts to the I/O PCB are returned before the completion message is returned. REXX return codes (RC) in the range of 20000 to 20999 are usually syntax or other REXX errors, and you should check the z/OS system console or region output for more details. Related Reading: For more information on REXX errors and messages, see IBM TSO Extensions for MVS/REXX Reference. Stopping an Infinite Loop: To stop an EXEC that is in an infinite loop, you can enter either of the following IMS commands from the master terminal or system console:
/STO REGION p1 ABDUMP p2 /STO REGION p1 CANCEL
In these examples, p1 is the region number and p2 is the TRANCODE that the EXEC is running under. Use the /DISPLAY ACTIVE command to find the region number. This technique is not specific to REXX EXECs and can be used on any transaction that is caught in an infinite loop. Related Reading: For more information about these commands and others to help in this situation, see IMS Version 9: Command Reference.
348
REXXTDLI Commands
REXXTDLI Commands
| | | | | This section contains REXX commands and describes how they apply to DL/I calls. The terms command and call can be used interchangeably when explaining the REXXTDLI environment. However, the term command is used exclusively when explaining the REXXIMS environment. For consistency, call is used when explaining DL/I, and command is used when explaining REXX. To issue commands in the IMS adapter for REXX environment, you must first address the correct environment. Two addressable environments are provided with the IMS adapter for REXX. The environments are as follows: REXXTDLI Used for standard DL/I calls, for example GU and ISRT. The REXXTDLI interface environment is used for all standard DL/I calls and cannot be used with REXX-specific commands. All commands issued to this environment are considered to be standard DL/I calls and are processed appropriately. A GU call for this environment could look like this:
Address REXXTDLI "GU MYPCB DataSeg"
REXXIMS
Used to access REXX-specific commands (for example, WTO and MAPDEF) in the IMS adapter for REXX environment. The REXXIMS interface environment is used for both DL/I calls and REXX-specific commands. When a command is issued to this environment, IMS checks to see if it is REXX-specific. If the command is not REXX-specific, IMS checks to see if it is a standard DL/I call. The command is processed appropriately. The REXX-specific commands, also called extended commands, are REXX extensions added by the IMS adapter for the REXX interface. A WTO call for this environment could look like this:
Address REXXIMS "WTO Message"
On entry to the scheduled EXEC, the default environment is z/OS. Consequently, you must either use ADDRESS REXXTDLI or ADDRESS REXXIMS to issue the IMS adapter for REXX calls. Related Reading: For general information on addressing environments, see IBM TSO Extensions for MVS/REXX Reference.
REXXTDLI Calls
dlicall parm1 parm2 ...
The format of a DL/I call varies depending on call type. The parameter formats for supported DL/I calls can be found in Chapter 11, DL/I Calls for Database Management, on page 219 and Chapter 12, DL/I Calls for System Services, on page 249. The parameters for the calls are case-independent, separated by one or more blanks, and are generally REXX variables. See Parameter Handling on page 350 for detailed descriptions.
Return Codes
If you use the AIBTDLI interface, the REXX RC variable is set to the return code from the AIB on the DL/I call.
Chapter 15. Adapter for REXX
349
REXXTDLI Commands
If you do not use the AIBTDLI interface, a simulated return code is returned. This simulated return code is set to zero if the PCB status code was GA, GK, or bb . If the status code had any other value, the simulated return code is X'900' or decimal 2304.
Parameter Handling
The IMS adapter for REXX performs some parameter setup for application programs in a REXX environment. This setup occurs when the application program uses variables or maps as the parameters. When the application uses storage tokens, REXX does not perform this setup. The application program must provide the token and parse the results just as a non-REXX application would. For a list of parameter types and definitions, see Table 86 on page 351. The REXXTDLI interface performs the following setup: v The I/O area retrieval for the I/O PCB is parsed. The LL field is removed, and the ZZ field is removed and made available by means of the REXXIMS(ZZ) function call. The rest of the data is placed in the specified variable or map. Use the REXX LENGTH() function to find the length of the returned data. v The I/O area building for the TP PCB or alternate PCB is done as follows: The appropriate LL field. The ZZ field from a preceding SET ZZ command or X'0000' if the command was not used. The data specified in the passed variable or map. v The I/O area processing for the SPA is similar to the first two items, except that the ZZ field is 4 bytes long. v The feedback area on the CHNG and SETO calls is parsed. The LLZZLL fields are removed, and the remaining data is returned with the appropriate length. v The parameters that have the LLZZ as part of their format receive special treatment. These parameters occur on the AUTH, CHNG, INIT, ROLS, SETO, and SETS calls. The LLZZ fields are removed when IMS returns data to you and added (ZZ is always X'0000') when IMS retrieves data from you. In effect, your application ignores the LLZZ field and works only with the data following it. v The numeric parameters on XRST and symbolic CHKP are converted between decimal and a 32-bit number (fullword) as required.
350
REXXTDLI Commands
Table 86. IMS Adapter for REXX Parameter Types and Definitions Type1 PCB Parameter Definition PCB Identifier specified as a variable containing one of the following: v PCB name as defined in the PSB generation on the PCBNAME= parameter. See IMS Version 9: Utilities Reference: System for more information on defining PCB names. The name can be from 1 to 8 characters long and does not have to be padded with blanks. If this name is given, the AIBTDLI interface is used, and the return codes and reason codes are acquired from that interface. v An AIB block formatted to DFSAIB specifications. This variable is returned with an updated AIB. v A # followed by PCB offset number (#1=first PCB). Example settings are: IOPCB=:"#1" ALTPCB=:"#2" DBPCB=:"#3" The IOAREA length returned by a database DL/I call defaults to 4096 if this notation is used. The correct length is available only when the AIBTDLI interface is used. In SSA Input variable. It can be specified as a constant, variable, *mapname2, or !token3. Input variable with an SSA (segment search argument). It can be specified as a constant, variable, *mapname2, or !token3. Output variable to store a result after a successful command. It can be specified as a variable, *mapname2, or !token3. Variable that contains input on entry and contains a result after a successful command. It can be specified as a variable, *mapname2, or !token3. Input constant. This command argument must be the actual value, not a variable containing the value.
Out
In/Out
Const Note:
1. The parameter types listed in Table 86 correspond to the types shown in Table 46 on page 220 and Table 50 on page 250, as well as to those shown in Table 87 on page 353. All parameters specified on DL/I calls are case independent except for the values associated with the STEM portion of the compound variable (REXX terminology for an array-like structure). A period (.) can be used in place of any parameter and is read as a NULL (zero length string) and written as a void (place holder). Using a period in place of a parameter is useful when you want to skip optional parameters. 2. For more information on *mapname, see MAPGET on page 357 and MAPPUT on page 358. 3. For more information on !token, see STORAGE on page 360.
351
REXXTDLI Commands
IO = "IOPCB" /* IMS Name for I/O PCB */ OutMsg="Hello World" Address REXXTDLI "ISRT IO OutMsg" If RC\=0 Then Exit 12
In this example, IO is a variable that contains the PCB name, which is the constant IOPCB for the I/O PCB. If a non-zero return code (RC) is received, the EXEC ends (Exit) with a return code of 12. You can do other processing here. The next example gets a part from the IMS sample parts database. The part number is "250239". The actual part keys have a "02" prefix and the key length defined in the DBD is 17 bytes. The following example puts the segment into the variable called Part_Segment.
PartNum DB SSA Address = "250239" = "DBPCB01" = PARTROOT(PARTKEY = ||Left(02||PartNum,17)||) REXXTDLI "GU DB Part_Segment SSA"
Notes: v In a real EXEC, you would probably find the value for PartNum from an argument and would have to check the return code after the call. v The LEFT function used here is a built-in REXX function. These built-in functions are available to any IMS REXX EXEC. For more information on functions, see IBM TSO Extensions for MVS/REXX Reference. v The single quote (') and double quote (") are interchangeable in REXX, as long as they are matched. The IMS.SDFSISRC library includes the DFSSUT04 EXEC. You can use this EXEC to process any unexpected return codes or status codes. To acquire the status code from the last DL/I call issued, you must execute the IMSQUERY('STATUS') function. It returns the two character status code. If you use an EXEC that runs in both IMS and non-IMS environments, check to see if the IMS environment is available. You can check to see if the IMS environment is available in two ways: v Use the z/OS SUBCOM command and specify either the REXXTDLI or REXXIMS environments. The code looks like this:
Address MVS SUBCOM REXXTDLI If RC=0 Then Say "IMS Environment is Available." Else Say "Sorry, no IMS Environment here."
v Use the PARSE SOURCE instruction of REXX to examine the address space name (the 8th word). If it is running in an IMS environment, the token will have the value IMS. The code looks like this:
Parse Source . . . . . . . Token . If Token=IMS Then Say "IMS Environment is Available." Else Say "Sorry, no IMS Environment here."
Environment Determination
352
Table 87. REXXIMS Extended Commands Command DLIINFO IMSRXTRC MAPDEF MAPGET MAPPUT SET SRRBACK SRRCMIT STORAGE WTO WTP WTL WTOR Note: 1. The parameter types listed correspond to the types shown in Table 86 on page 351. All parameters specified on DL/I calls are case-independent except for the values associated with the STEM portion of the compound variable (REXX terminology for an array-like structure). A period (.) can be used in place of any parameter and has the effect of a NULL (zero length string) if read and a void (place holder) if written. Use a period in place of a parameter to skip optional parameters.
DLIINFO
The DLIINFO call requests information from the last DL/I call or on a specific PCB. The following topics contain additional information: v Format on page 354 v Usage on page 354 v Example on page 354
353
Format
DLIINFO infoout pcbid
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The infoout variable name is a REXX variable that is assigned the DL/I information. The pcbid variable name, when specified as described in Parameter Handling on page 350, returns the addresses associated with the specified PCB and its last status code. The format of the returned information is as follows: Word 1 2 3 4 5 6 7 Description Last DL/I call ('.' if N/A) Last DL/I PCB name (name or #number, '.' if N/A) Last DL/I AIB address in hexadecimal (00000000 if N/A) Last DL/I PCB address in hexadecimal (00000000 if N/A) Last DL/I return code (0 if N/A) Last DL/I reason code (0 if N/A) Last DL/I call status ('.' if blank or N/A)
Example
Address REXXIMS DLIINFO MyInfo /* Get Info Parse Var MyInfo DLI_Cmd DLI_PCB DLI_AIB_Addr DLI_PCB_Addr, DLI_RC DLI_Reason DLI_Status . */
Always code a period after the status code (seventh word returned) when parsing to allow for transparent additions in the future if needed. Words 3, 4, and 7 can be used when a pcbid is specified on the DLIINFO call.
IMSRXTRC
The IMSRXTRC command is used primarily for debugging. It controls the tracing action taken (that is, how much trace output through SYSTSPRT is sent to the user) while running a REXX program. v Format v Usage on page 355 v Example on page 355
Format
IMSRXTRC level
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
354
Usage
The level variable name can be a REXX variable or a digit, and valid values are from 0 to 9. The initial value at EXEC start-up is 1 unless it is overridden by the user Exit. Traced output is sent to the DDNAME SYSTSPRT. See IMS Version 9: Customization Guide for more information on the IMS adapter for REXX exit routine. The IMSRXTRC command can be used in conjunction with or as a replacement for normal REXX tracing (TRACE). Level 0 1 2 3 4-7 8 Description Trace errors only. The previous level and trace DL/I calls, their return codes, and environment status (useful for flow analysis). All the previous levels and variable sets. All the previous levels and variable fetches (useful when diagnosing problems). All previous levels. All previous levels and parameter list to/from standard IMS language interface. See message DFS3179 in IMS Version 9: Messages and Codes, Volume 1. All previous levels.
Example
Address REXXIMS IMSRXTRC 3
MAPDEF
The MAPDEF command makes a request to define a data mapping.
Format
MAPDEF mapname A REPLACE
A:
: variable C V B P Z length * length .digit
startpos
length *
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
355
Usage
Data mapping is an enhancement added to the REXXIMS interface. Because REXX does not offer variable structures, parsing the fields from your database segments or MFS output maps can be time consuming, especially when data conversion is necessary. The MAPDEF, MAPGET, and MAPPUT commands allow simple extraction of most formatted data. v mapname is a 1- to 16-character case-independent name. v definition (A) is a variable containing the map definition. v REPLACE, if specified, indicates that a replacement of an existing map name is allowed. If not specified and the map name is already defined, an error occurs and message DFS3171E is sent to the SYSTPRT. The map definition has a format similar to data declarations in other languages, with simplifications for REXX. In this definition, you must declare all variables that you want to be parsed with their appropriate data types. The formiat is shown in A in the syntax diagram. Variable name: The variable name variable is a REXX variable used to contain the parsed information. Variable names are case-independent. If you use a STEM (REXX terminology for an array-like structure) variable, it is resolved at the time of use (at the explicit or implicit MAPGET or MAPPUT call time), and this can be very powerful. If you use an index type variable as the STEM portion of a compound variable, you can load many records into an array simply by changing the index variable. Map names or tokens cannot be substituted for variable names inside a map definition. Repositioning the internal cursor: A period (.) can be used as a variable place holder for repositioning the internal cursor position. In this case, the data type must be C, and the length can be negative, positive, or zero. Use positive values to skip over fields of no interest. Use negative lengths to redefine fields in the middle of a map without using absolute positioning. The data type values are: C V B Z P Character Variable Binary (numeric) Zoned Decimal (numeric) Packed Decimal (numeric)
All numeric data types can have a period and a number next to them. The number indicates the number of digits to the right of a decimal point when converting the number. Length value: The length value can be a number or an asterisk (*), which indicates that the rest of the buffer will be used. You can only specify the length value for data types C and V. Data type V maps a 2-byte length field preceding the data string, such that a when the declared length is 2, it takes 4 bytes. Valid lengths for data types are: C V 1 to 32767 bytes or * 1 to 32765 bytes or *
356
If a value other than asterisk (*) is given, the cursor position is moved by that value. The startpos value resets the parsing position to a fixed location. If startpos is omitted, the column to the right of the previous map variable definition (cursor position) is used. If it is the first variable definition, column 1 is used. Note: A length of asterisk (*) does not move the cursor position, so a variable declared after one with a length of asterisk (*) without specifying a start column overlays the same definition.
Example
This example defines a map named DBMAP, which is used implicitly on a GU call by placing an asterisk (*) in front of the map name.
DBMapDef = RECORD C * :, /* NAME C 10 :, /* PRICE Z.2 6 :, /* CODE C 2 :, /* . C 25 :, /* CATEGORY B 1 /* Address REXXIMS MAPDEF DBMAP DBMapDef Pick up entire record Cols 1-10 hold the name Cols 11-16 hold the price Cols 11-16 hold the code Skip 25 columns Col 42 holds category */ */ */ */ */ */
. . .
Address REXXTDLI GU DBPCB *DBMAP /* Read and decode a segment */ If RC\=0 Then Signal BadCall /* Check for failure */ Say CODE /* Can now access any Map Variable*/
The entire segment retrieved on the GU call is placed in RECORD. The first 10 characters are placed in NAME, and the next 6 are converted from zoned decimal to EBCDIC with two digits to the right of the decimal place and placed in PRICE. The next 2 characters are placed in CODE, the next 25 are skipped, and the next character is converted from binary to EBCDIC and placed in CATEGORY. The 25 characters that are skipped are present in the RECORD variable.
MAPGET
The MAPGET command is a request to parse or convert a buffer into a specified data mapping previously defined with the MAPDEF command.
Format
MAPGET mapname buffer
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The mapname variable name specifies the data mapping to use. It is a 1- to 16-character case-independent name. The buffer variable name is the REXX variable containing the data to parse.
Chapter 15. Adapter for REXX
357
Examples
This example uses explicit support.
Address REXXTDLI GU DBPCB SegVar If RC=0 Then Signal BadCall /* Check for failure */ Address REXXIMS MAPGET DBMAP SegVar/* Decode Segment */ Say VAR_CODE /*Can now access any Map Variable */
If an error occurs during a MAPGET, message DFS3172I is issued. An error could occur when a Map is defined that is larger than the input segment to be decoded or during a data conversion error from packed or zoned decimal format. The program continues, and an explicit MAPGET receives a return code 4. However, an implicit MAPGET (on a REXXTDLI call, for example) does not have its return code affected. Either way, the failing variable's value is dropped by REXX.
MAPPUT
This MAPPUT command makes a request to pack or concatenate variables from a specified Data Mapping, defined by the MAPDEF command, into a single variable.
Format
MAPPUT mapname buffer
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The mapname variable name specifies the data mapping to use, a 1- to 16-character case-independent name. The buffer variable name is the REXX variable that will contain the resulting value. Map names can also be specified in the REXXTDLI call in place of variable names to be fetched or read. This step is called an implicit MAPPUT and lets you avoid the explicit MAPPUT call. To indicate that a Map name is being passed in the DL/I call, precede the name with an asterisk (*), for example, ISRT IOPCB *OUTMAP. Note: If the data mapping is only partial and some fields in the record are not mapped to REXX variables, then the first field in the mapping should be a character type of length asterisk (*), as shown in the Example on page 357. This step is the only way to ensure that non-mapped (skipped) fields are not lost between the MAPGET and MAPPUT calls, whether they be explicit or implicit.
358
Examples
This example uses explicit support.
Address REXXTDLI GHU DBPCB SegVar SSA1 If RC\=0 Then Signal BadCall Address REXXIMS MAPGET DBMAP SegVar DBM_Total = DBM_Total + Deposit_Amount Address REXXIMS MAPPUT DBMAP SegVar REPL DBPCB SegVar If RC\=0 Then Signal BadCall /* /* /* /* /* /* /* Read segment Check for failure Decode Segment Adjust Mapped Variable Encode Segment Update Database Check for failure */ */ */ */ */ */ */
If an error occurs during a MAPPUT, such as a Map field defined larger than the variable's contents, then the field is truncated. If the variable's contents are shorter than the field, the variable is padded: Character (C) Character (V) Numeric (B,Z,P) Padded on right with blanks Padded on right with zeros Padded on the left with zeros
If a MAP variable does not exist when a MAPPUT is processed, the variable and its position are skipped. All undefined and skipped fields default to binary zeros. A null parameter is parsed normally. Conversion of non-numeric or null fields to numeric field results in a value of 0 being used and no error.
SET
The SET command resets AIB subfunction values and ZZ values before you issue a DL/I call.
Format
SET SUBFUNC variable ZZ variable
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The SET SUBFUNC command sets the AIB subfunction used on the next DL/I call. This value is used only if the next REXXTDLI call passes a PCB name. If the call does pass a PCB name, the IMS adapter for REXX places the subfunction name (1 to 8 characters or blank) in the AIB before the call is issued. This value initially defaults to blanks and is reset to blanks on completion of any REXXTDLI DL/I call. The SET ZZ command is used to set the ZZ value used on a subsequent DL/I call. This command is most commonly used in IMS conversational transactions and terminal dependent applications to set the ZZ field to something other than the
Chapter 15. Adapter for REXX
359
Examples
This example shows the SET SUBFUNC command used with the INQY call to get environment information.
IO="IOPCB" Func = "ENVIRON" Address REXXIMS "SET SUBFUNC Func" Address REXXTDLI "INQY IO EnviData" IMS_Identifier = Substr(EnviData,1,8) /* /* /* /* Sub-Function Value */ Set the value */ Make the DL/I Call */ Get IMS System Name*/
This example shows the SET ZZ command used with a conversational transaction for SPA processing.
Address REXXTDLI GU IOPCB SPA Hold_ZZ = IMSQUERY(ZZ) /* Get first Segment /* Get ZZ Field (4 bytes) */ */
. . .
Address REXXIMS SET ZZ Hold_ZZ Address REXXTDLI ISRT IOPCB SPA /* Set ZZ for SPA ISRT /* ISRT the SPA */ */
This example shows the SET ZZ command used for setting 3270 Device Characteristics Flags.
Bell_ZZ = 0040X Address REXXIMS SET ZZ Bell_ZZ Address REXXTDLI ISRT IOPCB Msg /* ZZ to Ring Bell on Term /* Set ZZ for SPA ISRT /* ISRT the Message */ */ */
Format
SRRBACK return_code SRRCMIT return_code
DB/DC X
DBCTL
DCCTL X
DB Batch
TM Batch
Usage
The return code from the SRR command is returned and placed in the return_code variable name as well as the REXX variable RC. For more information on SRRBACK and SRRCMIT, see IMS Version 9: Administration Guide: Transaction Manager and System Application Architecture Common Programming Interface: Resource Recovery Reference.
STORAGE
The STORAGE command allows the acquisition of system storage that can be used in place of variables for parameters to REXXTDLI and REXXIMS calls.
360
Format
STORAGE OBTAIN !token length KEEP BELOW RELEASE !token
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
Although REXX allows variables to start with characters (!) and (#), these characters have special meanings on some commands. When using the REXXTDLI interface, you must not use these characters as the starting characters of variables. The !token variable name identifies the storage, and it consists of an exclamation mark followed by a 1- to 16-character case-independent token name. The length variable name is a number or variable containing size in decimal to OBTAIN in the range 4 to 16777216 bytes (16 MB). The storage class has two possible override values, BELOW and KEEP, of which only one can be specified for any particular token. The BELOW function acquires the private storage below the 16 MB line. The KEEP function marks the token to be kept after this EXEC is terminated. The default action gets the storage in any location and frees the token when the EXEC is terminated. Use the STORAGE command to get storage to use on DL/I calls when the I/O area must remain in a fixed location (for example, Spool API) or when it is not desirable to have the LLZZ processing. For more information on LLZZ processing, see Parameter Handling on page 350. Once a token is allocated, you can use it in REXXTDLI DL/I calls or on the STORAGE RELEASE command. When using STORAGE: v When used on DL/I calls, none of the setup for LLZZ fields takes place. You must fill the token in and parse the results from it just as required by a non-REXX application. v You cannot specify both KEEP and BELOW on a single STORAGE command. v The RELEASE function is only necessary for tokens marked KEEP. All tokens not marked KEEP and not explicitly released by the time the EXEC ends are released automatically by the IMS adapter for REXX. v When you use OBTAIN, the entire storage block is initialized to 0. v The starting address of the storage received is always on the boundary of a double word. v You cannot re-obtain a token until RELEASE is used or the EXEC that obtained it, non-KEEP, terminates. If you try, a return code of -9 is given and the error message DFS3169 is issued. v When KEEP is specified for the storage token, it can be accessed again when this EXEC or another EXEC knowing the token's name is started in the same IMS region. v Tokens marked KEEP are not retained when an ABEND occurs or some other incident occurs that causes region storage to be cleared. It is simple to check if the block exists on entry with the IMSQUERY(!token) function. For more information, see IMSQUERY Extended Functions on page 363.
Chapter 15. Adapter for REXX
361
Example
This example shows how to use the STORAGE command with Spool API.
/* Get 4K Buffer below the line for Spool API Usage */ Address REXXIMS STORAGE OBTAIN !MYTOKEN 4096 BELOW /* Get Address and length (if curious) */ Parse Value IMSQUERY(!MYTOKEN) With My_Token_Addr My_Token_Len. Address REXXIMS SETO ALTPCB !MYTOKEN SETOPARMS SETOFB
. . .
Address REXXIMS STORAGE RELEASE !MYTOKEN
Format
WTO message WTP message WTL message
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The message variable name is a REXX variable containing the text that is stored displayed in the appropriate place.
Example
This example shows how to write a simple message stored the REXX variable MSG.
Msg = Sample output Address REXXIMS WTO Address REXXIMS WTP Address REXXIMS WTL message. Msg Msg Msg /* /* /* /* Build Message Tell Operator Tell Programmer Log It */ */ */ */
WTOR
The WTOR command requests input or response from the z/OS system operator.
Format
WTOR message response
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The message variable name is a REXX variable containing the text that will be displayed on the z/OS console. The operator's response is placed in the REXX variable signified by the response variable name.
362
Example
This example prompts the operator to enter ROLL or CONT on the z/OS master or alternate console. Once the WTOR is answered, the response is placed in the REXX variable name response, and the EXEC will continue and process the IF statement appropriately.
Msg = Should I ROLL or Continue. Reply "ROLL" or "CONT" Address REXXIMS WTOR Msg Resp /* Ask Operator */ If Resp = ROLL Then /* Tell Programmer */ Address REXXTDLI ROLL /* Roll Out of this */
Format
IMSQUERY ( FEEDBACK IMSRXTRC REASON SEGLEVEL SEGNAME STATUS TRANCODE USERID ZZ !token )
DB/DC X
DBCTL X
DCCTL X
DB Batch X
TM Batch X
Usage
The format of the function call is: IMSQUERY(Argument) where Argument is one of the following values: Argument FEEDBACK IMSRXTRC REASON SEGLEVEL SEGNAME STATUS Description of Data Returned FEEDBACK area from current PCB. Current IMSRXTRC trace level #. Reason code from last call (from AIB if used on last REXXTDLI type call). Segment level from current PCB (Last REXXTDLI call must be against a DB PCB, or null is returned). Segment name from current PCB (Last REXXTDLI call must be against a DB PCB, or null is returned). IMS status code from last executed REXXTDLI call (DL/I call). This argument is the two character status code from the PCB. Current transaction code being processed, if available.
TRANCODE
363
!token
This value can be placed in a variable or resolved from an expression. In these cases, the quotation marks should be omitted as shown below:
Token_Name="!MY_TOKEN" AddrInfo=IMSQUERY(Token_Name) /* or */ AddrInfo=IMSQUERY("!MY_TOKEN")
Although the function argument is case-independent, no blanks are allowed within the function argument. You can use the REXX STRIP function on the argument, if necessary. IMSQUERY is the preferred syntax, however REXXIMS is supported and can be used, as well.
Example
If REXXIMS(STATUS)=GB Then Signal End_Of_DB . . . Hold_ZZ = IMSQUERY(ZZ) /* Get current ZZ field*/ . . . Parse Value IMSQUERY(!MYTOKEN) With My_Token_Addr My_Token_Len .
Related Reading: For information on the IMS adapter for REXX exit routine, see IMS Version 9: Customization Guide.
364
This exec shows an example of developing applications with IMS Adapter for REXX. It also shows the advantages of REXX, such as dynamic interpretation, which is the ability to evaluate a mathematical expression at run-time. A PDF EDIT session is shown in Figure 60. This figure shows how you can enter a new exec to be executed under IMS.
EDIT ---- USER.PRIVATE.PROCLIB(SAY) - 01.03 ------------------ COLUMNS 001 072 COMMAND ===> SCROLL ===> PAGE ****** ***************************** TOP OF DATA ****************************** 000001 /* EXEC TO DO CALCULATIONS */ 000002 Address REXXTDLI 000003 Arg Args 000004 If Args= Then 000005 Msg=SUPPLY EXPRESSION AFTER EXEC NAME. 000006 Else Do 000007 Interpret X=Args /* Evaluate Expression */ 000008 Msg=EXPRESSION: Args = X 000009 End 000010 000011 ISRT IOPCB MSG 000012 Exit RC ****** **************************** BOTTOM OF DATA ****************************
To execute the SAY exec, use IVPREXX and supply an expression such as:
IVPREXX SAY 5*5+7
365
PCBINFO Exec
Figure 62. Example Output of PCBINFO Exec on a PSB without Database PCBs.
IMS PCB System Information Exec: PCBINFO System Date: 09/26/92 Time: 15:53:34 PCB # 1: Type=IO, LTERM=T3270LC Status= Date=89320 Time=1553243 PCB # 2: Type=DB, DBD =DI21PART Status= EXEC PCBINFO ended with RC= 0 UserID= Level=00 Opt=G OutDesc=DFSMO2
Figure 63. Example Output of PCBINFO Exec on a PSB with a Database PCB.
366
PCBINFO Exec
/* REXX EXEC TO SHOW SYSTEM LEVEL INFO */ Address REXXTDLI Arg Dest . WTO=(Dest=WTO) Call SayIt IMS PCB System Information Exec: PCBINFO Call SayIt System Date: Date(U) Time: Time() Call Sayit /* A DFS3162 message is given when this exec is run because it does */ /* not know how many PCBs are in the list and it runs until it gets */ /* an error return code. Note this does not show PCBs that are */ /* available to the PSB by name only, in other words, not in the PCB list. Msg=PCBINFO: Error message normal on DLIINFO. WTP MSG Do i=1 by 1 until Result=LAST Call SayPCB i End Exit 0 SayPCB: Procedure Expose WTO Arg PCB DLIINFO DLIINFO #PCB /* Get PCB Address */ If rc<0 Then Return LAST /* Invalid PCB Number */ Parse Var DLIInfo . . AIBAddr PCBAddr . PCBINFO=Storage(PCBAddr,255) /* Read PCB */ DCPCB=(Substr(PCBInfo,13,1)=00x) /* Date Field, must be DC PCB */ If DCPCB then Do Parse Value PCBInfo with, LTERM 9 . 11 StatCode 13 CurrDate 17 CurrTime 21, InputSeq 25 OutDesc 33 UserID 41 If LTERM= then LTERM=* NONE * CurrDate=Substr(c2x(CurrDate),3,5) CurrTime=Substr(c2x(CurrTime),1,7) If CurrDate\=000000 then Do Call SayIt PCB #Right(PCB,2): Type=IO, LTERM=LTERM, Status=StatCode UserID=UserID OutDesc=OutDesc Call SayIt Date=CurrDate Time=CurrTime End Else Call SayIt PCB #Right(PCB,2): Type=TP, LTERM=LTERM, Status=StatCode End Else Do Parse Value PCBInfo with, DBDName 9 SEGLev 11 StatCode 13 ProcOpt 17 . 21 Segname . 29, KeyLen 33 NumSens 37 KeyLen = c2d(KeyLen) NumSens= c2d(NumSens) Call SayIt PCB #Right(PCB,2): Type=DB, DBD =DBDName, Status=StatCode Level=SegLev Opt=ProcOpt End Return SayIt: Procedure Expose WTO Parse Arg Msg If WTO Then WTO MSG Else ISRT IOPCB MSG Return Figure 64. PCBINFO Exec Listing
*/
367
PART Execs
All part numbers that begin with a 300 or larger numbers are listed. The listing is shown in Figure 67 on page 369.
IMS Parts DATABASE Transaction System Date: 02/16/92 Time: 23:28:41 Request: Display 5 Parts with Part_Number >= 300 1 Part=3003802 Desc=CHASSIS 2 Part=3003806 Desc=SWITCH 3 Part=3007228 Desc=HOUSING 4 Part=3008027 Desc=CARD FRONT 5 Part=3009228 Desc=CAPACITOR EXEC PARTNUM ended with RC= 0
PARTNAME is used to show part names that begin with a specific string of characters. To list part names beginning with TRAN, enter the command:
PARTNAME TRAN
All part names that begin with TRAN are listed on the screen. The screen is shown in Figure 66. The listing is shown in Figure 68 on page 370.
IMS Parts DATABASE Transaction System Date: 02/16/92 Time: 23:30:09 Request: Display 5 Parts with Part Name like TRAN 1 Part=250239 Desc=TRANSISTOR 2 Part=7736847P001 Desc=TRANSFORMER 3 Part=975105-001 Desc=TRANSFORMER 4 Part=989036-001 Desc=TRANSFORMER End of DataBase reached before 5 records shown. EXEC PARTNAME ended with RC= 0
The DFSSAM01 exec is used to load the parts database. This exec is executed in batch, is part of the IVP, and provides an example of EXECIO usage in an exec. Related Reading: For details, see IMS Version 9: Installation Volume 1: Installation Verification.
368
PART Execs
PartNum=Left(PartNum,15) /* Pad to 15 with Blanks */ If PartNum= then Call Sayit Request: Display first Segs Parts in the DataBase Else Call Sayit Request: Display Segs Parts with Part_Number >= PartNum SSA1=PARTROOT(PARTKEY >=02PartNum) GU DATABASE *ROOTSEG SSA1 Status=IMSQUERY(STATUS) If Status=GE then Do /* Segment Not Found */ Call Sayit No parts found with larger Part_Number Exit 0 End Do i=1 to Segs While Status= Call Sayit Right(i,2) Part=PNum Desc=Description GN DATABASE *ROOTSEG SSA1 Status=IMSQUERY(STATUS) End If Status=GB then Call SayIt End of DataBase reached before Segs records shown. Else If Status\= then Signal BadCall Call Sayit Exit 0 SayIt: Procedure Expose IOPCB Parse Arg Msg ISRT IOPCB MSG If RC\=0 then Signal BadCall Return BadCall: DLIINFO INFO Parse Var Info Call PCB . . . . Status . Msg = Unresolved Status Code Status, on Call on PCB PCB ISRT IOPCB MSG Exit 99 Figure 67. PARTNUM Exec: Show Set of Parts Near a Specified Number
369
PART Execs
/* REXX EXEC TO SHOW ALL PARTS WITH A NAME CONTAINING A STRING /* Designed to be run by the IVPREXX exec with PSB=DFSSAM02 /* Syntax: IVPREXX PARTNAME string <#parts> Arg PartName Segs . Address REXXIMS Term =IOPCB /* PCB Name */ DataBase=DBPCB01 /* PCB Name for Parts Database */ Call SayIt IMS Parts DATABASE Transaction Call SayIt System Date: Date(U) Time: Time() Call Sayit If \DataType(Segs,W) & Segs\=* then Segs=5 If PartName= then Do Call Sayit Please supply the first few characters of the part name Exit 0 End Call Sayit Request: Display Segs Parts with Part Name like PartName SSA1=PARTROOT GU DATABASE ROOT_SEG SSA1 Status=REXXIMS(STATUS) i=0 Do While RC=0 & (i<Segs | Segs=*) Parse Var Root_Seg 3 PNum 18 27 Description 47 GN DATABASE ROOT_SEG SSA1 Status=REXXIMS(STATUS) If RC\=0 & Status\=GB Then Leave If Index(Description,PartName)=0 then Iterate i=i+1 Call Sayit Right(i,2)) Part=PNum Desc=Description End If RC\=0 & Status\=GB Then Signal BadCall If i<Segs & Segs\=* then Call SayIt End of DataBase reached before Segs records shown. Call Sayit Exit 0 SayIt: Procedure Expose Term Parse Arg Msg ISRT Term MSG If RC\=0 then Signal BadCall Return BadCall: Call "DFSSUT04" Term Exit 99 Figure 68. PARTNAME Exec: Show Parts with Similar Names */ */ */
370
DOCMD
Not all commands are allowed through transaction AOI, and some setup needs to be done to use this AOI. Related Reading: See Security Considerations for Automated Operator Commands in IMS Version 9: Administration Guide: System for more information. Some examples of DOCMD are given in Figure 69, Figure 70, Figure 71, Figure 72 on page 372, Figure 73 on page 372, and Figure 74 on page 372.
Please supply an IMS Command to execute. EXEC DOCMD ended with RC= 0
371
DOCMD
Selection criteria =>TYPE=SLU2<= Command: /DIS NODE ALL NODE_SUB TYPE CID RECD ENQCT DEQCT QCT SENT WRIGHT SLU2 00000000 0 0 0 0 0 IDLE Q3290A SLU2 00000000 0 0 0 0 0 IDLE Q3290B SLU2 00000000 0 0 0 0 0 IDLE Q3290C SLU2 00000000 0 0 0 0 0 IDLE Q3290D SLU2 00000000 0 0 0 0 0 IDLE V3290A SLU2 00000000 0 0 0 0 0 IDLE V3290B SLU2 00000000 0 0 0 0 0 IDLE H3290A SLU2 00000000 0 0 0 0 0 IDLE H3290B SLU2 00000000 0 0 0 0 0 IDLE E32701 SLU2 00000000 0 0 0 0 0 IDLE E32702 SLU2 00000000 0 0 0 0 0 IDLE E32703 SLU2 00000000 0 0 0 0 0 IDLE E32704 SLU2 00000000 0 0 0 0 0 IDLE E32705 SLU2 00000000 0 0 0 0 0 IDLE ADLU2A SLU2 00000000 0 0 0 0 0 IDLE ADLU2B SLU2 00000000 0 0 0 0 0 IDLE ADLU2C SLU2 00000000 0 0 0 0 0 IDLE ADLU2D SLU2 00000000 0 0 0 0 0 IDLE ADLU2E SLU2 00000000 0 0 0 0 0 IDLE ADLU2F SLU2 00000000 0 0 0 0 0 IDLE ADLU2X SLU2 00000000 0 0 0 0 0 IDLE ENDS01 SLU2 00000000 0 0 0 0 0 IDLE ENDS02 SLU2 00000000 0 0 0 0 0 IDLE ENDS03 SLU2 00000000 0 0 0 0 0 IDLE ENDS04 SLU2 00000000 0 0 0 0 0 IDLE ENDS05 SLU2 00000000 0 0 0 0 0 IDLE ENDS06 SLU2 00000000 0 0 0 0 0 IDLE NDSLU2A1 SLU2 00000000 0 0 0 0 0 ASR IDLE NDSLU2A2 SLU2 00000000 0 0 0 0 0 ASR IDLE NDSLU2A3 SLU2 00000000 0 0 0 0 0 ASR IDLE NDSLU2A4 SLU2 00000000 0 0 0 0 0 ASR IDLE NDSLU2A5 SLU2 00000000 0 0 0 0 0 IDLE NDSLU2A6 SLU2 00000000 0 0 0 0 0 ASR IDLE OMSSLU2A SLU2 00000000 0 0 0 0 0 IDLE Selected 34 lines from 396 lines. DOCMD Executed 435 DL/I calls in 1.602206 seconds. EXEC DOCMD ended with RC= 0
Selection criteria =>ENQCT>0 & RECTYPE=T02<= Command: /DIS TRAN ALL TRAN CLS ENQCT QCT LCT PLCT CP NP LP SEGSZ SEGNO PARLM RC TACP18 1 119 0 65535 65535 1 1 1 0 0 NONE 1 Selected 1 lines from 1104 lines. DOCMD Executed 1152 DL/I calls in 5.780977 seconds. EXEC DOCMD ended with RC= 0
Figure 73. Output from = > DOCMD /DIS TRAN ALL;ENQCT>0 & RECTYPE='T02'
Selection criteria =>ENQCT>0<= Command: /DIS LTERM ALL LTERM ENQCT DEQCT QCT CTRL 19 19 0 T3270LC 119 119 0 Selected 2 lines from 678 lines. DOCMD Executed 681 DL/I calls in 1.967670 seconds. EXEC DOCMD ended with RC= 0
The source code for the DOCMD exec is shown in Figure 75 on page 373.
372
DOCMD
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
/*********************************************************************/ /* A REXX EXEC that executes an IMS command and parses the */ /* output by a user supplied criteria. */ /* */ /* */ /*********************************************************************/ /* Format: tranname DOCMD IMS-Command;Expression */ /* Where: */ /* tranname is the tranname of a command capable transaction that */ /* will run the DFSREXX program. */ /* IMS-Command is any valid IMS command that generates a table of */ /* output like /DIS NODE ALL or /DIS TRAN ALL */ /* Expression is any valid REXX expression, using the header names*/ /* as the variables, like CID>0 or SEND=0 or more */ /* complex like CID>0 & TYPE=SLU2 */ /* Example: TACP18 DOCMD DIS A Display active */ /* TACP18 DOCMD DIS NODE ALL;? See headers of DIS NODE */ /* TACP18 DOCMD DIS NODE ALL;CID>0 Show active Nodes */ /* TACP18 DOCMD DIS NODE ALL;CID>0;SYSOUT Output to SYSOUT */ /* TACP18 DOCMD DIS NODE ALL;CID>0 & TYPE=SLU2 */ /*********************************************************************/ Address REXXTDLI Parse Upper Arg Cmd ; Expression ; SysOut Cmd=Strip(Cmd); Expression=Strip(Expression) SysOut=(SysOut\=) If Cmd= Then Do Call SayIt Please supply an IMS Command to execute. Exit 0 End AllOpt= (Expression=ALL) If AllOpt then Expression= If Left(Cmd,1)\=/ then Cmd=/Cmd /* Add a slash if necessary */ If Expression= Then Call SayIt No Expression supplied, all output shown, from: Cmd Else If Expression=? Then Call SayIt Headers being shown for command: Cmd Else Call SayIt Selection criteria =>Expression<=, Command: Cmd x=Time(R); Calls=0 ExitRC= ParseHeader(Cmd,Expression) If ExitRC\=0 then Exit ExitRC If Expression=? Then Do Do i=1 to Vars.0 Call SayIt Variable (header) #i = Vars.i Calls=Calls+1 End End Figure 75. DOCMD Exec: Process an IMS Command (Part 1 of 3)
373
DOCMD
Else Do Call ParseCmd Expression Do i=1 to Line.0 If AllOpt then Line=Line.i Else Line=Substr(Line.i,5) If SysOut then Do Push Line EXECIO 1 DISKW DOCMD End Else Do Call SayIt Line Calls=Calls+1 End End If SysOut then Do EXECIO 0 DISKW DOCMD ( FINIS End If Expression\= then Call SayIt Selected Line.0-1 lines from, LinesAvail lines. Else Call SayIt Total lines of output: Line.0-1 Call SayIt DOCMD Executed Calls DL/I calls in, Time(E) seconds. End Exit 0 ParseHeader: CurrCmd=Arg(1) CmdCnt=0 CMD IOPCB CURRCMD CmdS= IMSQUERY(STATUS) Calls=Calls+1 If CmdS= then Do Call SayIt Command Executed, No output available. Return 4 End Else If CmdS\=CC then Do Call SayIt Error Executing Command, Status=CmdS Return 16 End CurrCmd=Translate(CurrCmd, ,15x) /* Drop special characters CurrCmd=Translate(CurrCmd,__,-/) /* Drop special characters CmdCnt=CmdCnt+1 Interpret LINE.||CmdCnt = Strip(CurrCmd) Parse Var CurrCmd RecType Header If Expression= then Nop Else If Right(RecType,2)=70 then Do Vars.0=Words(Header)+1 Vars.1 = "RECTYPE" Do i= 2 to Vars.0 Interpret VARS.i = "Word(CurrCmd,i)" End End Else Do Call SayIt Command did not produce a header, record, first records type=RecType Return 12 End Return 0 Figure 75. DOCMD Exec: Process an IMS Command (Part 2 of 3)
*/ */
374
IVPREXX
ParseCmd: LinesAvail=0 CurrExp=Arg(1) Do Forever GCMD IOPCB CURRCMD CmdS= IMSQUERY(STATUS) Calls=Calls+1 If CmdS\= then Leave /* Skip Time Stamps */ If Word(CurrCmd,1)=X99 & Expression\= then Iterate LinesAvail=LinesAvail+1 CurrCmd=Translate(CurrCmd, ,15x)/* Drop special characters */ If Expression= then OK=1 Else Do Do i= 1 to Vars.0 Interpret Vars.i = "Word(CurrCmd,i)" End Interpret OK=Expression End If OK then Do CmdCnt=CmdCnt+1 Interpret LINE.||CmdCnt = Strip(CurrCmd) End End Line.0 = CmdCnt If CmdS\=QD Then Call SayIt Error Executing Command:, Arg(1) Stat=CmdS Return SayIt: Procedure Parse Arg Line ISRT IOPCB LINE Return RC
375
376
Table 89. Return Codes in UIBDLTR if UIBFCTR='0C' (NOTOPEN) Condition Database not open Intent scheduling conflict ASM X'00' X'02' COBOL LOW-VALUES 12-2-9 PL/I 00000 000 00000 010
Table 90. Return Codes in UIBDLTR if UIBFCTR='08' (INVREQ) Condition Invalid argument passed to DL/I PSBNF (PSB not found) PSBSCH (PSB already scheduled) NOTDONE (request not executed) PSBFAIL (PSB initialization failed) TERMNS (termination not successful) FUNCNS (function unscheduled) INVPSB (invalid PSB) DLINA (DL/I not active) ASM X'00' X'01' X'03' X'04' X'05' X'07' X'08' X'10' X'FF' COBOL LOW-VALUES 12-1-9 12-3-9 12-4-9 12-5-9 12-7-9 12-8-9 12-10-9 12-11-0-7-8-9 PL/I 00000 000 00000 001 00000 011 00000 100 00000 101 00000 111 00001 000 00010 000 11111 111
377
Not-Open Conditions
A NOTOPEN condition is indicated if UIBFCTR contains X'0C'
UIBDLTR='00' Explanation: This is returned on a database call if the database was stopped after the PSB is scheduled. UIBDLTR='02' Explanation: This indicates that an intent-scheduling conflict exists. This condition does not occur if you are using IMS program isolation.
378
Notices
This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to: Intellectual Property Licensing Legal and Intellectual Property Law IBM Japan, Ltd. 1623-14, Shimotsuruma, Yamato-shi Kanagawa 242-8502 Japan The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.
Copyright IBM Corp. 1974, 2011
379
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact: IBM Corporation J46A/G4 555 Bailey Avenue San Jose, CA 95141-1003 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. The sample
380
programs are provided "AS IS," without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample programs. Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows: (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. Copyright IBM Corp. _enter the year or years_. All rights reserved. If you are viewing this information softcopy, the photographs and color illustrations may not appear.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web in the topic Copyright and trademark information at http://www.ibm.com/legal/copytrade.shtml. The following terms are trademarks or registered trademarks of other companies, and have been used at least once in the IMS library: v Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. v Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.
Notices
381
v Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. v Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. v UNIX is a registered trademark of The Open Group in the United States and other countries. Other product and service names might be trademarks of IBM or other companies.
382
Bibliography
This bibliography lists all of the information in the IMS Version 9 library. v CICS/ESA Application Programming Guide, SC33-1169 v CICS/ESA Application Programming Reference, SC33-1170 v CICS/ESA CICS-IMS Database Control Guide, SC33-1184 v CICS/MVS Installation Guide, SC33-0506 v CICS/ESA System Definition Guide, SC33-1164 v IBM Language Environment Installation and Customization on MVS, SC26-4817 v IBM Language Environment for MVS & VM Programming Guide, SC26-4818 v MVS/ESA: JCL Reference MVS/ESA System Product: JES2 Version 5 , GC28-1479 v MVS/ESA System Programming Library: Application Development Guide, GC28-1852 v System Application Architecture Common Programming Interface: Resource Recovery Reference, SC31-6821 v IBM TSO Extensions for MVS/REXX Reference, SC28-1883
Title IMS Version 9: Command Reference IMS Version 9: Common Queue Server Guide and Reference IMS Version 9: Common Service Layer Guide and Reference IMS Version 9: Customization Guide IMS Version 9: Database Recovery Control (DBRC) Guide and Reference IMS Version 9: Diagnosis Guide and Reference IMS Version 9: Failure Analysis Structure Tables (FAST) for Dump Analysis IMS Version 9: IMS Connect Guide and Reference IMS Version 9: IMS Java Guide and Reference IMS Version 9: Installation Volume 1: Installation Verification IMS Version 9: Installation Volume 2: System Definition and Tailoring IMS Version 9: Master Index and Glossary IMS Version 9: Messages and Codes, Volume 1 IMS Version 9: Messages and Codes, Volume 2 IMS Version 9: Open Transaction Manager Access Guide and Reference IMS Version 9: Operations Guide IMS Version 9: Release Planning Guide IMS Version 9: Summary of Commands IMS Version 9: Utilities Reference: Database and Transaction Manager IMS Version 9: Utilities Reference: System Acronym CR CQS CSL Order number SC18-7814 SC18-7815 SC18-7816
CG DBRC
SC18-7817 SC18-7818
DGR FAST
LY37-3203 LY37-3204
CT JGR IIV
ISDT
GC18-7823
APDG APCICS
SC18-7810 SC18-7811
APTM
SC18-7812
URS
SC18-7834
BPE
SC18-7813
383
Supplementary Publications
Title IMS TM Resource Adapter User's Guide and Reference IMS Version 9 Fact Sheet IMS Version 9: Licensed Program Specifications IRLM Messages and Codes Order number SC19-1211 GC18-7697 GC18-7825 GC19-2666
Publication Collections
Order number IMS Version 9 Softcopy Library CD LK3T-7213 Licensed Bill of Forms (LBOF): Hardcopy LBOF-7789 IMS Version 9 Hardcopy and and CD Softcopy Library Unlicensed Bill of Forms Hardcopy SBOF-7790 (SBOF): IMS Version 9 Unlicensed Hardcopy Library z/OS and Software Products DVD SK3T-4271 DVD Collection Title Format
384
354
Numerics
12-byte time stamp, field in I/O PCB 8-blanks (null) 256 69
A
AB0C1 internal call statement 298 abend statement 300 accessing GSAM databases 157 AD/Cycle C/370 91 addressability to UIB, establishing 78 addressing environments 344, 349 addressing mode (AMODE) 94 AIB (application interface block) address return 89 AIB identifier in RCMD call 278 AIB identifier (AIBID) description 73 in APSB call 252 in CHKP (basic) call 253 in CHKP (symbolic) call 254 in DPSB call 255 in GMSG call 256 in GSCD call 258 in ICMD call 259 in INIT call 261 in INQY call 266 in LOG call 276 in ROLB call 280 in ROLS call 281 in SETS/SETU call 283 in SNAP call 284 in STAT call 287 in SYNC call 289 in XRST call 290 AIBERRXT (reason code) 74 AIBLEN (DFSAIB allocated length) in APSB call 252 in CHKP (basic) call 253 in CHKP (symbolic) call 254 in DPSB call 255 in GMSG call 256 in GSCD call 259 in ICMD call 259 in INIT call 261 in INQY 266 in LOG call 276 in RCMD call 279 Copyright IBM Corp. 1974, 2011
385
APSB (Allocate PSB) call (continued) parameters 252 usage 252 area in CHKP (symbolic) call 255 in XRST call 291 area length in CHKP (symbolic) call 254 in XRST call 291 areas, I/O 80 assembler language DL/I call format, example 56 DL/I call-level sample 32 DL/I program structure 29 entry statement 86 parameters, DL/I call format 55 program entry 87 register 1, program entry 87 return statement 86 SSA definition examples 82 syntax diagram, DL/I call format 54 UIB, specifying 77
B
backout point, intermediate 116 bank account database example 15 Basic Checkpoint (CHKP Basic) description 253 format 253 parameters 253 usage 253 batch programs assembler language 29 C language 34 COBOL 36 deadlock occurrence, in 265 maintaining integrity 115 overview 5 Pascal 44 PL/I 46 structure 5 BILLING segment 15 binding, reference 32, 49 BMPs, transaction-oriented ROLB 114 Boolean operators dependent AND 150 independent AND 151 logical AND operator 24 logical OR 24 SSA, coding 81
C
C language 87 __pcblist 87 batch program, coding 34 DL/I call formats, example 59 DL/I program structure 34 entry statement 86, 87 exit 87 I/O area 59 parameters, DL/I call format 57 PCBs, passing 87 return statement 86
C language (continued) SSA definition examples 82 syntax diagram, DL/I call format 56 system function 88 C/C++ 91 call functions, DL/I 309 call results for status codes, exceptional 9 CALL statement 300 CALL DATA 303 CALL DATA statement internal field 303 CALL FUNCTION 300 call-level programs, CICS online 10 calls, DB CIMS 221 CLSE 223 DEQ 224 DLET 225 FLD 226 GHNP 233 GHU 235 GN 229 GNP 233 GU 235 ISRT 238 OPEN 241 POS 242 REPL 245 RLSE 247 calls, system service APSB (allocate PSB) 252 CHKP (basic) 253 CHKP (symbolic) 254 GMSG (get message) 256 ICMD (issue command) 259 INIT (initialize) 261 INQY (inquiry) 266 LOG (log) 276 PCB (schedule a PSB) 277 RCMD (retrieve command) 278 ROLB (roll back) 280 SETS/SETU (set a backout point) 282 backing out to an intermediate backout point 116 using 116 SNAP 284 STAT (statistics) 286 SYNC (synchronization point) 288 TERM (terminate) 289 XRST (extended restart) 290 CCTL (coordinator controller) design recommendation 142 performance considerations thread monitoring 143 CEETDLI 91 address return 88 interface to IMS 92 program entry statement 53, 88 checkpoint (CHKP) calls considerations 28 description 111 issuing 111 CHKP (basic checkpoint) call description 253 format 253
CHKP (basic checkpoint) call (continued) parameters 253 usage 253 CHKP (checkpoint) call, considerations 28 CHKP (symbolic checkpoint) call description 254 format 254 parameters 254 usage 255 with GSAM 163 CHKP call function 306 CHNG call function 306 CICS DL/I call program, compiling 29 CICS online programs 277 assembler language, sample 32 COBOL, establishing addressability 44 COBOL, optimization feature 44 COBOL, sample 39 PCB call 277 PL/I, sample 50 structure 10 TERM call 289 CIMS call description 221 format 221 parameters 221 usage 222 class, record segment 209 closing a GSAM database explicitly 161, 223 CLSE (Close) call description 223 format 223 parameters 223 usage 223 CMD call function 306 COBOL CICS online, establishing addressability 44 CICS online, optimization feature 44 DL/I call formats, example 62 DL/I call-level, sample 39 DL/I program structure 36 entry statement 86 Language Environment 91 parameters, DL/I call format 60 return statement 86 SSA definition examples 83 syntax diagram, DL/I call format 59 UIB, specifying 77 COBOL/370 and Language Environment 91 codes, status checking 8 logical relationships 155 coding rules, SSA 81 command codes 204 C description 203 SSAs (segment search arguments) 21 D examples 26, 203 Get calls 204 ISRT call 205
386
command codes (continued) D (continued) P processing option 204 DEDBs 27 DL/I calls 201 F Get calls 205 HERE insert rule 240 ISRT call 206 restrictions 187 L FIRST insert rule 207, 240 Get calls 206 M 214 N 207 Null 213 overview 26 P 208 Q 118, 208 qualified SSAs 27 R 215 reference 201 restrictions 81 S 216 SSAs (segment search arguments) 21 subset pointers 27, 181, 182 U 211 unqualified SSAs 27 V 212 Z 218 COMMENT statement conditional (T) 320 unconditional (U) 320 commit point processing DEDB 185 MSDB 176 COMPARE statement COMPARE AIB 323 COMPARE DATA 322 COMPARE PCB 324 introduction 321 concatenated data sets, GSAM 167 concatenated key and PCB mask 72, 159 concatenated segments, logical relationships 154 connector, field search argument (FSA) 228 CTL (PUNCH) statement 328 current position determining 95 multiple positioning 104 qualification 211 unsuccessful calls 100
D
data areas, coding 28 data availability, status codes 71 data entry database (DEDB) See DEDB (data entry database) data locking 177 data mapping, define with MAXDEF command 355 data redundancy, reducing 152 data structures 29 database administrator 14
database (continued) calls Fast Path 195 summary 219 DB PCB, name 71, 159 deallocating resources 255 position after XRST 292 determining 95 establishing using GU 237 multiple positioning 104 unsuccessful calls 100 recovery with ROLL call 114 recovery, back out changes 113 database descriptions (DBDs) 9 database management calls 7 database resource adapter (DRA) See DRA (database resource adapter) DB PCB status codes NU 262 DB PCB (database program communication block) database name 71, 159 entry statement, pointer 158 fields 70, 71 in GSCD 258 key feedback area 159 key feedback area length field 72, 159 mask 71 fields 159 fields, GSAM 158 general description 70 GSAM reference 85 name 158 relation 70 specifying 70 masks DB PCB 70 multiple DB PCBs 109 number of sensitive segments field 72 processing options field 72, 159 relation to DB PCB 70 secondary indexing, contents 152 segment level number field 71 segment name field 72 sensitive segments 72 status code field 71, 159 status codes NA 262 DBA 14 DBDs (database descriptions) description 9 DBQUERY using with INIT call 262 deadlock occurrence application programs 265 batch programs, in 265 debugging, IMSRXTRC 354 DEDB (data entry database) 170 call restrictions 187 command codes 213 data locking 177 DL/I calls 187 multiple qualification statements 26
DEDB (data entry database) (continued) PCBs and DL/I calls 295 processing commit point 185 data locking 177 fast path 169 H option 186 overview 171 P option 186 POS call 183 subset pointers 178 root segments, order 232 updating segments 171 updating with subset pointers 178 define a data mapping with MAXDEF command 355 Delete (DLET) call description 225 format 225 parameters 223, 225, 242 SSA 226 usage 226 with MSDB, DEDB or VSO DEDB 171 dependent AND operator 150 dependents, direct 170 DEQ (Dequeue) call description 224 format Fast Path 224 full function 224 function 306 parameters Fast Path 224 full function 224 Q command code 209, 224 restrictions 225 summary 220 usage 224 Dequeue (DEQ) call description 224 format Fast Path 224 full function 224 function 306 parameters Fast Path 224 full function 224 Q command code 209, 224 summary 220 usage 224 DFSDDLT0 (DL/I Test Program) See DL/I Test Program (DFSDDLT0) DFSDDLT0 internal control statements AB0C1 statement (INTERNAL CALL STATEMENT) 298 WTSR statement (INTERNAL CALL STATEMENT) 298 DFSPRP macro keywords 128 DFSPSP00 (DRA startup table) 128 DFSREXXU, example user exit routine 344 DFSSAM01 (Loads the Database) 370 DL/I call formats, examples assembler language 56 C language 59 COBOL 62 Index
387
DL/I call formats, examples (continued) Pascal 64 PL/I 67 DL/I call functions special DFSDDLT0 END 319 SKIP 319 STAK 319 START 319 supported CHKP 306 CHNG 306 CMD 306 DEQ 306 DLET 306 FLD 306 GCMD 306 GHN 306 GHNP 306 GHU 306 GMSG 307 GN 307 GNP 307 GU 307 ICMD 307 INIT 307 INQY 307 ISRT 307 LOG 307 POS 307 PURG 307 RCMD 307 REPL 307 ROLB 307 ROLL 308 ROLS 308 ROLX 308 SETO 308 SETS 308 SNAP 308 STAT 308 SYNC 308 XRST 308 DL/I call functions, examples 309 DL/I calls (general information) qualified calls 20 qualifying calls command codes 26 concatenated key 203 field 21 segment type 21 relationships to PCBs, FF PCBs 295 REXXTDLI 349 segment search arguments (SSAs) 20 types 21 unqualified calls 20 DL/I calls, database management CIMS 221 CLSE 223 DEQ 224 DLET 225, 226 FLD 226, 229 general description 7 GHNP call 235 GHU call 237 GN 229, 233 GNHP call 232
DL/I calls, database management (continued) GNP 233, 235 GU 235, 238 ISRT 238, 241 OPEN 241 POS 242, 245 REPL 245, 246 RLSE 247 summary 7, 219 DL/I calls, general information coding 28 getting started with 5 using 7 DL/I calls, system service APSB 252 CHKP 253, 254, 255 CHKP (basic) 253 description 249 DPSB 255 GMSG 256 GSCD 258, 259 INIT 261, 265 INQY 266 LOG 276, 277 PCB 277, 278 ROLB 114, 280 ROLL 113, 280, 281 ROLS 281, 282 SETS/SETU 282, 283 SNAP 284, 286 STAT 286, 288, 289, 290 summary 7, 250 SYNC 288, 289 XRST 290 DL/I language interfaces overview 53 supported interfaces 53 DL/I Open Database Access (ODBA) interface 12 DL/I options logical relationships 152 secondary indexing 149 DL/I program structure 5 DL/I return codes (REXX) 349 DL/I Test Program (DFSDDLT0) control statements 298, 335 execution in IMS regions 339 explanation of return codes 339 hints on usage 339, 341 JCL requirements 335, 339 overview 297 restarting input stream 337 DL/I, getting started with CICS online 10 DLET (Delete) call description 225 format 225 parameters 223, 225, 242 SSA 226 usage 226 with MSDB, DEDB or VSO DEDB 171 DLET call function 306 DLIINFO . (period) usage 354 REXX extended command 352, 353
DLITCBL 88 DLITPLI 88 DOCMD exec 370 DPSB call description 255 format 255 parameters 255 usage 256 DRA (database resource adapter) CCTL function requests description 132 INIT 132 RESYNC 134 TERM 135 CCTL recovery process 142 description 121 DRA statistics 145 enabling CCTL 129 ODBA 130 initializing CCTL 129 ODBA 130 macro keywords 128 multithreading 122 PAPL 141 problem determination 146 processing CCTL requests 131 ODBA calls 132 startup table description 128 DFSPZPxx 128 sync point processing description 124 sync-point processing in-doubt state 127 protocol 125 termination 141 thread ODBA 122 processing 121 structure 121 thread function requests 135 ABTTERM 140 COMTERM 139 IMS 137 PREP 139 SCHED 135 SYNTERM 138 TERMTHRD 140 thread statistics 143 tracing 146 dynamic MSDBs (main storage databases) 16
E
E (COMPARE) statement 321 enabling data availability status codes 71 END call function 319 entry and return conventions 86 environment (REXX) address 344, 349 determining 352 extended 349
388
equal-to relational operator 21 error routines 9 explanation 9 I/O errors 9 programming errors 9 system errors 9 types of errors 9 examples bank account database 15 Boolean operators 25 D command code 26, 204 DFSDDLT0 statements COMMENT 321 DATA/PCB COMPARE 325 DD 337 DL/I call functions 309 IGNORE 327 OPTION 328 PUNCH 331 STATUS 333 SYSIN, SYSIN2, and PREINIT 337 WTO 334 WTOR 335 DFSREXXU user exit routine 344 FLD/CHANGE 175 FLD/VERIFY 175 L command code 207 medical database 13 multiple qualification statements 25 N command code 207 Null command code 213 P command code 208 path call 26 SSA, secondary indexing 150 U Command Code 211 UIB, defining 78 V command code 212 EXECIO example 370 managing resources 344 explicitly opening and closing a GSAM database 161 extended commands See REXXIMS commands extended environment See environment (REXX) extended functions See IMSQUERY extended function Extended Restart (XRST) description 290 parameters 290 position in database 292 restarting your program 291 restrictions 293 starting your program normally 291 usage 291 with Symbolic Checkpoint (CHKP Symbolic) 255
Fast Path (continued) MSDB (main storage database) 169 processing MSDBs and VSO DEDBs 171 subset pointers, using with DEDBs 178 types of databases 169 field changing contents 174 checking contents: FLD/VERIFY 172 Field (FLD) call See FLD (Field) call field name FSA 173, 228 SSA, qualification statement 21 field search argument (FSA) connector 228 description 172 field name 228 Op code 228 operand 228 reference 227 status code 228 with DL/I calls 172 field value FSA 173 SSA, qualification statement 21, 22 fields in a DB PCB 159 fields in a DB PCB mask 71 file I/O See EXECIO FIRST insert rule, L command code 207 fixed-length records 161 fixed, MSDBs (main storage databases) 16 FLD (Field) call description 171, 226 FLD/CHANGE 174 FLD/VERIFY 172 format 226 FSAs 227 parameters 227 summary 220 usage 227 FLD call function 306 free space, identifying 185 FSA (field search argument) connector 228 description 172 field name 228 Op code 228 operand 228 reference 227 status code 228 with DL/I calls 172 full-function database PCBs and DL/I calls 295 segment release 210
F
F command code, restrictions 187 Fast Path database calls 169, 170 databases, processing 169 DEDB (data entry database) 169 FSA 227
G
GB (end of database), return status code 204 GCMD call function 306 GE (segment not found), return status code 204
generalized sequential access method (GSAM) See GSAM (generalized sequential access method) generated program specification block (GPSB), format 89 Get calls D command code 204 F command code 205 function 306 L command code 207 Null command code 213 P command code 208 Q command code 208 U Command Code 211 V command code 212 get hold next (GHN), usage 232 Get Hold Unique (GHU) description 237 Get Message (GMSG) call description 256 format 256 parameters 256 restrictions 258 usage 257 Get Next (GN) call description 229 format 229 hold form (GHN) 232 parameters 229 SSA 231 usage 230 Get Next in Parent (GNP) call description 233 effect in parentage 234 format 233 hold form (GHNP) 235 parameters 233 SSA 235 usage 234 linking with previous DL/I calls 234 processing with parentage 234 Get System Contents Directory (GSCD) call description 258 format 258 parameters 258 usage 259 Get Unique (GU) call description 235 format 236 hold form (GHU) 237 parameters 236 restrictions 238 usage 237 GHN (get hold next), usage 232 GHNP call 233 hold form 235 GHU (Get Hold Unique), description 237 GMSG call description 256 format 256 parameters 256 restrictions 258 usage 257 Index
389
GN (Get Next) call description 229 format 229 hold form (GHN) 232 parameters 229 SSA 231 usage 230 GNP (Get Next in Parent) call description 233 effect in parentage 234 format 233 hold form (GHNP) 235 parameters 233 SSA 235 usage 234 linking with previous DL/I calls 234 processing with parentage 234 GPSB (generated program specification block), format 89 greater-than relational operator 21 greater-than-or-equal-to relational operator 21 group name, field in I/O PCB 69 GSAM (generalized sequential access method) accessing databases 157 BMP region type 167 call summary 163 CHKP 163 coding considerations 163 data areas 85 data set attributes, specifying 167 characteristics, origin 164 concatenated 167 DD statement DISP parameter 165 extended checkpoint restart 165 database, explicitly opening and closing 161 DB PCB mask, fields 158 DB PCB masks 85 DBB region type 167 description 157 designing a program 157 DLI region types 167 fixed-length records 161 I/O areas 162 PCBs and DL/I calls 295 record formats 161 records, retrieving and inserting 159 restrictions on CHKP and XRST 163 RSA 85, 160 status codes 162 undefined-length records 161 variable-length records 161 XRST 163 GSCD (Get System Contents Directory) call description 258 format 258 parameters 258 usage 259 GU (Get Unique) call description 235 format 236
GU (Get Unique) call (continued) hold form (GHU) 237 parameters 236 restrictions 238 SSA 237 usage 237 guidelines, programming 19
H
H processing option 186 HALDB (High Availability Large Database) application programs, scheduling against 93 HALDB partitions data availability 9 error settings 9 handling 9 initial load of 93 restrictions for loading logical child segments 9 scheduling 9 status codes 9 HDAM multiple qualification statements 26 order of root segments 232 HERE insert rule F command code 206 L command code 207 hierarchic sequence 230 hierarchical database example, medical 13 hierarchy bank account database 15 data structures 29 medical database 13 hierarchy examples 13, 15 High Availability Large Database (HALDB) application programs, scheduling against 93 HALDB partitions data availability 9 error settings 9 handling 9 initial load of 93 restrictions for loading logical child segments 9 scheduling 9 status codes 9 HOUSHOLD segment 15
I
I/O area C language 59 coding 80 description 80 for XRST 291 in CHKP (symbolic) call 254 in GMSG call 257 in GSCD call 259 in INIT call 261 in INQY call 266 length in CHKP (symbolic) call
254
I/O area (continued) returned keywords 243 map of 243 specifying 80 I/O PCB in GSCD 258 in INIT call 261 mask 12-byte time stamp 69 general description 67 group name field 69 input message sequence number 68 logical terminal name field 67 message output descriptor name 68 specifying 67 status code field 68 userid field 69 userid indicator field 70 PCBs and DL/I calls 295 ICMD call commands that can be issued 261 description 259, 261 format 259 parameters 259 restrictions 261 use 260 IGNORE (N or .) statement 327 ILLNESS segment 14 IMSQUERY extended function arguments 363 usage 363 IMSRXTRC command 352, 354 independent AND operator 151 indexed field in SSA 150 indexing, secondary DL/I Returns 152 effect on program 149 multiple qualification statements 150 SSAs 149 status codes 152 infinite loop, stopping 348 INIT (Initialize) call automatic INIT DBQERY 263 call function 307 database availability, determining 262 description 261 enabling data availability, status codes 263 enabling deadlock occurrence, status codes 264 format 261 INIT STATUS GROUPA 263 INIT STATUS GROUPB 264 parameters 261 performance 263 restrictions 265 status codes 263 usage 261 using with DBQUERY 262 Initialize (INIT) call automatic INIT DBQERY 263 database availability, determining 262
390
Initialize (INIT) call (continued) description 261 enabling data availability, status codes 263 enabling deadlock occurrence, status codes 264 format 261 INIT STATUS GROUPA 263 INIT STATUS GROUPB 264 parameters 261 performance 263 restrictions 265 status codes 263 usage 261 using with DBQUERY 262 input for a DL/I program 28 input message sequence number, field in I/O PCB 68 INQY (Inquiry) call description 266 format 266 map of INQY subfunction to PCB type 275 parameters 266 querying data availability 267 environment 268 PCB 270 program name 275 restriction 275 return and reason codes 275 usage 266 INQY call querying input information 270 LERUNOPT, using LERUNOPT subfunction 274 INQY call function 307 INQY DBQUERY 267 INQY ENVIRON, data output 268 INQY FIND 270 INQY PROGRAM 275 inserting first occurrence of a segment 205 last occurrence 206 segments 239 inserting a segment as first occurrence 206 as last occurrence 206 GSAM records 159 in sequence 205 path of segments 205 root 239 rules to obey 239 specifying rules 240 integrity batch programs 115 maintaining, database 112 using ROLB 113 MPPs and transaction-oriented BMPs 114 using ROLL 113 using ROLS 115 interfaces, DL/I 91 See DL/I interfaces intermediate backout point backing out 116
internal call statements AB0C1 298 WTSR 298 internal control statements, DFSDDLT0 AB0C1 statement (INTERNAL CALL STATEMENT) 298 WTSR statement (INTERNAL CALL STATEMENT) 298 internal control statements, summary 298 ISRT (Insert) call D command code 205 description 238 F command code 206 format 238 L command code 207 loading a database 207 parameters 238 RULES parameter 206 SSA 240 with MSDB, DEDB or VSO DEDB 171 ISRT call function 307 Issue Command (ICMD) call See ICMD call 259 IVPREXX exec 375 IVPREXX sample application 347
LOG (Log) call description 276 format 276 parameters 276 restrictions 277 usage 277 LOG call function 307 logging DRA (database resource adapter) logical AND, Boolean operator 24 logical child 152 logical child segments HALDB (High Availability Large Database), restrictions 9 logical OR, Boolean operator 24 logical parent 152 logical relationships effect on programming 154 introduction 152 logical child 152 logical parent 152 physical parent 152 processing segments 152 programming, effect 152 status codes 155 logical structure 152 logical terminal name, field in I/O PCB 67
146
J
JCL (job control language), requirements 335, 339
M
M command code examples 214 subset pointers, moving forward 214 main storage database (MSDB) See MSDB (main storage database) main storage database (MSDBs) types nonrelated 17 main storage databases (MSDBs) dynamic 16 types related 16 managing subset pointers in DEDBs with command codes 171 MAP definition (MAPDEF) 352, 355 map name See *mapname MAP reading (MAPGET) 352, 357 MAP writing (MAPPUT) 352, 358 mapping MAPDEF 355 MAPGET 357 MAPPUT 358 mask AIB 73 DB PCB 70 MAXQ and Q command code 209 medical database example 13 description 13 segments 13 message output descriptor name, field in I/O PCB 68 mixed-language programming 93 modifiable alternate PCBs 111 MPPs ROLB 114 Index
K
key feedback area DB PCB, length field 72 length field in DB PCB 159 overview 72 keys concatenated 203
L
L (CALL) statement 300 Language Environment 91 LANG = option for PL/I compatibility 92 language interfaces, DL/I 91 See DL/I interfaces length of key feedback area 159 less-than relational operator 21 less-than-or-equal-to relational operator 21 level number, field in DB PCB 71 limiting number of full-function database calls 209 locating dependents in DEDBs last-inserted sequential dependent, POS call 183 POS call 183 specific sequential dependent, POS call 183 lock class and Q command code 209 lock management 119
391
MSDB (main storage database) call restrictions 178 commit point processing 176 data locking 177 PCBs and DL/I calls 295 processing 171 data locking 177 updating segments 171 MSDBs (main storage database) processing commit points 176 MSDBs (main storage databases) nonrelated 169 terminal related 169 types description 169 nonrelated 17 related 16 multiple DB PCBs 109 positioning 104 processing 104 qualification statements 24 qualification statements, DEDB 26 qualification statements, HDAM 26 qualification statements, PHDAM 26 multiple positioning advantages of 107 effecting your program 107 resetting position 109 MYLTERM 178
operators Boolean 24 relational 24 OPTION statement 327 options, processing; field in DB PCB 159 OR, logical 24 OS/VS COBOL and Language Environment 91 overriding FIRST insert rule 207 HERE insert rule 206, 207 insert rules 240
72,
P
P command code 208 P processing option 186, 204 parameters assembler language, DL/I call format 55 C language, DL/I call format 57 COBOL, DL/I call format 60 Pascal, DL/I call format 63 PL/I, DL/I call format 65 parentage, P command code 208 PART exec 368 PARTNAME exec 369 PARTNUM exec 369 parts of DL/I program 5 Pascal batch program, coding 44 DL/I call formats, example 64 DL/I program structure 44 entry statement 86, 88 parameters, DL/I call format 63 PCBs, passing 88 SSA definition examples 84 syntax diagram, DL/I call format 62 path call 204 D command code 204 definition 26 example 26 overview 26 PATIENT segment 14 PAYMENT segment 15 PCB (program communication block) address list, accessing 77 DL/I calls, relationship 295 DLIINFO call 353 masks description 6 GSAM databases 157 I/O PCB 67 modifiable alternate PCBs 111 types 90 PCB (schedule a PSB) call description 277 format 277 parameters 278 usage 278 PCBINFO exec 366 PCHSEGTS 243 PCLBSGTS 243 PCSEGHWM 243 PCSEGRTS 243
N
N command code 207 NA 262 name field, segments 21 nonrelated (non-terminal-related) MSDBs 169 not-equal-to relational operator 21 not-found status code description 100 position after 100 NU 262 Null command code 213
O
O (OPTION) Statement 327 ODBA (Open Database Access) interface, DLI/I getting started with 12 op code 228 OPEN (Open) call description 241 format 241 usage 242 Open Database Access (ODBA) interface, DL/I getting started with 12 operand FSA 228 operation parameter, SNAP external call 285 operator FSA 173 SSA 21
period usage See usage PHDAM multiple qualification statements 26 PHDAM database 232 physical parent 152 PL/I batch program, coding 46 DL/I call formats, example 67 DL/I call-level sample 50 DL/I program, multitasking restriction 46 entry statement 86 parameters, DL/I call format 65 PCBs, passing 88 pointers in entry statement 88 return statement 86 SSA definition examples 84 syntax diagram, DL/I call format 64 UIB, specifying 77 PL/I and Language Environment 91 PL/I Compatibility LANG= Option 92 PLITDLI 117 POS (Position) call description 183, 242 examples 245 format 242 I/O area 243 parameters 243 unqualified keywords 243 usage 245 POS call function 307 POS(positioning)=MULT(multiple) 104 position establishing in database 237 positioning after DLET 97 after ISRT 99 after REPL 99 after retrieval calls 97 after unsuccessful calls 100 after unsuccessful DLET or REPL call 100 after unsuccessful retrieval or ISRT call 101 CHKP, effect 111 current, after unsuccessful calls 100 determining 95 multiple 104 understanding current 95 PREINIT parameter, input restart 335 preloaded programs 94 processing commit-point in DEDB 185 commit-point in MSDB 176 database, several views 109 DEDBs 178 Fast Path databases 169 GSAM databases 157 MSDBs and VSO DEDBs 171 multiple 104 options field in DB PCB 72, 159 H (position), for Fast Path 186 P (path) 204
392
processing (continued) options (continued) P (position), for Fast Path 186 segments in logical relationships 152 program batch structure 5 design 28 restarting 111 program communication block See also DB (database program communication block) See PCB (program communication block) program deadlock 264 program specification blocks (PSBs) description 9 programming guidelines 19 mixed language 93 secondary indexing 149 PSB (program specification block) format 89 PSBGEN LANG= Option 92 PSBs (program specification blocks) description 9 PUNCH statement 328 PURG call function 307
R
R command code 215 RACF signon security 69 RACROUTE SAF 69 randomizing routine exit routine 26, 232 RCMD call description 278, 279 format 278 parameters 278 restrictions 279 use 279 reading segments in MSDBs 172, 178 record search argument See RSA (record search argument) related (terminal related) MSDBs 169 relational operators Boolean operators 24 independent AND 24 list 21 logical AND 24 logical OR 24 overview 21 SSA, coding 81 SSA, qualification statement 21 REPL (Replace) call description 245 format 245 N command code 207 parameters 245 SSAs 246 usage 246 with MSDB, DEDB or VSO DEDB 171 REPL call function 307 requesting a segment using GU 237 reserving place for command codes 187 segment command code 118 lock management 119 resetting a subpointer 216 residency mode (RMODE) 94 Restart, Extended parameters 290 position in database 292 restarting your program 291 restrictions 293 starting your program normally 291 usage 291 Restart, Extended (XRST) description 290 with Symbolic Checkpoint (CHKP Symbolic) 255 restarting your program XRST call 291 restarting your program, basic checkpoints 111 restrictions CHKP and XRST with GSAM 163 database calls to DEDBs 187 to MSDBs 178 F command code 205 number of database calls and Fast Path 209
Q
Q command code 118 and the DEQ call 210 example 209 full function and segment release 210 lock class 209 MAXQ 209 qualification statement coding 81 field name 21 field value 21, 22 multiple qualification statements 24 multiple qualification statements, DEDB 26 multiple qualification statements, HDAM 26 multiple qualification statements, PHDAM 26 relational operator 21 segment name 21 structure 21 qualification statements overview 21 qualified calls definition 21 overview 20 qualified SSA structure with command code 27 qualified SSAs (segment search arguments) qualification statement 21 structure 21 qualifying DL/I calls with command codes 26 SSAs 21
retrieval calls D command code 204 F command code 205 L command code 207 status codes, exceptional 9 Retrieve Command (RCMD) call See RCMD call 278 retrieving dependents sequentially 233 first occurrence of a segment 205 last occurrence 206 segments Q command code, Fast Path 209 Q command code, full function 209 sequentially 204 segments with D 204 return codes UIB 77, 377 REXX . (period) usage 351 calls return codes 349 summary 349 syntax 349 commands DL/I calls 349 summary 349 DL/I calls, example 351 execs DFSSAM01 370 DOCMD 370 IVPREXX 375 PART 368 PARTNAME 369 PARTNUM 369 PCBINFO 366 SAY 365 IMSRXTRC, trace output 354 REXX, IMS adapter . (period) usage 353 address environment 344 AIB, specifying 351 description 343 DFSREXX0 program 343, 347 DFSREXX1 343 DFSREXXU user exit 343 DFSRRC00 347 diagram 347 DL/I parameters 350 environment 352 example execs 364 feedback processing 350 I/O area 350 installation 343 IVPREXX exec 347 IVPREXX PSB 345 IVPREXX setup 345 LLZZ processing 350 LNKED requirements 343 non-TSO/E 343 PCB, specifying 351 programs 343 PSB requirements 343 sample generation 345 sample JCL 345 SPA processing 350 Index
393
REXX, IMS adapter (continued) SRRBACK 343 SRRCMIT 343 SSA, specifying 351 SYSEXEC DD 343, 345 system environment 343, 345 SYSTSIN DD 345 SYSTSPRT DD 343, 345 TSO environment 343 TSO/E restrictions 343 ZZ processing 350 REXXIMS commands 355, 357 See also IMSQUERY extended function DLIINFO 352, 353 IMSRXTRC 352, 354 MAPDEF 352 MAPGET 352 MAPPUT 352, 358 SET 352, 359 SRRBACK 352, 360 SRRCMIT 352, 360 STORAGE 352, 360 WTL 352, 362 WTO 352, 362 WTOR 352, 362 WTP 352, 362 REXXTDLI commands 349 RLSE format 247 RLSE (Release) call description 247 parameters 247 usage 247 RMODE 94 ROLB in MPPs and transaction-oriented BMPs 114 ROLB (Roll Back) call compared to ROLL call 113 description 114, 280 format 280 maintaining database integrity 112 parameters 280 usage 114 ROLB call function 307 ROLL (Roll) call compared to ROLB call 113 description 113, 280 format 281 maintaining database integrity 112 ROLL call function 308 ROLS backing out to an intermediate backout point 116 ROLS (Roll Back to SETS) call description 281 format 281 maintaining database integrity 112 parameters 281 TOKEN 115 ROLS call function 308 ROLX call function 308 routines, error 9 RSA (record search argument) description 160 GSAM, reference 85 overview 159
rules coding an SSA 81 RULES parameter FIRST, L command code 207 HERE F command code 206 L command code 207
S
S (STATUS) statement 331 S command code examples 216 subpointer, resetting 216 sample JCL 335 sample programs call-level assembler language, CICS online 32 call-level COBOL, CICS online 39 call-level PL/I, CICS online 50 SAY exec 365 scheduling HALDB (High Availability Large Database) 9 scheduling HALDBs application programs, against 93 secondary indexes multiple qualification statements 150 secondary indexing DB PCB contents 152 effect on programming 149 information returned by DL/I 152 SSAs 149 status codes 152 secondary processing sequence 150 segment requesting using GU 237 segment level number field 71 segment name DB PCB, field 72 SSA, qualification statement 21 segment search argument (SSA) coding rules 81 segment search arguments (SSAs) 20 segment, information needed 28 segments medical database example 13 sensitive segments in DB PCB 72 sequence hierarchy 230 sequence field virtual logical child, in 22 sequence, indication for statements 335 sequential dependent segments how stored 170 sequential dependents 170 overview 170 SET command (REXX) 352, 359 SET SUBFUNC command (REXX) 359 SET ZZ 359 SETO call function 308 SETO, DFSDDLT0 description 300 SETS backing out to an intermediate backout point 116 SETS (Set a Backout Point) call description 116, 282
SETS (Set a Backout Point) call (continued) format 282 parameters 283 SETS call function 308 setting parentage with the P command code 208 subset pointer to zero 218 SETU backing out to an intermediate backout point 116 SETU (Set a Backout Point Unconditional) call description 116, 282 format 282 parameters 283 SETU, call function 116 signon security, RACF 69 single positioning 104 skeleton programs assembler language 29 C language 34 COBOL 36 Pascal 44 PL/I 46 SKIP call function 319 SNAP call description 284 format 284 parameters 284 status codes 286 SNAP call function 308 specifying command codes for DEDBs 181 DB PCB mask 70 GSAM data set attributes 167 processing options for DEDBs 186 Spool API STORAGE command example 362 SRRBACK command (REXX) description 352 format, usage 360 SRRCMIT command (REXX) description 352 format, usage 360 SSA (segment search argument) coding formats 82 restrictions 82 rules 80 coding rules 81 command codes 26 qualification statement 81 reference 80 relational operators 21 restrictions 80 segment name field 81 structure with command code 27 usage command codes 27 guidelines 23 multiple qualification statements 24 virtual logical child, in 22 SSAs (segment search argument) overview 20
394
SSAs (segment search argument) (continued) segment name field 21 SSAs (segment search arguments) 20 definition 20 qualified 21 unqualified 21 usage 226 DLET 226 GN 231 GNP 235 ISRT 240 REPL 246 secondary indexing 149 STAK call function 319 START call function 319 STAT (Statistics) call description 286 format 287 parameters 287 usage 288 STAT call function 308 status code GE (segment not found) 204 status codes blank 8 checking 8 DB PCB, for 262 error routines 9 exceptional call results 9 field in DB PCB 71, 159 FSA 173 GB, end of database 204 GSAM 162 H processing option 186 HALDB (high availability large databases) partitions 9 logical relationships 155 P processing option 186 retrieval calls 9 subset pointers 182 status codes, field in I/O PCB 68 STATUS statement 331 storage !token 360 STORAGE command 360 STORAGE command (REXX) description 352 format, usage 360 subset pointer command codes restrictions 27 subset pointers DEDB, managed by command codes 27 defining, DBD 181 defining, PCB 181 description 178 M command 214 preparing to use 180 R command code 215 resetting 216 S command code 216 sample application 181, 213 status codes 182 using 178 Z command code 218
Summary database management call 219 system service calls 250 summary of changes for DFSDDLT0 internal control statements 298 summary of command codes 26 Symbolic Checkpoint (CHKP Symbolic) 254 format 254 parameters 254 restrictions 255 usage 255 SYNC (Synchronization Point) call description 288 format 289 parameters 289 usage 289 SYNC call function 308 syntax diagram assembler language, DL/I call format 54 C language, DL/I call format 56 COBOL, DL/I call format 59 how to read xi Pascal, DL/I call format 62 PL/I, DL/I call format 64 SYSIN input 335 SYSIN2 input processing 335 system service calls APSB (Allocate PSB) 252 CHKP (Basic) 253 CHKP (Symbolic) 254 DPSB (deallocate) 255 GMSG (Get Message) 256 ICMD (Issue Command) 259 INIT (Initialize) 261 INQY (Inquiry) 266 LOG (Log) 276 PCB (schedule a PSB) 277 RCMD (Retrieve Command) 278 ROLB (Roll Back) 280 SETS/SETU (Set a Backout Point) 282 SNAP 284 STAT (Statistics) 286 SYNC (Synchronization Point) 288 TERM (Terminate) 289 XRST (Extended Restart) 290
U
U (Comment) statement 321 U Command Code 211 UIB (user interface block) defining, in program 77 field names 79 PCB address list, accessing 77 return codes, accessing 77 return codes, list 377 UIBDLTR introduction 78 return codes, checking 377 UIBFCTR introduction 78 return codes, checking 377 UIBPCBAL introduction 78 return codes, checking 377 undefined-length records 159 unqualified calls definition 21 overview 20 unqualified POS call I/O returned area key words 243 map of 243 keywords 243 unqualified SSA structure with command code 27 usage with command codes 27 unqualified SSAs segment name field 21 UOW boundary, processing DEDB 186 updating segments in an MSDB, DEDB or VSO DEDB 171 user interface block See UIB (user interface block) userid indicator, field in I/O PCB 70 userid, field in I/O PCB 69
V
V command code 212 V5SEGRBA 243 variable-length records 159 virtual logical child 22 virtual storage option data entry database (VSO DEDB) See VSO DEDB (virtual storage option data entry database), processing VS COBOL II and Language Environment 91 VSAM, STAT call 288 VSO DEDB (virtual storage option data entry database), processing 171
T
T (Comment) statement 320 TERM (Terminate) call description 289 format 289 usage 290 test program See DL/I Test Program (DFSDDLT0) testing status codes 8 tracing DRA (database resource adapter) 146 transaction-oriented BMPs ROLB 114 TREATMNT segment 14 TSO/E REXX See REXX, IMS adapter
W
WAITAOI 257 WTL command (REXX) description 352 format, usage 362 WTO command (REXX) description 352 format, usage 362 Index
395
WTO statement 334 WTOR command (REXX) description 352 format, usage 362 WTOR statement 335 WTP command (REXX) description 352 format, usage 362 WTSR internal call statement
298
X
XRST (Extended Restart) 255 XRST (Extended Restart) call description 290 format 290 parameters 290 restrictions 293 usage 291 with GSAM 163 XRST call function 308
Z
Z command code examples 218 setting a subpointer to zero z/OS environment 344 218
396
Printed in USA
SC18-7809-04
Spine information:
IMS
Version 9