• No results found

Application Programming: Database Manager

N/A
N/A
Protected

Academic year: 2021

Share "Application Programming: Database Manager"

Copied!
427
0
0

Loading.... (view fulltext now)

Full text

(1)

IMS

Application

Programming:

Database

Manager

Version

9

(2)
(3)

IMS

Application

Programming:

Database

Manager

Version

9

(4)

Note

Beforeusingthisinformationandtheproductitsupports,besuretoreadthegeneralinformationunder“Notices”onpage 373.

FirstEdition(October2004)

ThiseditionappliestoVersion9ofIMS(productnumber5655–J38)andtoallsubsequentreleasesand modificationsuntilotherwiseindicatedinneweditions.

©CopyrightInternationalBusinessMachinesCorporation1974,2004.Allrightsreserved.

(5)

Contents

Figures . . . xiii

Tables . . . xv

About ThisBook . . . xvii

Summaryof Contents . . . xvii

PrerequisiteKnowledge . . . xvii

IBMProductNamesUsedinThisInformation . . . xviii

Howto ReadSyntaxDiagrams . . . xix

Howto SendYour Comments . . . xxi

Summary ofChanges . . . xxiii

ChangestoThis BookforIMSVersion9 . . . xxiii

Technical Changes . . . xxiii

EditorialChanges . . . xxiii

LibraryChangesforIMSVersion9 . . . xxiii

NewandRevisedTitles . . . xxiii

Organizational Changes . . . xxiv

TerminologyChanges . . . xxiv

Accessibility Enhancements. . . xxiv

Part

1.

Writing

Application

Programs

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 1

Chapter1. HowApplicationProgramsWorkwithDatabaseManager . . . . 7

IMSEnvironments . . . 7

DL/I andYourApplicationProgram . . . 9

DL/I Codes. . . 9

Status,Return,andReasonCodes . . . 9

Exceptional ConditionStatusCodes . . . 9

HighAvailability LargeDatabases(HALDBs) . . . 9

Error Routines . . . 10

DatabaseDescriptions (DBDs)andProgramSpecificationBlocks(PSBs) . . . 10

DL/I forCICSOnlineUsers . . . 11

DL/I usingtheODBAInterface . . . 12

DatabaseHierarchyExamples . . . 13

MedicalHierarchyExample . . . 13

BankAccountHierarchyExample . . . 16

Chapter2. WritingYourApplicationPrograms . . . 19

ProgrammingGuidelines . . . 19

SegmentSearchArguments(SSAs) . . . 20

UnqualifiedSSAs . . . 20

QualifiedSSAs . . . 21

SSAGuidelines. . . 22

MultipleQualificationStatements . . . 23

SSAs andCommandCodes . . . 26

Considerationsfor CodingDL/ICalls andDataAreas. . . 27

Preparingto RunYourCICSDL/ICallProgram . . . 28

Examplesof Howto CodeDL/ICallsandDataAreas. . . 29

Coding aBatchProgram inAssemblerLanguage . . . 29

Coding aCICSOnlinePrograminAssemblerLanguage. . . 32

Coding aBatchProgram inCLanguage . . . 34

Coding aBatchProgram inCOBOL . . . 37 ||

(6)

Coding aCICSOnlinePrograminCOBOL . . . 40

Coding aBatchProgram inPascal . . . 45

Coding aBatchProgram inPL/I . . . 48

Coding aCICSOnlinePrograminPL/I . . . 51

Chapter3. DefiningApplicationProgramElements . . . 55

FormattingDL/ICalls forLanguageInterfaces . . . 55

AssemblerLanguageApplicationProgramming . . . 56

Format . . . 56

Parameters . . . 57

Example ofaDL/I CallFormat . . . 58

CLanguageApplicationProgramming . . . 58

Format . . . 58

Parameters . . . 59

I/OArea . . . 61

Example ofaDL/I CallFormat . . . 61

COBOLApplication Programming . . . 61

Format . . . 61

Parameters . . . 62

Example ofaDL/I CallFormat . . . 63

PascalApplicationProgramming . . . 64

Format . . . 64

Parameters . . . 65

Example ofaDL/I CallFormat . . . 66

Application Programmingfor PL/I . . . 66

Format . . . 66

Parameters . . . 67

Example ofaDL/I CallFormat . . . 68

SpecifyingtheI/OPCBMask . . . 69

SpecifyingtheDBPCBMask . . . 72

SpecifyingtheAIB Mask . . . 75

SpecifyingtheAIB Maskfor ODBAApplications. . . 76

SpecifyingtheUIB(CICSOnlineProgramsOnly) . . . 79

SpecifyingtheI/OAreas . . . 82

FormattingSegmentSearchArguments (SSAs). . . 83

SSACodingRules . . . 83

SSACodingFormats. . . 84

GSAM DataAreas . . . 88

TheAIBTDLIInterface . . . 88

LanguageSpecificEntryPoints. . . 89

AssemblerLanguageEntryPoint . . . 89

CLanguageEntryPoint . . . 90

COBOLEntryPoint . . . 90

PascalEntryPoint . . . 91

PL/IEntryPoint. . . 91

CEETDLI,AIBTDLI,andAERTDLIInterfaceConsiderations . . . 91

Program CommunicationBlock(PCB)Lists . . . 92

PCBListFormat . . . 92

GPSBPCBList. . . 92

PCBSummary . . . 92

TheAERTLDIinterface . . . 93

LanguageEnvironments . . . 94

TheCEETDLIinterface toIMS . . . 95

SpecifyingLANG= OptionforPL/ICompatibility . . . 95

Special DL/ISituations . . . 95

(7)

Mixed-Language Programming . . . 96

LanguageEnvironmentRoutineRetention . . . 96

ExtendedAddressingCapabilitiesofz/OS . . . 96

Preloaded Programs. . . 97

Chapter4. CurrentPositionintheDatabaseAfterEachCall. . . 99

CurrentPosition afterSuccessful Calls . . . 99

Position afterRetrievalCalls . . . 100

Position afterDLET. . . 101

Position afterREPL. . . 103

Position afterISRT . . . 103

CurrentPosition afterUnsuccessfulCalls. . . 104

Position afteranUnsuccessfulDLETorREPLCall . . . 104

Position afteranUnsuccessfulRetrievalorISRTCall . . . 105

MultipleProcessing. . . 108

MultiplePositioning. . . 108

Advantagesof UsingMultiplePositioning . . . 111

MultipleDBPCBs . . . 113

Chapter5. RecoveringDatabasesandMaintainingDatabaseIntegrity 115 Issuing Checkpoints . . . 115

RestartingYour ProgramFromtheLatestCheckpoint . . . 115

MaintainingDatabaseIntegrity(IMSBatch,BMP,andIMSOnline Regions) 116 Backing OuttoaPriorCommitPoint:ROLL,ROLB,andROLS . . . 116

Backing OuttoanIntermediateBackoutPoint:SETS, SETU,andROLS 120 Reserving Segmentsfor theExclusive UseofYour Program. . . 122

Chapter6. TheDatabaseResourceAdapter(DRA) . . . 125

Thread Concepts . . . 125

ProcessingThreads . . . 125

ProcessingMultipleThreads . . . 126

CCTLMultithreadExample . . . 126

Sync Points . . . 128

TheTwo-PhaseCommitProtocol. . . 129

In-Doubt StateDuringTwo-PhaseSync . . . 131

DRAStartupTable . . . 132

SampleDFSPZP00SourceCode . . . 132

DFSPRPMacroKeywords . . . 132

Enabling theDRAfor aCCTL . . . 133

Enabling theDRAfor theODBAInterface . . . 134

ProcessingCCTLDRARequests. . . 135

ProcessingODBACalls . . . 136

CCTL-Initiated DRAFunctionRequests . . . 136

INITRequest . . . 136

RESYNC Request . . . 138

TERM Request . . . 139

Thread FunctionRequests . . . 139

PAPLMappingFormat . . . 145

Terminating theDRA . . . 145

DesigningtheCCTLRecoveryProcess . . . 146

CCTLPerformance:MonitoringDRAThreadTCBs . . . 147

DRAThreadStatistics. . . 147

DRAStatistics. . . 149

Tracing . . . 150

SendingCommandstoIMSDB . . . 150

(8)

Chapter7. SecondaryIndexingandLogical Relationships . . . 153

HowSecondaryIndexingAffectsYourProgram . . . 153

SSAs withSecondaryIndexes. . . 153

MultipleQualificationStatementswithSecondaryIndexes . . . 154

DL/I ReturnswithSecondaryIndexes . . . 156

Status Codesfor SecondaryIndexes . . . 156

ProcessingSegments inLogical Relationships. . . 156

HowLogical RelationshipsAffectYour Programming . . . 158

Status Codesfor LogicalRelationships . . . 159

Chapter8. ProcessingGSAMDatabases . . . 161

Accessing GSAMDatabases . . . 161

PCBMasksfor GSAMDatabases . . . 161

Retrieving andInsertingGSAMRecords . . . 163

Explicit OpenandClose CallstoGSAM . . . 164

GSAM RecordFormats . . . 164

GSAM I/OAreas. . . 165

GSAM StatusCodes . . . 165

SymbolicCHKPandXRSTwithGSAM . . . 166

GSAM CodingConsiderations . . . 166

Originof GSAMDataSet Characteristics. . . 167

DDStatementDISPParameterforGSAMDataSets . . . 168

Using ExtendedCheckpointRestartforGSAMDataSets. . . 168

Concatenated DataSetsUsedbyGSAM. . . 169

SuggestedMethodforSpecifyingGSAMDataSetAttributes . . . 169

DLI, DBB,andBMPRegionTypesandGSAM. . . 169

Chapter9. ProcessingFastPathDatabases. . . 171

Fast PathDatabaseCalls . . . 171

Main StorageDatabases(MSDBs) . . . 172

DataEntryDatabases(DEDBs) . . . 173

ProcessingMSDBsandDEDBs . . . 173

UpdatingSegments:REPL,DLET,ISRT,andFLD . . . 173

Commit-PointProcessinginMSDBsandDEDBs . . . 177

VSOConsiderations . . . 178

DataLockingforMSDBsandDEDBs . . . 179

Restrictions onUsingCalls forMSDBs . . . 179

ProcessingDEDBs (IMSandCICSwithDBCTL) . . . 180

ProcessingDEDBswithSubsetPointers . . . 180

Retrieving LocationwiththePOSCall(forDEDBOnly) . . . 185

Commit-PointProcessinginaDEDB . . . 187

PProcessingOption . . . 187

HProcessingOption . . . 188

DataLocking . . . 188

Calls withDependentSegments forDEDBs. . . 189

DirectDependent Segments . . . 189

SequentialDependentSegments. . . 189

Fast PathCoding Considerations. . . 189

Part

2.

Reference

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 191

Chapter10.CommandCode Reference . . . 199

General CommandCodesforDL/I Calls . . . 201

CCommandCode . . . 201

DCommandCode . . . 202

F CommandCode . . . 203 ||

(9)

LCommandCode . . . 204 NCommandCode . . . 205 PCommandCode . . . 206 QCommandCode . . . 206 UCommandCode . . . 209 VCommandCode . . . 210

NULLCommandCode . . . 211

DEDBCommandCodesfor DL/I . . . 211

SampleApplicationProgram . . . 211

M CommandCode . . . 212

RCommandCode . . . 213

SCommandCode . . . 214

WCommand Code . . . 215

Z CommandCode . . . 216

Chapter11.DL/ICallsforDatabaseManagement. . . 217

DatabaseManagement CallSummary. . . 217

CIMS Call . . . 219 Format . . . 219 Parameters. . . 219 Usage. . . 219 CLSECall . . . 220 Format . . . 220 Parameters. . . 220 Usage. . . 221 DEQ Call . . . 221

Format (FullFunction). . . 221

Format (FastPathDEDB) . . . 221

Parameters. . . 221 Usage. . . 222 Restrictions. . . 222 DLETCall . . . 222 Format . . . 222 Parameters. . . 222 Usage. . . 223 FLD Call. . . 223 Format . . . 224 Parameters. . . 224 Usage. . . 224 FSAs . . . 225 GN/GHNCall . . . 226 Format . . . 226 Parameters. . . 226

Usage: GetNext(GN). . . 227

Usage: GetHoldNext(GHN) . . . 229

Usage: HDAM,PHDAM,orDEDBDatabasewithGN . . . 229

Restriction . . . 230

GNP/GHNPCall . . . 230

Format . . . 230

Parameters. . . 230

Usage: GetNextinParent(GNP) . . . 231

Usage: GetHoldNextinParent(GHNP) . . . 233

GU/GHUCall . . . 233

Format . . . 233

Parameters. . . 233

(10)

Usage: GetHoldUnique(GHU) . . . 235 Restriction . . . 235 ISRTCall . . . 235 Format . . . 235 Parameters. . . 236 Usage. . . 237 OPEN Call . . . 239 Format . . . 239 Parameters. . . 239 Usage. . . 239 POSCall . . . 239 Format . . . 240 Parameters. . . 240 Usage. . . 242 Restrictions. . . 242 REPLCall . . . 242 Format . . . 243 Parameters. . . 243 Usage. . . 243

Chapter12.DL/ICallsforSystemServices . . . 245

SystemServiceCallSummary. . . 246

APSBCall . . . 248 Format . . . 248 Parameters. . . 248 Usage. . . 248 CHKP(Basic)Call . . . 249 Format . . . 249 Parameters. . . 249 Usage. . . 249 CHKP(Symbolic)Call. . . 250 Format . . . 250 Parameters. . . 250 Usage. . . 251 Restrictions. . . 251 DPSBCall . . . 251 Format . . . 251 Parameters. . . 251 Usage. . . 252 GMSGCall. . . 252 Format . . . 252 Parameters. . . 252 Usage. . . 253 Restrictions. . . 254 GSCD Call . . . 254 Format . . . 254 Parameters. . . 254 Usage. . . 255 Restriction . . . 255 ICMD Call . . . 255 Format . . . 255 Parameters. . . 255 Usage. . . 256 Restrictions. . . 257 INITCall. . . 257 Format . . . 257

(11)

Parameters. . . 257 Usage. . . 258 Restrictions. . . 262 INQYCall . . . 262 Format . . . 262 Parameters. . . 262 Usage. . . 263 Restrictions. . . 267 LOGCall . . . 267 Format . . . 268 Parameters. . . 268 Usage. . . 269 Restrictions. . . 269

PCBCall(CICSOnlineProgramsOnly) . . . 269

Format . . . 269 Parameters. . . 269 Usage. . . 270 Restrictions. . . 270 RCMDCall. . . 270 Format . . . 270 Parameters. . . 270 Usage. . . 271 Restrictions. . . 271 ROLBCall . . . 271 Format . . . 272 Parameters. . . 272 Restrictions. . . 272 ROLLCall . . . 272 Format . . . 272 Parameters. . . 273 Usage. . . 273 Restriction . . . 273 ROLSCall . . . 273 Format . . . 273 Parameters. . . 273 Usage. . . 274 Restrictions. . . 274 SETS/SETU Call. . . 274 Format . . . 274 Parameters. . . 274 Usage. . . 275 Restrictions. . . 275 SNAPCall . . . 275 Format . . . 276 Parameters. . . 276 Usage. . . 278 Restrictions. . . 278 STATCall . . . 278 Format . . . 278 Parameters. . . 279 Usage. . . 280 Restrictions. . . 280 SYNCCall . . . 280 Format . . . 280 Parameters. . . 281 Usage. . . 281

(12)

Restrictions. . . 281

TERM Call(CICSOnline ProgramsOnly) . . . 281

Format . . . 281 Usage. . . 281 Restrictions. . . 282 XRSTCall . . . 282 Format . . . 282 Parameters. . . 282 Usage. . . 283 Restrictions. . . 285

Chapter13.RelationshipBetweenCallsandAIBandPCBs . . . 287

Chapter14.DL/ITestProgram(DFSDDLT0) . . . 289

Control Statements . . . 290

Planning theControl StatementOrder . . . 291

ABENDStatement . . . 292

ExamplesofABENDStatement . . . 292

CALLStatement . . . 292

CALLFUNCTION Statement . . . 292

CALLDATAStatement . . . 296

OPTION DATAStatement . . . 298

FEEDBACKDATAStatement . . . 298

DL/I CallFunctions . . . 299

Examplesof DL/ICallFunctions . . . 302

CALLFUNCTION StatementwithColumn-SpecificSSAs . . . 310

DFSDDLT0 CallFunctions . . . 311

Examplesof DFSDDLT0CallFunctions . . . 312

COMMENTStatement. . . 313

ConditionalCOMMENTStatement . . . 313

UnconditionalCOMMENTStatement . . . 313

Example ofCOMMENTStatement . . . 313

COMPAREStatement. . . 314

COMPAREDATAStatement . . . 314

COMPAREAIBStatement . . . 315

COMPAREPCBStatement. . . 316

Examplesof COMPAREDATAandCOMPAREPCBStatements . . . 318

IGNOREStatement. . . 320

Example ofIGNOREStatementUsing Nor . . . . 320

OPTION Statement. . . 320

Example ofOPTIONControl Statement . . . 321

PUNCH CTLStatement . . . 321

Example ofPUNCHCTLStatement. . . 323

Example ofPUNCHCTLStatementforAllParameters. . . 324

STATUSStatement. . . 324

Examplesof STATUSStatement . . . 326

WTOStatement . . . 327

Example ofWTOStatement . . . 327

WTOR Statement . . . 327

Example ofWTOR Statement . . . 328

JCLRequirements . . . 328

SYSINDDStatement . . . 329

SYSIN2 DDStatement . . . 329

PRINTDDDDStatement. . . 329

PUNCHDDDDStatement . . . 329

(13)

Executionof DFSDDLT0inIMSRegions . . . 331

Explanation ofDFSDDLT0ReturnCodes. . . 332

DFSDDLT0 Hints . . . 332

Load aDatabase . . . 332

PrinttheSegmentsinaDatabase . . . 333

RetrieveandReplaceaSegment . . . 333

Delete aSegment . . . 334

DoRegressionTesting . . . 334

UseasaDebuggingAid . . . 334

Verify HowaCallIsExecuted . . . 334

Chapter15.IMSAdapterforREXX . . . 335

SampleExitRoutine(DFSREXXU) . . . 336

AddressingOther Environments . . . 336

REXXTransactionPrograms . . . 337

IMSAdapter forREXXOverviewDiagram . . . 338

IVPREXXSampleApplication . . . 339

REXXTDLI Commands . . . 341

REXXTDLI Calls . . . 341

ReturnCodes . . . 341

ParameterHandling . . . 342

Example DL/ICalls . . . 343

REXXIMS ExtendedCommands . . . 344

DLIINFO. . . 345 IMSRXTRC. . . 346 MAPDEF . . . 347 MAPGET . . . 349 MAPPUT . . . 350 SET . . . 351

SRRBACK andSRRCMIT . . . 352

STORAGE . . . 352

WTO,WTP, andWTL . . . 354

WTOR . . . 354

IMSQUERYExtendedFunctions . . . 355

SampleExecsUsingREXXTDLI . . . 356

SAYExec:For ExpressionEvaluation . . . 357

PCBINFOExec:DisplayAvailablePCBsinCurrentPSB . . . 358

PARTExecs:DatabaseAccessExamples . . . 360

DOCMD:IMSCommandsFrontEnd . . . 362

IVPREXX:MPP/IFPFrontEndforGeneralExecExecution . . . 367

Chapter16.CICS-DL/IUserInterface BlockReturnCodes . . . 369

Not-OpenConditions . . . 370

Invalid RequestConditions . . . 370

Part

3.

Appendixes

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 371

Notices . . . 373

ProgrammingInterfaceInformation . . . 375

Trademarks. . . 375

Bibliography . . . 377

IMSVersion9Library . . . 377

SupplementaryPublications. . . 378

Publication Collections . . . 378

(14)
(15)

Figures

1. DL/IProgramElements . . . 8

2. NormalRelationshipbetweenPrograms,PSBs,PCBs, DBDs,andDatabases . . . 10

3. RelationshipbetweenProgramsandMultiplePCBs(ConcurrentProcessing). . . 11

4. TheStructureof aCall-LevelCICSOnlineProgram . . . 11

5. MedicalHierarchy . . . 14

6. SegmentwithaNoncontiguousSequence Field . . . 22

7. DCommandCodeExample. . . 26

8. SampleAssemblerLanguageProgram. . . 30

9. SampleCall-LevelAssemblerLanguageProgram (CICSOnline) . . . 32

10. SampleCLanguageProgram . . . 35

11. SampleCOBOLProgram. . . 38

12. SampleCall-LevelOS/VCOBOLprogram(CICSOnline) . . . 43

13. SamplePascalProgram . . . 46

14. SamplePL/IProgram . . . 48

15. SampleCall-LevelPL/IProgram(CICSOnline). . . 52

16. DefiningtheUIB,PCBAddressList, andthePCBMaskforVSCOBOLII. . . 80

17. DefiningtheUIB,PCBAddressList, andthePCBMaskforOS/VSCOBOL . . . 81

18. TheCOBOLCOPYDLIUIB CopyBook . . . 81

19. DefiningtheUIB,PCBAddressList, andthePCBMaskforPL/I . . . 82

20. DefiningtheUIB,PCBAddressList, andthePCBMaskforAssemblerLanguage . . . 82

21. ExampleCode:*CONSTANTAREA . . . 85

22. QualifiedSSAwithoutCommandCodes . . . 87

23. CurrentPositionHierarchy . . . 100

24. ExampleCode:DeletingSegmentC11 . . . 101

25. HierarchyafterDeletingaSegment . . . 102

26. HierarchyafterDeletingaSegmentandDependents . . . 102

27. HierarchyafterAddingNewSegments andDependents . . . 104

28. DL/IPositions . . . 105

29. MultipleProcessing . . . 108

30. MultiplePositioningHierarchy. . . 109

31. SingleandMultiplePositioningHierarchy . . . 110

32. SETSandROLSCalls WorkingTogether . . . 120

33. ODBATwo-PhaseSyncPointProcessing . . . 131

34. DRAComponent StructurewiththeODBAInterface . . . 135

35. ExampleofUsing theDependentAND . . . 155

36. ExampleofUsing theIndependentAND. . . 155

37. PatientandItemHierarchies . . . 157

38. ConcatenatedSegment . . . 158

39. //IMSDDStatementExample. . . 170

40. SamplePCBSpecifyingView=MSDB. . . 178

41. ProcessingaLongChainof SegmentOccurrenceswithSubsetPointers. . . 181

42. Examplesof SettingSubsetPointers . . . 181

43. AdditionalExamplesof SettingSubsetPointers . . . 182

44. HowSubsetPointersDivideaChainintoSubsets . . . 182

45. UCommandCodeExample . . . 209

46. ProcessingforthePassbookExample . . . 212

47. MovingtheSubsetPointer totheNextSegmentafterYourCurrentPosition . . . 213

48. RetrievingtheFirstSegmentina ChainofSegments . . . 214

49. UnconditionallySettingtheSubsetPointerto YourCurrentPosition. . . 215

50. ConditionallySettingtheSubsetPointer toYourCurrentPosition. . . 216

51. HierarchicSequence . . . 228

52. I/OAreafor SNAPOperationParameters . . . 276

53. ExampleJCLCodeforDDStatementDefinition . . . 328 ||

(16)

54. ExampleJCLCodeforDFSDDLT0inaBMP . . . 328

55. UsingtheBindertoCopytheNameIVPREXX . . . 337

56. JCLCodeUsedto RuntheIVPREXXSampleExec . . . 338

57. IMSAdapterforREXXLogicalOverview Diagram . . . 339

58. ExecToDoCalculations . . . 357

59. PDFEDITSession ontheSAYExec . . . 357

60. ExampleOutputfromtheSAYExec . . . 357

61. ExampleOutputofPCBINFOExeconaPSBwithoutDatabasePCBs. . . . 358

62. ExampleOutputofPCBINFOExeconaPSBwithaDatabasePCB. . . . 358

63. PCBINFOExec Listing . . . 359

64. ExampleOutputofPARTNUMExec . . . 360

65. ExampleOutputofPARTNAMEExec. . . 360

66. PARTNUMExec: ShowSet ofPartsNeara SpecifiedNumber . . . 361

67. PARTNAMEExec:ShowPartswithSimilarNames. . . 362

68. Outputfrom=>DOCMD . . . 363

69. Outputfrom=>DOCMD/DISNODEALL;? . . . 363

70. Outputfrom=>DOCMD/DISNODEALL;CID>0 . . . 363

71. Outputfrom=>DOCMD/DISNODEALL;TYPE=SLU2 . . . 364

72. Outputfrom=>DOCMD/DISTRANALL;ENQCT>0&RECTYPE=’T02’. . . 364

73. Outputfrom=>DOCMD/DISLTERMALL;ENQCT>0 . . . 364

(17)

Tables

1. LicensedProgramFullNamesandShortNames . . . xviii

2. PATIENTSegment . . . 14 3. ILLNESSSegment . . . 15 4. TREATMNTSegment . . . 15 5. BILLINGSegment . . . 15 6. PAYMENTSegment. . . 15 7. HOUSEHOLDSegment . . . 16

8. TellerSegmentinaFixedRelatedMSDB. . . 16

9. BranchSummarySegmentinaDynamicRelatedMSDB . . . 17

10. AccountSegmentina NonrelatedMSDB . . . 17

11. QualifiedSSAStructure . . . 21

12. UnqualifiedSSAwithCommandCode . . . 27

13. QualifiedSSAwithCommandCode . . . 27

14. I/OPCBMask. . . 69

15. DBPCBMask. . . 72

16. AIBFields . . . 75

17. AIBFieldsforUseofODBAApplications . . . 76

18. RelationalOperators . . . 84

19. I/OPCBandAlternatePCBInformationSummary . . . 93

20. UsingLANG=OptioninaLanguageEnvironmentforPL/ICompatibility . . . 95

21. ResultsofSingleandMultiplePositioningwithDL/ICalls . . . 110

22. Comparisonof ROLB,ROLL,andROLS. . . 117

23. ExampleofEventsinaMultithreadingSystem . . . 127

24. CCTLSingle-PhaseSyncPoint Processing. . . 130

25. CCTLTwo-PhaseSyncPointProcessing . . . 130

26. InformationProvidedfortheScheduleProcess: . . . 147

27. InformationProvidedatUORTermination: . . . 148

28. GSAMDBPCBMask . . . 162

29. SummaryofGSAMCalls . . . 167

30. SummaryofFastPathDatabaseCalls . . . 171

31. SubsetPointer CommandCodesandCalls . . . 172

32. FSAStructure . . . 174

33. UnqualifiedSSAwithSubsetPointerCommandCode. . . 183

34. QualifiedSSAwithSubsetPointerCommandCode . . . 183

35. QualifiedPOSCall:KeywordsandMapofI/OAreaReturned . . . 186

36. SummaryofCommandCodes . . . 199

37. CommandCodesandRelatedCalls . . . 200

38. CommandCodesforDL/I Calls . . . 200

39. SummaryofDBCalls . . . 218

40. UnqualifiedPOSCall:KeywordsandMapoftheI/OAreaReturnOutput. . . 241

41. SummaryofSystemServiceCalls . . . 246

42. GMSGSupport byApplicationRegionType . . . 254

43. ICMDSupportbyApplicationRegion Type . . . 256

44. INITDBQUERY:ExamplesforASMTDLI,CBLTDLI,CTDLI,andPASTDLI . . . 258

45. INITDBQUERY:I/OAreaExample forPLITDLI . . . 258

46. INITI/OAreaExamplesforASMTDLI,CBLTDLI,CTDLI, andPASTDLI . . . 259

47. INITI/OAreaExamplesfor PLITDLI . . . 260

48. INITI/OAreaExamplesforASMTDLI,CBLTDLI,CTDLI, andPASTDLI . . . 260

49. INITI/OAreaExamplesfor PLITDLI . . . 261

50. INQYENVIRONDataOutput. . . 264

51. Subfunction,PCB,andI/OAreaCombinations fortheINQYCall. . . 267

52. LogRecordFormatsforCOBOL,C,Assembler,Pascal,andPL/IProgramsfor theAIBTDLI, ASMTDLI,CBLTDLI,CEETDLI, CTDLI,andPASTDLIInterfaces. . . 268

(18)

53. LogRecordFormatsforCOBOL,C,Assembler,Pascal,andPL/IProgramsfor thePLITDLI

Interface . . . 268

54. RCMDSupportbyApplicationRegionType . . . 271

55. SNAPOperationParameters . . . 277

56. CallRelationship toPCBs . . . 287

57. SummaryofDFSDDLT0Control Statements . . . 290

58. ABENDStatement. . . 292

59. CALLFUNCTIONStatement . . . 293

60. CALLDATAStatement . . . 296

61. OPTIONDATAStatement . . . 298

62. FEEDBACKDATAStatement. . . 298

63. DL/ICallFunctions . . . 299

64. CALLFUNCTIONStatement(Column-SpecificSSAs). . . 310

65. CALLFUNCTIONStatementwithDFSDDLT0CallFunctions . . . 311

66. COMMENTStatement . . . 313

67. COMPAREDATAStatement . . . 314

68. COMPAREAIB Statement . . . 316

69. COMPAREPCBStatement . . . 316 70. IGNOREStatement . . . 320 71. OPTIONStatement . . . 320 72. PUNCHCTLStatement . . . 321 73. STATUSStatement . . . 324 74. WTOStatement. . . 327 75. WTORStatement . . . 327

76. IMSAdapterforREXXParameterTypesandDefinitions. . . 343

77. REXXIMSExtendedCommands. . . 345

78. ReturnCodesinUIBFCTR. . . 369

79. ReturnCodesinUIBDLTRif UIBFCTR='0C'(NOTOPEN) . . . 369

(19)

About

This

Book

This informationisavailable aspartof theDB2® InformationManagementSoftware

InformationCenterfor z/OS®Solutions.ToviewtheinformationwithintheDB2

InformationManagement SoftwareInformationCenterfor z/OSSolutions,goto http://publib.boulder.ibm.com/infocenter/dzichelp. Thisinformationisalsoavailablein PDFandBookManager® formats.TogetthemostcurrentversionsofthePDFand

BookManager formats,goto theIMS™Librarypageat

www.ibm.com/software/data/ims/library.html.

This bookisaguidetoapplicationprogramminginanIMSDatabaseManager(IMS DB)environment.ItcoversbasicinformationoncodingDL/IcallsforDBprograms. Thebook isdesignedto provideguidancefor applicationprogrammerswho usethe IMSDBenvironmentto createandrunapplicationprograms. Portionsof thisbook areforprogrammerswho useIMSfroma CustomerInformationControl System (CICS®)environment.

This bookalso containsinformationontheDBCTLenvironment.DBCTLis generated byIMSDB,containsnodata communicationcomponents,andis designedto functionasadatabasemanagerfornon-IMStransactionmanagement systems.

WithIMSVersion9,youcan reorganizeHALDBpartitionsonline,eitherbyusing theintegratedHALDBOnlineReorganizationfunction orbyusinganexternal product.In thisinformation,thetermHALDBOnlineReorganizationrefersto the integratedHALDBOnlineReorganizationfunctionthatispartofIMSVersion9, unless otherwiseindicated.

Summary

of

Contents

This bookhastwoparts:

v Part1, “WritingApplication Programs,”onpage1 providesbasicinformationon

codingDL/Icallsfor IMSDBprograms,informationthatyou canuseto interactivelydevelopREXXEXECsunderTSO/Eandexecutethem inIMS MPPs,BMPs,IFPs,orbatchregions.

v Part2, “Reference,”onpage191providesadditional informationthatyou needto

writeandtestyour applicationprograms.

Prerequisite

Knowledge

IBM®offersa widevariety ofclassroomandself-studycourses tohelpyoulearn IMS.For acompletelist,seetheIMShomepageontheWorldWideWebat: www.ibm.com/ims.

Beforeusingthis book,youshouldunderstandtheconceptsofapplicationdesign presentedinIMSVersion9:ApplicationProgramming:DesignGuide,which assumesyouunderstandbasicIMSconceptsandthevarious environments. This bookisanextensiontoIMSVersion9:ApplicationProgramming:Design Guide.TheIMSconceptsexplained inthismanualarelimitedto thoseconcepts thatarepertinentto developingandcodingapplicationprograms.Youshouldalso knowhow touseassemblerlanguage,Clanguage,COBOL,Pascal,orPL/I.CICS programs canbewritteninassemblerlanguage,Clanguage,COBOL,PL/I,and C++.

(20)

IBM

Product

Names

Used

in

This

Information

In thisinformation,thelicensedprogramsshowninTable1arereferredto bytheir short names.

Table1.LicensedProgramFullNamesandShortNames

Licensedprogramfullname Licensedprogramshortname IBMApplicationRecoveryToolforIMSand

DB2

ApplicationRecoveryTool IBMCICSTransactionServerforOS/390® CICS

IBMCICSTransactionServerforz/OS CICS

IBMDB2UniversalDatabase™ DB2UniversalDatabase

IBMDB2UniversalDatabaseforz/OS DB2UDBforz/OS IBMEnterpriseCOBOLforz/OSandOS/390 EnterpriseCOBOL IBMEnterprisePL/Iforz/OSandOS/390 EnterprisePL/I IBMHighLevelAssemblerforMVS™&VM&

VSE

HighLevelAssembler

IBMIMSAdvancedACBGenerator IMSAdvancedACBGenerator IBMIMSBatchBackoutManager IMSBatchBackoutManager IBMIMSBatchTerminalSimulator IMSBatchTerminalSimulator IBMIMSBufferPoolAnalyzer IMSBufferPoolAnalyzer IBMIMSCommandControlFacilityforz/OS IMSCommandControlFacility IBMIMSConnectforz/OS IMSConnect

IBMIMSConnectorforJava™ IMSConnectorforJava

IBMIMSDatabaseControlSuite IMSDatabaseControlSuite IBMIMSDatabaseRecoveryFacilityforz/OS IMSDatabaseRecoveryFacility IBMIMSDatabaseRepairFacility IMSDatabaseRepairFacility IBMIMSDataPropagator™forz/OS IMSDataPropagator

IBMIMSDEDBFastRecovery IMSDEDBFastRecovery IBMIMSExtendedTerminalOptionSupport IMSETOSupport

IBMIMSFastPathBasicTools IMSFastPathBasicTools IBMIMSFastPathOnlineTools IMSFastPathOnlineTools IBMIMSHardwareData

Compression-Extended

IMSHardwareDataCompression-Extended IBMIMSHighAvailabilityLargeDatabase

(HALDB)ConversionAidforz/OS

IBMIMSHALDBConversionAid IBMIMSHighPerformanceChange

AccumulationUtilityforz/OS

IMSHighPerformanceChangeAccumulation Utility

IBMIMSHighPerformanceLoadforz/OS IMSHPLoad IBMIMSHighPerformancePointerChecker

forOS/390

IMSHPPointerChecker IBMIMSHighPerformancePrefixResolution

forz/OS

IMSHPPrefixResolution IBMTivoli®NetView®forz/OS TivoliNetViewforz/OS

IBMWebSphere®ApplicationServerforz/OS

andOS/390

(21)

Table1.LicensedProgramFullNamesandShortNames (continued)

Licensedprogramfullname Licensedprogramshortname IBMWebSphereMQforz/OS WebSphereMQ

IBMWebSphereStudioApplicationDeveloper IntegrationEdition

WebSphereStudio

IBMz/OS z/OS

Additionally,thisinformationmightcontainreferencestothefollowingIBMproduct names:

v ″IBMC/C++forMVS″or″IBMC/C++for MVS/ESA″isreferredto aseither

″C/MVS″ or″C++/MVS.″

v ″IBMCICSfor MVS″isreferred toas″CICS.″

v ″IBMCOBOLfor MVS&VM,″″IBMCOBOLforOS/390&VM,″or ″IBMCOBOL

forz/OS &VM″isreferredto as″COBOL.″

v ″IBMDataAtlasfor OS/2″isreferredto as″DataAtlas.″

v ″IBMLanguageEnvironmentfor MVS&VM″ isreferred toas″Language

Environment.″

v ″IBMPL/Ifor MVS&VM″ or″IBMPL/Ifor OS/390&VM″isreferredto as″PL/I.″

How

to

Read

Syntax

Diagrams

Thefollowingrules applytothesyntaxdiagramsthatareused inthisinformation:

v Readthesyntax diagramsfromlefttoright, fromtopto bottom,followingthepath

oftheline.Thefollowingconventionsareused:

– The>>--- symbolindicatesthebeginningofa syntaxdiagram.

– The--->symbolindicates thatthesyntaxdiagram iscontinuedonthenext

line.

– The>---symbolindicates thata syntaxdiagramiscontinuedfromthe

previousline.

– The--->< symbolindicatestheendofa syntaxdiagram. v Requireditemsappearonthehorizontalline(themain path).

required_item

v Optionalitemsappearbelowthemainpath.

required_item

optional_item

Ifanoptionalitemappears abovethemainpath, thatitemhasnoeffectonthe executionofthesyntaxelement andisused onlyfor readability.

optional_item

required_item

v Ifyoucanchoose fromtwoormoreitems,theyappearvertically,inastack.

Ifyoumust chooseoneoftheitems,oneitemof thestackappearsonthemain path.

(22)

required_item required_choice1 required_choice2

Ifchoosingoneoftheitemsisoptional,theentire stackappears belowthemain path.

required_item

optional_choice1 optional_choice2

Ifoneof theitemsisthedefault,itappearsabovethemainpath, andthe remainingchoicesareshownbelow.

required_item

default_choice optional_choice optional_choice

v Anarrow returningtotheleft,abovethemainline,indicatesanitemthatcanbe

repeated.

required_item repeatable_item

Iftherepeatarrow containsacomma,youmust separaterepeateditemswitha comma.

required_item

,

repeatable_item

Arepeatarrow aboveastackindicatesthatyoucanrepeattheitemsinthe stack.

v Sometimesadiagrammustbesplitintofragments.Thesyntaxfragmentis

shownseparatelyfromthemainsyntax diagram,butthecontentsofthefragment shouldbereadasif theyareonthemainpath ofthediagram.

required_item fragment-name

fragment-name: required_item

optional_item

v InIMS,ab symbolindicatesoneblankposition.

v Keywords,andtheirminimumabbreviationsif applicable,appearinuppercase.

Theymust bespelled exactlyasshown.Variables appearinalllowercaseitalic letters(forexample,column-name).They representuser-suppliednamesor values.

v Separatekeywordsandparametersbyat leastonespaceif nointervening

(23)

v Enterpunctuationmarks,parentheses,arithmeticoperators, andothersymbols,

exactlyasshowninthediagram.

v Footnotesareshownbyanumberinparentheses,for example(1).

How

to

Send

Your

Comments

Your feedbackisimportant inhelpingusprovidethemostaccurate andhighest quality information.Ifyouhave anycommentsaboutthisor anyotherIMS information, youcantakeoneofthefollowingactions:

v GototheIMSLibrarypage atwww.ibm.com/software/data/ims/library.htmland

clicktheLibraryFeedbacklink,whereyou canenterandsubmitcomments.

v Sendyourcommentsbye-mailto [email protected] suretoinclude the

title,thepartnumberofthetitle,theversionof IMS,and, ifapplicable,the specificlocationof thetextonwhich youarecommenting(forexample,apage numberinthePDFora headingintheInformationCenter).

(24)
(25)

Summary

of

Changes

Changes

to

This

Book

for

IMS

Version

9

This bookcontainsnewtechnicalinformationfor IMSVersion9, aswellaseditorial changes.

Technical

Changes

Newinformationonthefollowingenhancementsisincluded:

v ThesamplePL/Icode in“CodingaBatchProgram inPL/I”onpage48hasbeen

modified.

v ThesampleCICSPL/Icode in“Coding aCICSOnlinePrograminPL/I”onpage

51has beenmodified.

v Codinga batchprograminCOBOLincludesnew information.Formore

information,see“Coding aBatchPrograminCOBOL”onpage37.

v Issuinga POScall includesnew information.For moreinformation,see“POS

Call”onpage239.

v AIBhasbeenaddedtoTable56onpage 287.Formoreinformation,see

Chapter13,“RelationshipBetween CallsandAIBandPCBs,”onpage287.

Editorial

Changes

Thefollowingorganizational changeshave beenmadeto thisbook:

v “SegmentSearchArguments (SSAs)”onpage20hasbeenmovedfrom

Chapter1, “HowApplicationProgramsWorkwithDatabaseManager,”onpage7 toChapter2,“WritingYourApplicationPrograms,”onpage 19.

v “MultipleQualification Statements”onpage23hasbeenaddedto“Segment

SearchArguments (SSAs)”onpage20.

For detailedinformationabout technicalenhancementsforIMSVersion9,seethe

IMSVersion9: ReleasePlanningGuide.

Library

Changes

for

IMS

Version

9

Changesto theIMSLibraryforIMSVersion9include theaddition ofonetitle, a changeof onetitle,organizationalchanges,andamajor terminologychange. Changesareindicatedbyaverticalbar(|)totheleftofthechanged text.

TheIMSVersion9informationisnowavailableintheDB2InformationManagement SoftwareInformationCenterfor z/OSSolutions,whichisavailableat

http://publib.boulder.ibm.com/infocenter/dzichelp. TheDB2InformationManagement SoftwareInformationCenterfor z/OSSolutionsprovidesagraphicaluserinterface for centralizedaccesstotheproductinformationforIMS,IMSTools, DB2Universal Database(UDB)forz/OS, DB2Tools,andDB2QueryManagementFacility

(QMF™).

New

and

Revised

Titles

Thefollowinglist detailsthemajorchangestotheIMSVersion9 library:

(26)

Thelibraryincludesnew information:IMSVersion 9:IMSConnectGuideand Reference.Thisinformationisavailableinsoftcopyformat only,aspartofthe DB2InformationManagementSoftwareInformationCenterforz/OS Solutions, andinPDFandBookManagerformats.

IMSVersion9 providesanintegratedIMSConnectfunction,which offersa functionalreplacementfor theIMSConnecttool(programnumber5655-K52).In thisinformation,thetermIMSConnectrefers totheintegratedIMSConnect functionthatispartofIMSVersion9,unlessotherwiseindicated.

v TheinformationformerlytitledIMSVersion8: IMSJavaUser’sGuideisnow

titledIMSVersion9: IMSJavaGuideandReference.Thisinformationis availableinsoftcopyformat only,aspartoftheDB2InformationManagement SoftwareInformationCenterforz/OSSolutions,andinPDFandBookManager formats.

v TocomplementtheIMSVersion9 library,anewbook,AnIntroductionto IMSby

DeanH.Meltz,RickLong,MarkHarrington,RobertHain,andGeoffNicholls (ISBN#0-13-185671-5),isavailablestartingFebruary2005fromIBMPress.Go totheIMSWebsite atwww.ibm.com/imsfordetails.

Organizational

Changes

OrganizationchangestotheIMSVersion9libraryincludechangesto:

v IMSVersion9:IMSJavaGuideandReference v IMSVersion9:MessagesandCodes, Volume1 v IMSVersion9:UtilitiesReference: System

Thechaptertitled″DLIModelUtility″ hasmovedfromIMSVersion9: IMSJava GuideandReferenceto IMSVersion 9:UtilitiesReference:System.

TheDLIModelutilitymessages thatwere inIMSVersion9: IMSJavaGuideand Referencehave movedtoIMSVersion9: MessagesandCodes,Volume1.

Terminology

Changes

IMSVersion9introducesnew terminologyforIMScommands:

type-1 command

Acommand,generallyprecededbya leadingslashcharacter,thatcanbe enteredfromanyvalidIMScommandsource.In IMSVersion8, these commands werecalledclassiccommands.

type-2 command

AcommandthatisenteredonlythroughtheOMAPI.Type-2commands aremoreflexiblethantype-2commandsandcanhave abroaderscope.In IMSVersion8,thesecommandswerecalled IMSplexcommandsor

enhancedcommands.

Accessibility

Enhancements

Accessibility featureshelpa userwhohasa physicaldisability,suchasrestricted mobilityorlimited vision,to usesoftwareproducts.Themajor accessibilityfeatures inz/OSproducts,includingIMS,enableusersto:

v Useassistivetechnologiessuchasscreenreadersandscreenmagnifier

software

v Operatespecificorequivalentfeaturesusingonly thekeyboard v Customizedisplayattributessuchascolor,contrast,andfontsize

(27)

User

Assistive

Technologies

Assistivetechnology products,suchasscreenreaders,functionwiththeIMSuser interfaces.Consultthedocumentationof theassistive technologyproductsfor specificinformationwhenyouuseassistive technologytoaccesstheseinterfaces.

Accessible

Information

Online informationforIMSVersion9isavailableinBookManager format,whichis anaccessibleformat.AllBookManagerfunctionscanbeaccessedbyusinga keyboardorkeyboardshortcutkeys.BookManageralso allowsyouto usescreen readersandotherassistive technologies.TheBookManagerREAD/MVS productis includedwiththez/OSbaseproduct,andtheBookManagerSoftcopyReader(for workstations) isavailableontheIMSLicensedProductKit(CD),whichyoucan downloadfromtheWebatwww.ibm.com.

Keyboard

Navigation

of

the

User

Interface

Userscan accessIMSuserinterfacesusingTSO/EorISPF.Refertothez/OS V1R1.0TSO/EPrimer,thez/OSV1R5.0TSO/EUser’sGuide,andthez/OS V1R5.0ISPFUser’sGuide,Volume1.Theseguidesdescribehowtonavigateeach interface,includingtheuseofkeyboardshortcutsorfunctionkeys(PFkeys).Each guideincludesthedefaultsettingsfor thePFkeysandexplainshow tomodifytheir functions.

(28)
(29)

Part

1.

Writing

Application

Programs

Chapter1. HowApplicationProgramsWorkwithDatabaseManager . . . . 7

IMSEnvironments . . . 7

DL/I andYourApplicationProgram . . . 9

DL/I Codes. . . 9 Status,Return,andReasonCodes . . . 9

Exceptional ConditionStatusCodes . . . 9

HighAvailability LargeDatabases(HALDBs) . . . 9

Error Routines . . . 10

DatabaseDescriptions (DBDs)andProgramSpecificationBlocks(PSBs) . . . 10

DL/I forCICSOnlineUsers . . . 11

DL/I usingtheODBAInterface . . . 12

DatabaseHierarchyExamples . . . 13

MedicalHierarchyExample . . . 13

BankAccountHierarchyExample . . . 16

RelatedMSDBs . . . 16

Nonrelated MSDBs . . . 17 Chapter2. WritingYourApplicationPrograms . . . 19

ProgrammingGuidelines . . . 19

SegmentSearchArguments(SSAs) . . . 20

UnqualifiedSSAs . . . 20

QualifiedSSAs . . . 21

Sequence FieldsofaVirtual LogicalChild. . . 22 SSAGuidelines. . . 22 MultipleQualificationStatements . . . 23

Example ofHowtoUseMultipleQualificationStatements . . . 25

MultipleQualificationStatementsforHDAM, PHDAM,orDEDB . . . 25

SSAs andCommandCodes . . . 26

Considerationsfor CodingDL/ICalls andDataAreas. . . 27 Preparingto RunYourCICSDL/ICallProgram . . . 28

Examplesof Howto CodeDL/ICallsandDataAreas. . . 29 Coding aBatchProgram inAssemblerLanguage . . . 29

BindingAssemblerCodetotheIMSLanguageInterfaceModule . . . . 32

Coding aCICSOnlinePrograminAssemblerLanguage. . . 32 Coding aBatchProgram inCLanguage . . . 34

BindingCCodetotheLanguageInterfaceModule. . . 37 Coding aBatchProgram inCOBOL . . . 37

BindingCOBOLCodetotheIMSLanguageInterfaceModule . . . 40

Coding aCICSOnlinePrograminCOBOL . . . 40

EnsuringAddressabilityUsingtheCOBOLOptimizationFeature(CICS

Online Only) . . . 45

Coding aBatchProgram inPascal . . . 45

BindingPascalCodetotheIMSLanguageInterface Module . . . 47

Coding aBatchProgram inPL/I . . . 48

BindingPL/ICodetotheIMSLanguageInterfaceModule . . . 50

Coding aCICSOnlinePrograminPL/I . . . 51 Chapter3. DefiningApplicationProgramElements . . . 55

FormattingDL/ICalls forLanguageInterfaces . . . 55

AssemblerLanguageApplicationProgramming . . . 56

Format . . . 56

Parameters . . . 57

Example ofaDL/I CallFormat . . . 58 || || || || || ||

(30)

CLanguageApplicationProgramming . . . 58

Format . . . 58

Parameters . . . 59

I/OArea . . . 61

Example ofaDL/I CallFormat . . . 61

COBOLApplication Programming . . . 61

Format . . . 61

Parameters . . . 62

Example ofaDL/I CallFormat . . . 63

PascalApplicationProgramming . . . 64

Format . . . 64

Parameters . . . 65

Example ofaDL/I CallFormat . . . 66

Application Programmingfor PL/I . . . 66

Format . . . 66

Parameters . . . 67

Example ofaDL/I CallFormat . . . 68

SpecifyingtheI/OPCBMask . . . 69

SpecifyingtheDBPCBMask . . . 72

SpecifyingtheAIB Mask . . . 75

SpecifyingtheAIB Maskfor ODBAApplications. . . 76 SpecifyingtheUIB(CICSOnlineProgramsOnly) . . . 79

SpecifyingtheI/OAreas . . . 82

FormattingSegmentSearchArguments (SSAs). . . 83 SSACodingRules . . . 83

SSACodingFormats. . . 84 AssemblerLanguageSSADefinitionExamples . . . 84

CLanguageSSADefinitionExamples . . . 85

COBOLSSADefinition Examples . . . 86

PascalSSADefinition Examples . . . 86

PL/ISSADefinitionExamples . . . 87

GSAM DataAreas . . . 88

TheAIBTDLIInterface . . . 88

LanguageSpecificEntryPoints. . . 89 AssemblerLanguageEntryPoint . . . 89

CLanguageEntryPoint . . . 90

COBOLEntryPoint . . . 90

PascalEntryPoint . . . 91

PL/IEntryPoint. . . 91 CEETDLI,AIBTDLI,andAERTDLIInterfaceConsiderations . . . 91

Program CommunicationBlock(PCB)Lists . . . 92

PCBListFormat . . . 92

GPSBPCBList. . . 92 PCBSummary . . . 92

TheAERTLDIinterface . . . 93

LanguageEnvironments . . . 94

TheCEETDLIinterface toIMS . . . 95

SpecifyingLANG= OptionforPL/ICompatibility . . . 95

Special DL/ISituations . . . 95

Application ProgramSchedulingagainstHALDBs . . . 95

Mixed-Language Programming . . . 96

LanguageEnvironmentRoutineRetention . . . 96

ExtendedAddressingCapabilitiesofz/OS . . . 96

Preloaded Programs. . . 97

(31)

CurrentPosition afterSuccessful Calls . . . 99

Position afterRetrievalCalls . . . 100

Position afterDLET. . . 101 Position afterREPL. . . 103 Position afterISRT . . . 103

CurrentPosition afterUnsuccessfulCalls. . . 104 Position afteranUnsuccessfulDLETorREPLCall . . . 104

Position afteranUnsuccessfulRetrievalorISRTCall . . . 105

MultipleProcessing. . . 108 MultiplePositioning. . . 108 Advantagesof UsingMultiplePositioning . . . 111

HowMultiplePositioningAffectsYour Program. . . 111 Resetting PositionwithMultiplePositioning . . . 113

MultipleDBPCBs . . . 113 Chapter5. RecoveringDatabasesandMaintainingDatabaseIntegrity 115 Issuing Checkpoints . . . 115

RestartingYour ProgramFromtheLatestCheckpoint . . . 115

MaintainingDatabaseIntegrity(IMSBatch,BMP,andIMSOnline Regions) 116 Backing OuttoaPriorCommitPoint:ROLL,ROLB,andROLS . . . 116

ROLL . . . 117

ROLB . . . 118

ROLS . . . 119

Backing OuttoanIntermediateBackoutPoint:SETS, SETU,andROLS 120 SETSandSETUCalls . . . 120

ROLS. . . 122 Reserving Segmentsfor theExclusive UseofYour Program. . . 122

Chapter6. TheDatabaseResourceAdapter(DRA) . . . 125

Thread Concepts . . . 125

ProcessingThreads . . . 125

Processinga CCTLThread . . . 126

ProcessinganODBAThread . . . 126

ProcessingMultipleThreads . . . 126

ProcessingMultipleCCTLThreads . . . 126

ProcessingMultipleODBAThreads . . . 126

CCTLMultithreadExample . . . 126

Sync Points . . . 128

TheTwo-PhaseCommitProtocol. . . 129 In-Doubt StateDuringTwo-PhaseSync . . . 131

DRAStartupTable . . . 132

SampleDFSPZP00SourceCode . . . 132

DFSPRPMacroKeywords . . . 132

Enabling theDRAfor aCCTL . . . 133

Enabling theDRAfor theODBAInterface . . . 134

ProcessingCCTLDRARequests. . . 135 ProcessingODBACalls . . . 136

CCTL-Initiated DRAFunctionRequests . . . 136

INITRequest . . . 136

INITRequest,Identifyto DBCTL . . . 137

INITRequestafteraPreviousDRASessionTermination . . . 138

RESYNC Request . . . 138

TERM Request . . . 139

Thread FunctionRequests . . . 139

SCHED Request. . . 139 IMSRequest . . . 141

(32)

SYNTERM Request . . . 142

PREPRequest . . . 143

COMTERM Request . . . 143

ABTTERMRequest. . . 144 TERMTHRDRequest . . . 144

PAPLMappingFormat . . . 145

Terminating theDRA . . . 145

DesigningtheCCTLRecoveryProcess . . . 146

CCTLPerformance:MonitoringDRAThreadTCBs . . . 147

DRAThreadStatistics. . . 147 DRAStatistics. . . 149 EvaluatingtheDRAStatistics . . . 149

Tracing . . . 150

SendingCommandstoIMSDB . . . 150

ProblemDiagnosis . . . 150

SDUMP . . . 151

SNAP. . . 151

Chapter7. SecondaryIndexingandLogical Relationships . . . 153

HowSecondaryIndexingAffectsYourProgram . . . 153

SSAs withSecondaryIndexes. . . 153 MultipleQualificationStatementswithSecondaryIndexes . . . 154

TheDependentAND . . . 154

TheIndependentAND. . . 155 DL/I ReturnswithSecondaryIndexes . . . 156

Status Codesfor SecondaryIndexes . . . 156

ProcessingSegments inLogical Relationships. . . 156 HowLogical RelationshipsAffectYour Programming . . . 158

Status Codesfor LogicalRelationships . . . 159 Chapter8. ProcessingGSAMDatabases . . . 161

Accessing GSAMDatabases . . . 161

PCBMasksfor GSAMDatabases . . . 161

Retrieving andInsertingGSAMRecords . . . 163

Explicit OpenandClose CallstoGSAM . . . 164

GSAM RecordFormats . . . 164

GSAM I/OAreas. . . 165 GSAM StatusCodes . . . 165

SymbolicCHKPandXRSTwithGSAM . . . 166

GSAM CodingConsiderations . . . 166

Originof GSAMDataSet Characteristics. . . 167 DDStatementDISPParameterforGSAMDataSets . . . 168

Using ExtendedCheckpointRestartforGSAMDataSets. . . 168 Concatenated DataSetsUsedbyGSAM. . . 169 SuggestedMethodforSpecifyingGSAMDataSetAttributes . . . 169

DLI, DBB,andBMPRegionTypesandGSAM. . . 169

Chapter9. ProcessingFastPathDatabases. . . 171 Fast PathDatabaseCalls . . . 171

Main StorageDatabases(MSDBs) . . . 172

DataEntryDatabases(DEDBs) . . . 173

ProcessingMSDBsandDEDBs . . . 173

UpdatingSegments:REPL,DLET,ISRT,andFLD . . . 173

Checking theContentsof aField:FLD/VERIFY . . . 174

ChangingtheContentsof aField:FLD/CHANGE. . . 176 Example ofUsingFLD/VERIFYandFLD/CHANGE . . . 177 ||

(33)

Commit-PointProcessinginMSDBsandDEDBs . . . 177

MSDB CommitView . . . 178

DEDBswithMSDBCommitView. . . 178 VSOConsiderations . . . 178

DataLockingforMSDBsandDEDBs . . . 179

Restrictions onUsingCalls forMSDBs . . . 179

ProcessingDEDBs(IMSandCICSwithDBCTL) . . . 180

ProcessingDEDBswithSubsetPointers . . . 180

BeforeYouUseSubsetPointers . . . 182

DesignatingSubsetPointers . . . 183

Using SubsetPointers. . . 183 SubsetPointerStatus Codes . . . 184

Retrieving LocationwiththePOSCall(forDEDBOnly) . . . 185

LocatingaSpecific SequentialDependent . . . 185

LocatingtheLastInsertedSequentialDependentSegment . . . 185

Identifying FreeSpace . . . 187

Commit-PointProcessinginaDEDB . . . 187

PProcessingOption . . . 187

HProcessingOption . . . 188

DataLocking . . . 188

Calls withDependentSegments forDEDBs. . . 189 DirectDependent Segments . . . 189

SequentialDependentSegments. . . 189 Fast PathCoding Considerations. . . 189

(34)
(35)

Chapter

1.

How

Application

Programs

Work

with

Database

Manager

Application programsuseDataLanguageI(DL/I) tocommunicatewiththeIMS. This chaptergivesanoverviewof theapplicationprogrammingtechniquesandthe applicationprogramminginterfacefor IMSDatabase Manager(IMSDB).

Thefollowingtopicsprovide additionalinformation:

v “IMSEnvironments”

v “DL/IandYourApplication Program”onpage9 v “DL/ICodes” onpage9

v “DL/Ifor CICSOnline Users”onpage 11 v “DL/IusingtheODBAInterface” onpage12 v “DatabaseHierarchyExamples”onpage13 RelatedReading:

v IfyourinstallationusestheIMSTransactionManager(IMSTM),seeIMSVersion 9:ApplicationProgramming:TransactionManagerforinformationontransaction managementfunctions.

v InformationonDL/I EXECcommands isintheIMSVersion 9:Application Programming:EXECDLICommandsfor CICSandIMS.

IMS

Environments

Your applicationprogramcanexecuteindifferentIMSenvironments.Thethree onlineenvironmentsareDB/DC,DBCTL, andDCCTL.Thetwobatchenvironments areDBbatchandTMbatch.

RelatedReading:For informationontheseenvironments,seeIMSVersion9: AdministrationGuide:System.

Theinformationinthissectionapplies toallapplicationprogramsthatruninIMS. Themain elementsinanIMSapplicationprogramare:

v Programentry

v Programcommunicationblock(PCB)or applicationinterface block(AIB)

definition

v I/O(input/output)areadefinition v DL/Icalls

v Programtermination

Figure1onpage8shows howtheseelementsrelatetoeach other.Thenumbers ontherightinFigure1onpage8 referto thenotesthatfollow.

| | | | | | | |

(36)

NotesforFigure1:

1. Programentry.IMSpasses controltotheapplicationprogramwithalistof

associatedPCBs.

2. PCBorAIB.IMSdescribestheresultsofeach DL/Icall usingtheAIBTDLI

interface intheapplicationinterfaceblock(AIB)and,whenapplicable,the programcommunicationblock(PCB).Tofindtheresultsofa DL/Icall,your programmust usethePCBthatisreferencedinthecall.Tofindtheresultsof thecall usingtheAIBTDLIinterface,your programmust usetheAIB.

Your applicationprogramcanusethePCBaddressthatisreturnedintheAIBto find theresultsof thecall.TousethePCB,theprogramdefinesa maskof the PCBandcanthenreference thePCBaftereachcall todeterminethesuccess or failureof thecall.An applicationprogramcannotchangethefieldsina PCB; it canonlycheckthePCBto determinewhathappenedwhenthecallwas completed.

3. I/Oarea.IMSpassessegmentsto andfromtheprogramintheprogram’sI/O

area.

4. DL/I calls.Theprogramissues DL/Icallsto performtherequestedfunction.

5. Programtermination.Theprogramreturnscontrolto IMSDBwhenithas

finishedprocessing.In abatchprogram,yourprogramcan setthereturncode andpassitto thenextstepinthejob.

Recommendation: If yourprogramdoes notusethereturn codeinthisway,

setthereturncodeto 0asaprogrammingconvention.Your programcanusethereturncodefor thissamepurposein Batch MessageProcessing(BMP) regions.Message ProcessingPrograms(MPPs)cannotpassreturn codes.

Figure1.DL/IProgramElements

| | | | |

(37)

DL/I

and

Your

Application

Program

Whenanapplicationprogramcall isissuedtoIMS,controlpassesto IMSfromthe applicationprogram.Standardsubroutinelinkage andparameterlistslinkIMSto your applicationprogram.Aftercontrolispassed, IMSexaminestheinput parameters,whichperformtherequestfunctions.

DL/I

Codes

This sectioncontainsinformationaboutthedifferentDL/Icodesthatyouwill encounterwhenworkingwithIMSDatabaseManagerApplicationPrograms.

Status,

Return,

and

Reason

Codes

Togive informationabouttheresultsofeach call,IMSplacesa two-characterstatus code inthePCBaftereachIMScallyourprogramissues.Your programshould checkthestatuscode aftereveryIMScall.If itdoes notcheckthestatuscode,the programmightcontinueprocessing eventhoughthepreviouscall causedanerror. Thestatuscodesyourprogramshouldtestforarethosethatindicateexceptional but validconditions. IMSVersion9: MessagesandCodes,Volume 1liststhe statuscodesthatmaybereturnedbyeachcalltype andindicatesthelevelof successfor eachcall.Yourprogramshouldcheckforstatuscodeswhichindicate thecall wassuccessful,suchasblanks.IfIMSreturnsa statuscodethatyoudid notexpect,your programshouldbranchto anerrorroutine.

Informationfor yourcallsissuppliedinstatuscodesthatarereturnedinthePCB, returnandreasoncodesthatarereturnedintheAIB,or both.

Exceptional

Condition

Status

Codes

Somestatuscodesdonotmeanthatyourcall wassuccessfulorunsuccessful;they just giveinformationabout theresultsof thecall.Yourprogramusesthis

informationto determinewhattodonext.Themeaningof thesestatuscodes dependonthecall.

In atypical program,statuscodesthatyoushouldtest forapplytothegetcalls. Somestatuscodesindicateexceptionalconditionsforothercalls, andyou should provideroutines otherthanerrorroutines forthesesituations.For example,AH meansthata requiredsegment searchargument(SSA)ismissing,andATmeans thattheuserI/Oareaistoolong.

High

Availability

Large

Databases

(HALDBs)

You needtobeawarethatthefeedbackondataavailabilityatPSBscheduletime shows theavailabilityofonly theHighAvailability LargeDatabase(HALDB)master, notof theHALDBpartitions.However, theerrorsettingsfor dataunavailabilityofa HALDBpartition arethesameasthoseofa non-HALDBdatabase,namelystatus code ’BA’or pseudoabendU3303.

Also notethatlogicalchildsegmentscannotbeloadedintoaHALDBPHDAMor PHIDAM database.Logical childsegmentsmust beinserted laterinanupdaterun. Anyattemptto loadalogical childsegment ineither aPHDAMorPHIDAM

databaseresultsinstatuscodeLF.

(38)

Error

Routines

If yourprogramdetectsanerroraftercheckingforblanks andexceptional

conditions inthestatuscode,itshouldbranchtoanerrorroutineandprintasmuch informationaspossibleabout theerrorbeforeterminating. Determiningwhichcall wasbeingexecutedwhentheerroroccurred, whatparameterswere ontheIMS call,andthecontentsof thePCBwillbehelpfulinunderstandingtheerror.Printthe statuscode tohelp withproblemdetermination.

Two kindsoferrorscanoccurinyourprogram:programmingerrorsandsystemor I/Oerrors. Programmingerrors, areusuallyyourresponsibilityto findandfix.These errors arecausedbythingslike aninvalid parameter,aninvalidcall,oranI/Oarea thatistoolong.Systemor I/Oerrorsareusuallyresolvedbythesystem

programmer ortheequivalentspecialistatyourinstallation.

Because everyapplicationprogramshould haveanerrorroutine,andbecauseeach installationhasitsown waysoffindinganddebuggingprogramerrors,youprobably have yourownstandard errorroutines.

Database

Descriptions

(DBDs)

and

Program

Specification

Blocks

(PSBs)

Application programscancommunicatewithdatabaseswithoutbeingawareof the physical locationof thedatathey possess.Todothis,databasedescriptors(DBDs) andprogramspecificationblocks (PSBs)areused.

ADBDdescribesthecontentandhierarchicstructureof thephysicalor logical database.DBDsalso supplyinformationtoIMStohelp inlocatingsegments. APSBspecifiesthedatabasesegmentsanapplicationprogramcanaccessandthe functionsit canperformonthedata,suchasreadonly,update,ordelete.Because anapplicationprogramcanaccessmultipledatabases,PSBsarecomposedofone or moreprogramcontrolblocks (PCBs).ThePSBdescribesthewayadatabaseis viewedbyyourapplicationprogram.

Figure2shows thenormalrelationshipbetweenapplicationprograms,PSBs,PCBs, DBDs, anddatabases.

Figure3onpage11showsconcurrentprocessing,which usesmultiplePCBsfor thesamedatabase.

Figure2.NormalRelationshipbetweenPrograms,PSBs,PCBs,DBDs,andDatabases

(39)

DL/I

for

CICS

Online

Users

This topicapplies tocall-levelCICSprogramsthatuseDatabaseControl (DBCTL). DBCTLprovidesa databasesubsystemthatrunsinitsown addressspaceand givesoneor moreCICSsystemsaccesstoIMSDL/Ifull-functiondatabasesand data entrydatabases(DEDBs).

Figure4onpage11showsthestructureof acall-levelCICSonlineprogram.Afew differencesexistbetweenCICSonlineandbatchprograms.For example,inaCICS onlineprogram,youmust issueacallto scheduleaprogramspecificationblock (PSB).SeeFigure4onpage11notesfora descriptionof eachprogramelement depictedinthefigure.

NotestoFigure4:

Figure3.RelationshipbetweenProgramsandMultiplePCBs(ConcurrentProcessing)

Figure4.TheStructureofaCall-LevelCICSOnlineProgram

(40)

1. I/Oarea. IMSpasses segmentsto andfromtheprogramintheprogram’sI/O

area.

2. PCB.IMSdescribestheresultsofeach DL/Icall inthedatabasePCBmask.

3. Userinterfaceblock(UIB).TheUIBprovidestheprogramwithaddressesof

thePCBsandreturncodesfromtheCICS-DL/I interface.

Thehorizontalline betweennumber3(UIB)andnumber4(Programentry) in Figure4 onpage 11,representstheendofthedeclarationssectionandthe startoftheexecutablecode sectionof theprogram.

4. Programentry.CICSpassescontroltotheapplicationprogramduring

programentry. DonotuseanENTRY statementasyouwouldinabatch program.

5. Schedulethe PSB.This identifiesthePSByourprogramistouse andpasses

theaddressoftheUIBtoyourprogram.

6. IssueDL/Icalls.IssueDL/I callstoreadandupdatethedatabase.

7. Checkthereturncodeinthe UIB.Youshouldcheckthereturncodeafter

issuinganyDL/I callfor databaseprocessing,includingthePCBorTERMcall.Do thisbeforecheckingthestatuscode inthePCB.

8. Checkthestatuscodeinthe PCB.Youshould checkthestatuscode after

issuinganyDL/I callfor databaseprocessing.Thecode givesyoutheresults ofyourDL/I call.

9. Terminatethe PSB.ThisterminatesthePSBandcommitsdatabasechanges.

PSBterminationisoptional,andifit isnotdone, thePSBisreleased when yourprogramreturnscontroltoCICS.

10. ReturntoCICS.Thisreturnscontrolto eitherCICSorthelinkingprogram.If

controlisreturnedto CICS,databasechangesarecommitted,andthePSBis terminated.

DL/I

using

the

ODBA

Interface

This sectionapplies toz/OSapplicationprogramsthatusedatabaseresourcesthat aremanagedbyIMSDB.OpenDatabaseAccess(ODBA)isaninterfacethat enables thez/OSapplicationprograms toaccessIMSDL/I full-functiondatabases anddata entrydatabases(DEDBs).

Thethreeparts toaccessIMSDL/I usingtheODBAinterfaceareCommonLogic FlowforSRMS andMRMS,SRMS,andMRMS.

Thecommon logicflowforsingleresource managescenarios(SRMS)andmultiple resource managerscenarios(MRMS)isdescribedinstepsonethroughnine.The logicflowdifferencesforSRMSandMRMSaredescribedbelow.

1. I/Oarea.IMSpassessegmentsto andfromtheapplicationprogramintheits

I/Oarea.

2. PCB.IMSdescribestheresultsofeach DL/Icall inthedatabasePCBmask.

3. Application interfaceblock(AIB).TheAIBprovidestheprogramwithaddresses

of thePCBsandreturncodesfromtheODBA-DL/Iinterface. 4. Program entry.ObtainandinitializetheAIB.

5. InitializetheOpenDatabaseAccess(ODBA) interface.

6. Schedule thePSB.This stepidentifiesthePSBthatyourprogramisto useand

also providesa placefor IMSto keepinternaltokens.

7. IssueDL/I calls.IssueDL/I callstoreadandupdatethedatabase.Thefollowing

callsareavailable:

(41)

v Retrieve v Replace v Delete v Insert

8. Check thereturncodeintheAIB.Youshouldcheckthereturncodeafter

issuinganyDL/Icall fordatabaseprocessing.Do thisbeforecheckingthestatus code inthePCB.

9. Check thestatuscode inthePCB.If theAIBreturncodeindicates(Return

CodeX'900'),thenyoushouldcheckthestatuscodeafterissuinganyDL/Icall for databaseprocessing.Thecode givesyoutheresultsofyourDL/I call. Thelogicflowforhowtheprogrammer commitschangesforSRMS follows.The programmer:

1. Commitsdatabasechanges.NoDL/Icalls,includingsystem servicecallssuch

asLOGorSTAT,canbemade betweenthecommitandtheterminationofthe DPSB.

2. Terminates thePSB.

3. Terminates theODBAinterface.

4. Returns toenvironment thatinitializedtheapplicationprogram.

Thelogicflowforhowtheprogrammer commitschangesforMRMSfollows.The programmer:

1. Terminates thePSB.

2. Terminates theODBAinterface.

3. Commitschanges.

4. Returns toenvironment thatinitializedtheapplicationprogram.

Database

Hierarchy

Examples

TheexamplesinthisinformationusethemedicalhierarchyshowninFigure5on page 14andthebankhierarchies showninTable8onpage16,Table9onpage 17,andTable10onpage17.Themedicalhierarchyisused withfull-function databasesandFast Pathdataentry databases(DEDBs).Thebank hierarchiesare anexampleofanapplicationprogramusedwithmainstoragedatabases(MSDBs). Tounderstandtheseexamples,familiarizeyourself withthehierarchiesand

segmentsthateach hierarchycontains.

Medical

Hierarchy

Example

Themedicaldatabaseshown inFigure5onpage14containsinformationthata medicalclinickeepsabout itspatients.

(42)

Thetablesthatfollowshowthelayoutsof eachsegment inthehierarchy.The segment’sfield namesareinthefirstrowofeach table.Thenumberbeloweach field nameisthelengthinbytesthathasbeendefinedfor thatfield.

v PATIENTSegment

Table2shows thePATIENTsegment. Ithasthreefields:

– Thepatient’s number(PATNO)

– Thepatient’s name(NAME)

– Thepatient’saddress(ADDR)

PATIENThasauniquekeyfield:PATNO.PATIENTsegmentsarestoredin ascendingorderbasedonthepatientnumber.Thelowestpatientnumberinthe databaseis00001andthehighestis10500.

Table2.PATIENTSegment

FieldName FieldLength

PATNO 10

NAME 5

ADDR 30

v ILLNESSSegment

Table3onpage15showstheILLNESSsegment. Ithastwo fields:

– Thedate whenthepatientcametotheclinicwiththeillness(ILLDATE)

– Thename oftheillness(ILLNAME)

ThekeyfieldisILLDATE.Becauseit ispossiblefor apatienttocometothe clinicwithmorethanoneillnessonthesamedate, thiskeyfield isnonunique, thatis,theremaybemorethanoneILLNESSsegment withthesame(anequal) keyfield value.

Usuallyduringinstallation,thedatabaseadministrator(DBA)decidestheorderin whichto placethedatabasesegmentswithequalornokeys.TheDBAcanuse theRULESkeywordof theSEGMstatementof theDBDto specifytheorderof thesegments.

Forsegmentswithequalkeysornokeys,RULESdetermineswherethe segmentisinserted.Where RULES=LAST,ILLNESSsegmentsthathave equal keysarestoredona first-in-first-outbasisamongthosewithequalkeys. ILLNESSsegmentswithuniquekeysarestoredinascending orderonthedate field,regardlessof RULES.ILLDATEisspecifiedintheformatYYYYMMDD.

Figure5.MedicalHierarchy

(43)

Table3.ILLNESSSegment

FieldName FieldLength

ILLDATE 8

ILLNAME 10

v TREATMNTSegment

Table4showstheTREATMNTsegment. Itcontainsfourfields:

– Thedate ofthetreatment(DATE)

– Themedicinethatwasgiventothepatient(MEDICINE)

– Thequantity ofthemedicinethatthepatientreceived(QUANTITY)

– Thename ofthedoctorwhoprescribedthetreatment(DOCTOR)

TheTREATMNTsegment’skey fieldisDATE.Becauseapatientmay receive morethanonetreatmentonthesamedate,DATEisanonuniquekeyfield. TREATMNT,likeILLNESS,hasbeenspecifiedashavingRULES=LAST. TREATMNTsegmentsarealso storedonafirst-in-first-outbasis.DATEis specifiedinthesameformatasILLDATE—YYYYMMDD.

Table4.TREATMNTSegment

FieldName FieldLength

DATE 8 MEDICINE 10 QUANTITY 4 DOCTOR 10 v BILLINGSegment

Table5showstheBILLING segment.It hasonlyonefield:theamountof the currentbill. BILLINGhasnokeyfield.

Table5.BILLINGSegment

FieldName FieldLength

BILLING 6

v PAYMENTSegment

Table6showsthePAYMENTsegment.Ithasonly onefield:theamountof paymentsforthemonth.ThePAYMENTsegmenthas nokeyfield.

Table6.PAYMENTSegment

FieldName FieldLength

PAYMENT 6

v HOUSHOLDSegment

Table7onpage16showstheHOUSHOLDsegment. Itcontainstwofields:

– Thenamesof themembersofthepatient’shousehold(RELNAME)

– Howeachmemberofthehouseholdisrelatedtothepatient(RELATN)

References

Related documents