CICS
Transaction
Server
for
z/OS
CICS
DB2
Guide
Version
3
Release
1
CICS
Transaction
Server
for
z/OS
CICS
DB2
Guide
Version
3
Release
1
Note!
Beforeusingthisinformationandtheproductitsupports,besuretoreadthegeneralinformationunder“Notices”onpage 213.
Secondedition(September2006)
ThiseditionappliestoVersion 3 Release 1ofCICSTransactionServerforz/OS,programnumber5655-M15,and toallsubsequentversions,releases,andmodificationsuntilotherwiseindicatedinneweditions.Makesureyouare usingthecorrecteditionfortheleveloftheproduct.
Contents
Preface. . . ix
Whatthis bookisabout . . . ix
Whatyouneed toknowto understandthis book . . . ix
Notes onterminology . . . ix
Summary ofchanges . . . xi
Changesfor CICSTransactionServerforz/OS, Version3Release1 . . . xi
Changesfor CICSTransactionServerforz/OS, Version2Release3 . . . xi
Changesfor CICSTransactionServerforz/OS, Version2Release2 . . . xi
Changesfor CICSTransactionServerforz/OS, Version2Release1. . . xiii
Earlier releases . . . xiv
Chapter1. Overviewofthe CICSDB2interface . . . 1
Overview:HowCICSconnectsto DB2 . . . 1
TheDB2addressspaces . . . 2
Overview:Howthreadswork . . . 2
Thread TCBsinanon-opentransactionenvironment . . . 4
Thread TCBsintheopen transactionenvironment . . . 6
Overview:HowyoucandefinetheCICSDB2connection. . . 8
Overview:EnablingCICSapplicationprograms toaccessDB2 . . . 10
Preparinga CICSapplicationprogramthataccesses DB2 . . . 11
Thebindprocess . . . 12
Plans,packagesanddynamicplanexits . . . 13
Chapter2. InstallationandmigrationnotesforCICSDB2. . . 15
CICSstartupJCLrequirementsfor connectionto DB2 . . . 15
SupportedreleasesofDB2 . . . 15
Migratingtoa differentreleaseofDB2 . . . 15
MigratingfromaCICSreleasethatusedRCTdefinitionsfor CICSDB2 resources . . . 17
If youhavenotusedCICSresourcedefinitiononline(RDO)before . . . . 17
Effectof migrationto RDOonCICSDB2 attachmentfacilityoperations . . . 18
Effectof migrationto RDOonapplicationprograms . . . 21
Effectof migrationto RDOontheINITPARM systeminitialization parameter 21 Effectof migrationto RDOondefaultsfor resourcedefinitionparameters 21 MigratingtoRDO forDB2resourcedefinition. . . 21
Chapter3. OperationswithCICSDB2 . . . 25
StartingtheCICSDB2attachmentfacility . . . 25
Automaticconnectionat CICSinitialization. . . 25
Manualconnection . . . 25
StoppingtheCICSDB2attachmentfacility. . . 25
Automaticdisconnectionat CICStermination. . . 25
Manualdisconnection . . . 26
Resolvingindoubtunitsofwork(UOWs) . . . 26
ResolvingindoubtUOWswhenusinggroupattach . . . 27
ResolvingindoubtunitsofworkusingDB2restart-light . . . 27
Recovery ofresynchronizationinformationfor indoubtUOWs. . . 28
ManagingtheCICSDB2attachmentfacility . . . 29
EnteringDB2commands . . . 30
PurgingCICSDB2transactions. . . 30
StartingSMFforDB2accounting,statisticsandtuning . . . 31
Chapter4. CICS-suppliedtransactionsforCICSDB2. . . 33
Issuing commandsto DB2usingDSNC. . . 34
Environment. . . 34 Syntax . . . 34 Abbreviation . . . 34 Authorization. . . 34 Parameterdescription . . . 35 Usage note . . . 35 Example . . . 35 DSNC DISCONNECT . . . 36 Environment. . . 36 Syntax . . . 36 Abbreviation . . . 36 Authorization. . . 36 Parameterdescription . . . 36 Usage notes. . . 36 Example . . . 37 DSNC DISPLAY . . . 38 Environment. . . 38 Syntax . . . 38 Abbreviation . . . 38 Authorization. . . 38 Parameterdescription . . . 38 Parameterdescription . . . 38 Parameterdescription . . . 39 Usage notes. . . 39
DISPLAYPLANorTRAN . . . 39
DISPLAYSTATISTICS output . . . 40
DSNC MODIFY. . . 43 Environment. . . 43 Syntax . . . 43 Abbreviation . . . 43 Authorization. . . 43 Parameterdescription . . . 43 Usage notes. . . 44 Examples . . . 44 DSNC STOP . . . 46 Environment. . . 46 Syntax . . . 46 Abbreviation . . . 46 Authorization. . . 46 Parameterdescription . . . 46 Usage notes. . . 46 Examples . . . 47 DSNC STRT. . . 48 Environment. . . 48 Syntax . . . 48 Abbreviation . . . 48 Authorization. . . 48 Parameterdescription . . . 48 Usage notes. . . 48 Examples . . . 49
Chapter5. Definingthe CICSDB2connection . . . 51
Whathappens duringSQLprocessing . . . 53 Thread creation. . . 54 SQLprocessing . . . 54 Commitprocessing . . . 54 Thread release . . . 55 Thread termination . . . 55
Howthreadsarecreated,used,andterminated. . . 55
Protectedentry threads. . . 57
Unprotectedentrythreadsfor criticaltransactions . . . 58
Unprotectedentrythreadsfor backgroundtransactions . . . 59
Poolthreads. . . 59
Selectingthreadtypesfor optimumperformance . . . 60
SelectingBINDoptionsforoptimum performance . . . 62
CoordinatingyourDB2CONN, DB2ENTRY,andBINDoptions . . . 62
Chapter6. SecurityinaCICSDB2environment . . . 65
Controllingusers’accessto DB2–relatedresourcesinCICS(CICSDB2 transactions,resourcedefinitions,andattachmentfacilitycommands) . . . . 66
Controllingusers’accessto DB2CONN,DB2TRAN,andDB2ENTRY resource definitions . . . 67
Using resourcesecurityto controlaccessto DB2ENTRYandDB2TRAN resource definitions . . . 68
Using commandsecuritytocontroltheissuingofSPIcommandsagainst DB2CONN, DB2ENTRY,andDB2TRANresourcedefinitions . . . 69
Using surrogatesecurityandAUTHTYPEsecuritytocontrolaccesstothe authorizationIDsthatCICSprovidestoDB2 . . . 71
Controllingusers’accessto DB2-relatedCICStransactions . . . 73
Providing authorizationIDs toDB2for theCICSregionandforCICS transactions . . . 74
Providing authorizationIDs toDB2for aCICSregion. . . 75
Providing aprimaryauthorizationIDforaCICSregion . . . 75
Providing secondaryauthorizationIDs fora CICSregion . . . 76
Providing authorizationIDs toDB2for CICStransactions . . . 77
Providing aprimaryauthorizationIDforCICStransactions. . . 78
Providing secondaryauthorizationIDs forCICStransactions . . . 80
AuthorizinguserstoaccessresourceswithinDB2(DB2commands,plans,and dynamicSQL) . . . 82
Controllingusers’accessto DB2commands . . . 83
Controllingusers’accessto plans . . . 84
Chapter7.Application designanddevelopment considerationsforCICS DB2 . . . 87
DesigningtherelationshipbetweenCICSapplicationsandDB2plansand packages . . . 88
Asampleapplication. . . 89
Using packages . . . 90
Using onelargeplanfor alltransactions . . . 93
Using manysmallplans . . . 94
Using plansbasedontransactiongrouping . . . 95
Dynamic planexits . . . 96
If youneedto createplansforanapplicationthathas alreadybeen developed. . . 99
If youneedto switchplanswithinatransaction . . . 99
Dynamic planswitching . . . 100
Switchingtransaction IDsinordertoswitchplans . . . 100
SQL, threadsafeandotherprogrammingconsiderations forCICSDB2
applications. . . 105
Enabling CICSDB2applicationsto exploittheopentransactionenvironment (OTE)throughthreadsafeprogramming . . . 106
SQLlanguage. . . 109
Using qualifiedandunqualified SQL . . . 109
Views . . . 110
Updatingindexcolumns . . . 110
Dependencyof uniqueindexes . . . 110
Commitprocessing . . . 111
Serializingtransactions . . . 111
Pagecontention . . . 112
CICSandCURSORWITHHOLDoption . . . 113
EXECCICSRETURNIMMEDIATEcommand . . . 114
AvoidingAEY9abends . . . 114
Chapter8. UsingJDBCandSQLJtoaccessDB2datafrom Java programsandenterprisebeans writtenforCICS . . . 117
Making JDBCandSQLJworkintheCICSDB2environment . . . 117
Requirements tosupportJavaprogramsintheCICSDB2environment. . . . 119
ProgrammingwithJDBCandSQLJintheCICSDB2 environment . . . 121
Acquiring aconnection toadatabase . . . 122
Howmanyconnectionscanyouhave? . . . 123
Acquiring aconnection usingtheJDBCDriverManagerinterface . . . 123
Acquiring aconnection usingtheDataSourceinterface. . . 124
Settingupthesample applicationstopublish,lookupandretracta DataSource. . . 125
Publishinga DataSourceusingCICSDataSourcePublish.java . . . 126
Looking upa DataSourceusingCICSjdbcDataSource.java . . . 127
Retracting aDataSourceusingCICSDataSourceRetract.java . . . 128
Committingaunit ofwork . . . 129
Autocommit. . . 129
Syncpointissues forexplicitanddefaultURLs . . . 130
CICSabendsduringJDBCorSQLJ requests . . . 130
Using JDBCandSQLJinenterprisebeans:specialconsiderations . . . 130
Chapter9. PreparingCICSDB2programsforexecutionandproduction 133 TheCICSDB2testenvironment . . . 133
CICSDB2programpreparationsteps . . . 134
CICSSQLCAformattingroutine . . . 136
Whatto bindafteraprogramchange . . . 137
Bindoptions andconsiderationsfor programs . . . 138
RETAIN . . . 138
Isolationlevel . . . 139
Planvalidation time. . . 139
ACQUIRE andRELEASE . . . 139
CICSDB2programtestinganddebugging . . . 139
Goingintoproduction: checklistforCICSDB2applications . . . 139
Tuning aCICSapplicationthataccesses DB2 . . . 142
Chapter10.Accounting andmonitoringin aCICSDB2environment 145 CICS-supplied accountingandmonitoringinformation . . . 145
DB2-suppliedaccounting andmonitoringinformation . . . 146
Monitoringa CICSDB2environment:Overview . . . 147
MonitoringtheCICSDB2attachmentfacilityusingCICSDB2attachment
facilitycommands . . . 148
MonitoringtheCICSDB2attachmentfacilityusingDB2commands . . . . 148
MonitoringtheCICSDB2attachmentfacilityusingCICSDB2statistics 148 MonitoringCICStransactionsthataccessDB2resources. . . 151
MonitoringDB2whenused withCICS . . . 152
MonitoringDB2usingtheDB2statisticsfacility . . . 153
MonitoringDB2usingtheDB2accountingfacility. . . 155
MonitoringDB2usingtheDB2performancefacility . . . 155
MonitoringtheCICSsysteminaCICSDB2environment . . . 156
AccountinginaCICSDB2environment:Overview . . . 156
Accountinginformationprovided bytheDB2 accountingfacility. . . 157
DatatypesinDB2accounting records. . . 158
DB2accounting reports . . . 160
RelatingDB2accounting recordstoCICSperformanceclassrecords . . . . 161
WhataretheissueswhenmatchingDB2accountingrecordsandCICS performancerecords? . . . 162
ControllingtherelationshipbetweenDB2accountingrecordsandCICS performanceclassrecords . . . 162
Using dataintheDB2accounting recordtoidentify thecorrespondingCICS performanceclassrecords . . . 163
Strategies youcanuseto matchDB2accounting recordsandCICS performanceclassrecordsandchargeresourcesbackto theenduser . . 164
Accountingfor processorusageinaCICSDB2environment . . . 167
AccountingCLASS1 processortime . . . 172
AccountingCLASS2 processortime . . . 173
CalculatingCICSandDB2processortimesforDB2Version5or earlier 174 CalculatingCICSandDB2processortimesforDB2Version6or later 174 Chapter11.ProblemdeterminationforCICSDB2 . . . 177
Thread TCBs(taskcontrolblocks) . . . 177
Wait typesforCICSDB2. . . 178
Messages forCICSDB2. . . 182
Tracefor CICSDB2 . . . 182
CSUBtrace . . . 191
Dumpfor CICSDB2 . . . 193
DB2 threadidentification . . . 194
TransactionabendcodesforCICSDB2 . . . 194
ExecutionDiagnosticFacility(EDF)for CICSDB2 . . . 195
Handlingdeadlocks intheCICSDB2environment . . . 196
Two deadlocktypes. . . 197
Deadlock detection . . . 197
Findingtheresourcesinvolved . . . 198
FindingtheSQLstatementsinvolved . . . 198
Findingtheaccesspathused . . . 198
Determiningwhythedeadlockoccurred . . . 198
Making changes . . . 198
Bibliography . . . 201
TheCICSTransactionServerfor z/OSlibrary . . . 201
Theentitlementset . . . 201
PDF-only books . . . 201
Other CICSbooks . . . 203
Booksfromrelatedlibraries. . . 203
DB2 . . . 203
ResourceManagement Facility(RMF). . . 204
Determiningif apublicationiscurrent . . . 204
Accessibility . . . 205
Index . . . 207
Notices . . . 213
Programminginterface information . . . 214
Trademarks. . . 214
Preface
What
this
book
is
about
This bookisforanyonewho uses,orisconsideringusing,theCICS®Transaction Serverfor z/OS®, Version3Release1DB2®interface.Itisintendedto beusedin conjunctionwithexistingmanualsintheCICSandDB2libraries.Thesearereferred to whereappropriate.
Theaimof thisbookisto giveintroductoryandguidanceinformationonevaluating, installing, andusingtheCICSDB2attachmentfacility,andondefining and
maintainingyourCICSDB2environment.
What
you
need
to
know
to
understand
this
book
Before youreadthisbook,you needageneralunderstandingofCICS.Youcanfind generalintroductoryinformation intheCICSFamily:GeneralInformation.You should alsohavesomeknowledgeof theconceptsofdatamanagement and databases. Forguidanceonthesetopics,seetheDB2Universal Database™for OS/390®andz/OSAdministrationGuide.
Notes
on
terminology
When theterm“CICS”isusedwithout anyqualification,itrefers totheCICS element ofIBM®CICSTransactionServerfor z/OS.
“DB2”without anyqualificationrefersto DB2UniversalDatabaseServerfor OS/390 andz/OS.
CICSPlex® SMisusedfor CICSPlexSystemManager.
“MVS™”isusedfor theoperating system,which canbeanelementof z/OS, OS/390,or MVS/EnterpriseSystemArchitectureSystemProduct(MVS/ESA™SP).
Summary
of
changes
This bookisbasedontheCICSDB2GuideforCICSTransactionServerfor z/OS, Version2 Release3.Changesfromthateditionaremarkedbyverticalbars inthe leftmargin.
This partlistsbrieflythechangesthathave beenmade forthefollowingreleases: For mostitemsineachof thelistsabove,thereisalink tothepartofthebook wherethereismoredetail.
Changes
for
CICS
Transaction
Server
for
z/OS,
Version
3
Release
1
Themoresignificantchangesfor thiseditionare: Technicalchanges
v
Becauseof theremoval ofrun-timesupportforJavaprogramobjectsand
hot-pooling(HPJ),informationabout usingthis typeofJavaprogramtoaccess DB2isremovedfromChapter8, “UsingJDBCandSQLJto accessDB2 data fromJavaprograms andenterprisebeanswrittenforCICS,”onpage117.Ifyou haveanyJavaprogramobjectsthataccessDB2,andneedto migratethem to runinaJVM,“Requirements tosupportJavaprogramsintheCICSDB2 environment”onpage119hasinformationontherequirements forJava programsthatrunina JVMandaccessDB2.
Changes
for
CICS
Transaction
Server
for
z/OS,
Version
2
Release
3
Themoresignificantchangesfor thiseditionare: Technicalchanges
v Therearechangestothesamplesthatareprovided tosetupa
CICS-compatibleDataSource.Chapter8,“UsingJDBCandSQLJ toaccessDB2 datafromJavaprograms andenterprisebeanswrittenforCICS,”onpage117 hasinformationonusingtheDataSourceinterface toacquireconnections.
Changes
for
CICS
Transaction
Server
for
z/OS,
Version
2
Release
2
Themoresignificantchangesfor thiseditionare:
Technicalchanges:Opentransactionenvironment(OTE)exploitation v
IfyourCICSsystemisconnectedto DB2Version6orlater, CICSnow exploits
theopentransactionenvironment(OTE)to improveperformancebyreducing TCBswitching.For fulldetailsof theCICSDB2configurationneededtoexploit theopentransactionenvironment,see“Migratingto adifferentreleaseofDB2” onpage 15.
v Foranoverviewoftheeffectsofthis change,seetheCICSTransactionServer
forz/OS ReleaseGuidefor CICSTransactionServerforz/OS, Version2Release 2.Chapter1,“Overview oftheCICSDB2interface,”onpage1, hasexplanations oftheimportantdifferencesinthewayCICSconnectsto DB2intheopen transactionenvironment,includingtheuseof openTCBsinstead ofsubtask TCBsto runthreads(see“Overview:Howthreadswork”onpage2). “Thread TCBs(task controlblocks)”onpage177hasfurtherinformationonopenTCBs beingused asthreadTCBs,andonthenewmodulesusedto controlCICSDB2
connectionprocessing.“Howthreadsarecreated,used,andterminated”onpage 55explainsthedifferencesinthreadusewhenusingopenTCBs.
v Whenusingtheopentransactionenvironment,to besurethatyouhaveenough
openTCBsavailableto processyourDB2workload,ensurethatthelimitsetin yourMAXOPENTCBSsysteminitializationparameter isgreater thanthelimitset intheTCBLIMITattributeofyour DB2CONNdefinition.Formoreinformation,see “TheMAXOPENTCBSsystem initializationparameterandTCBLIMIT”onpage 52.
v
Togaintheperformancebenefitsof theopen transactionenvironment,
applicationprograms mustbethreadsafe.See“EnablingCICSDB2applications toexploit theopen transactionenvironment(OTE)throughthreadsafe
programming”onpage106forinformation.
v OTEexploitationisparticularlyimportant forenterprisebeansthatmakeDB2
requests.See“UsingJDBCandSQLJ inenterprisebeans:special considerations”onpage130for information.
v Thereisanew waittypefor theopentransactionenvironment,CDB2CONN,and
someof theexistingwaittypesonlyapplywhenCICSisnotusingtheopen transactionenvironment(whenit isconnectedto DB2Version5or earlier).See “WaittypesforCICSDB2”onpage178for information.
v
Theuseoftheopentransaction environmentaffectshowyoucanpurge CICS
DB2transactions.See“PurgingCICSDB2transactions”onpage30for information.
v TherearedifferencestothetracingperformedfortheCICSDB2attachment
facilityintheopentransactionenvironment.Amongother things,theCICSDB2 connectionprogramDFHD2D2,whichreplacesDFHD2EX3intheopen
transactionenvironment,makesnewentriesintheCSUBtracetable.See“Trace forCICSDB2”onpage182forinformation.
v Therearechangesto accountingandperformancemonitoringasaresultof the
availabilityoftheopentransaction environment.SeeChapter10,“Accounting andmonitoringina CICSDB2environment,” onpage145forinformation. Technicalchanges:Groupattach
v
IfyourCICSsystemisconnectedto DB2Version7orlater, youcannowuse the
DB2groupattachfacility,whichallowsCICSto connectto anyonememberof a datasharinggroupof DB2subsystems,ratherthanto aspecificDB2subsystem. Forfulldetails oftheCICSDB2configurationneededto usetheDB2group attachfacility,see“Migratingtoa differentrelease ofDB2”onpage15.
v See“UsingtheDB2groupattachfacility”onpage51formoreinformationabout
thegroupattachfacility.GroupattachiscontrolledbythenewDB2GROUPID andRESYNCMEMBERattributesof theDB2CONNdefinition—seetheCICS ResourceDefinitionGuidefor fulldescriptionsoftheseattributes.If youareusing groupattach,thisaffectstheresolutionofindoubtunitsofwork,andyouneedto decideonthestrategy thatCICSadopts—see“Resolvingindoubtunitsofwork (UOWs)”onpage26for details.
v Ifyouareusinggroupattach,theoutputfrom,anduseof,theDSNCSTRT
commandisaffected—see“DSNC STRT”onpage48for information.Ifyou specifya DB2IDona DSNCSTRTcommand,thisoverridesandblanks outa DB2GROUPIDsetintheinstalledDB2CONNdefinition.Youcannotspecifya DB2GROUPIDona DSNCSTRTcommand.
Othertechnicalchanges
providedbyDB2,thatsupports aselectedsubsetoftheJDBC2.0API,including supportfortheDataSourceinterface.ADataSourceisanalternativewayof obtainingaJDBCconnectionto adatabase.Chapter8, “UsingJDBCandSQLJ toaccessDB2datafromJavaprogramsandenterprisebeanswrittenfor CICS,” onpage 117hasinformationontherequirementsfor theJDBC2.0driver,andon usingtheDataSourceinterface toacquireconnections.Samples areprovided to setupa CICS-compatibleDataSource.
v Inthis releaseofCICS,PLANandPLANEXITNAMEoptionsareaddedto the
INQUIREDB2TRANcommand,soyoucanfindoutina singlestepwhichplan is usedbyaspecifiedtransaction orsetoftransactions,orwhich transactionsuse aspecifiedplan. SeetheCICSSystemProgrammingReference forinformation. v TheoutputfromtheDSNCDISPLAYPLANorTRANcommandnow
distinguishesbetweenathread thatisactiveandcurrently executinginDB2, and athread thatisactivebutisnotcurrentlyexecutinginDB2.See“DSNC
DISPLAY”onpage38for information.
v WhenpreparingCICSprogramsthataccessDB2,youcannow useLanguage
Environment-conforminglanguagecompilers(COBOLandPL/I)thatsupportthe integratedCICStranslator and,dependingonyourreleaseof DB2,anSQL statementcoprocessor.See“CICSDB2programpreparationsteps”onpage134 formoreinformationonthechangesto theprogrampreparationprocess.
Structuralchanges
v Chapter1, “Overviewof theCICSDB2interface,”onpage 1,hasbeenrewritten,
andnowincludesinformationon – howthreadsandthreadTCBswork
– howtheDB2CONN,DB2ENTRYandDB2TRANdefinitions worktogether
– howplans,packagesanddynamicplanexitswork
v Chapter7, “Applicationdesignanddevelopmentconsiderationsfor CICSDB2,”
onpage 87andChapter9,“PreparingCICSDB2programsfor executionand production,”onpage133havebeenreorganised. Inparticular,Chapter8, “Using JDBCandSQLJto accessDB2data fromJavaprogramsandenterprisebeans writtenforCICS,”onpage117isnowa separatechapter.
v Chapter2, “Installationandmigrationnotesfor CICSDB2,”onpage 15and
Chapter5, “DefiningtheCICSDB2connection,”onpage 51have been reorganised.
v Thechapter’Customization:dynamicplanexits’hasbeenremoved, andthe
informationitcontainedisnowin“Dynamicplan exits”onpage96and“Dynamic planswitching”onpage 100.
v Thechapter’Monitoring,tuningandhandlingdeadlocks’hasbeenremoved.The
informationitcontainedisnowinChapter10,“Accountingandmonitoringina CICSDB2environment,”onpage145,Chapter9,“PreparingCICSDB2 programsfor executionandproduction,”onpage133, Chapter11,“Problem determinationforCICSDB2,”onpage177,andtheCICSPerformanceGuide.
Changes
for
CICS
Transaction
Server
for
z/OS,
Version
2
Release
1
Themoresignificantchangesfor thiseditionare:
v Informationisprovided onsupportfor Javaprograms forCICSandenterprise
beansaccessingDB2(see“Requirementsto supportJavaprograms intheCICS DB2environment”onpage119and“UsingJDBCandSQLJ inenterprisebeans: specialconsiderations” onpage130.“Dynamicplanexits”onpage96explains theconsequencesof thesechangesfordynamicplanexits.
v Informationhasbeenaddedona saferwaytopurgeCICSDB2transactions
usingtheDB2 CANCELTHREADcommand(see“PurgingCICSDB2 transactions”onpage30and“Waittypesfor CICSDB2”onpage178).
v InformationhasbeenaddedonDB2thread identificationbyacorrelationID(see
“DB2threadidentification” onpage194andthenotein“DSNCDISPLAY”on page38).
v
Furtherinformationonthechangesto theINITPARM systeminitialization
parameterhasbeenaddedto “EffectofmigrationtoRDOontheINITPARM systeminitialization parameter”onpage 21and“DSNC STRT”onpage48. v In“MigratingRCTsto theCSDusingDFHCSDUP”onpage23,anotehasbeen
addedabout theeffectonCICSDB2 statisticswhenyouusewildcardcharacters indefiningtransactionIDs.
v Anewparameter,CPRMAPPL,containing the8 bytecharactername ofthe
applicationprogramissuinganSQLrequest,isnowpassedto thesample dynamicplanexitDSNCUEXT—see“Dynamicplan exits”onpage96,table Table4onpage97.
v In“Wait typesfor CICSDB2”onpage 178,informationisgivenonanew wait
addedto DFHD2EX2,to waituntil theTERM processiscomplete(seeTable15 onpage182).
For mostitemsineachof thelistsabove,thereisareferenceto thepartof the book wherethereismoredetail.
Earlier
releases
Changes forCICSTransactionServerforOS/390Version1Release3
Major changesfor thiseditionprovideinformationonthechangesto theINITPARM system initializationparameternow thatCICSnolongersupportsrunningtheCICS DB2 attachmentfacilitywithamacroRCT.See“Effectof migrationto RDOonthe INITPARM systeminitialization parameter”onpage 21and“MigratingtoRDOfor DB2 resourcedefinition”onpage 21.
Chapter
1.
Overview
of
the
CICS
DB2
interface
This chaptergivesanoverviewof theCICSinterface toDB2(Database2™).
This chapterincludesthefollowingtopics: v “Overview:HowCICSconnectstoDB2”
v “Overview:Howthreadswork”onpage 2
v “Overview:Howyoucan definetheCICSDB2connection”onpage8
v “Overview:Enabling CICSapplicationprogramsto accessDB2”onpage10
Overview:
How
CICS
connects
to
DB2
ACICSDB2attachmentfacilityisprovidedwithCICS.TheCICSDB2attachment facilityprovidesCICSapplicationswithaccessto DB2datawhileoperating inthe CICSenvironment.CICSapplications, therefore,canaccessbothDB2data and CICSdata.CICScoordinates recoveryofbothDB2 andCICSdataif transactionor system failureoccurs.
TheCICSDB2attachmentfacilitycreatesanoverallconnection betweenCICSand DB2. CICSapplicationsuse thisconnectionto issuecommandsandrequeststo DB2.Theconnection betweenCICSandDB2canbecreatedorterminatedatany time, andCICSandDB2 canbestartedandstoppedindependently.Youcan name anindividualDB2 subsystemtowhich CICSconnects, or(ifyouhave DB2Version 7 orlater)youcanusethegroupattachfacilitytoletDB2chooseanyactive memberof adata-sharinggroupof DB2subsystemsfor theconnection.Youalso have theoptionof CICSautomaticallyconnectingandreconnectingtoDB2.ADB2 system canbesharedbyseveralCICSsystems,buteachCICSsystemcan be connectedto onlyoneDB2subsystemata time.
Attachmentcommandsdisplayandcontrolthestatusof theCICSDB2attachment facility,andareissuedusingtheCICSsuppliedtransactionDSNC.Theattachment commands are:
v STRT-starttheconnection toDB2
v STOP-stoptheconnectionto DB2
v DISP-displaythestatusofthreads,anddisplaystatistics
v MODI-modifycharacteristicsoftheconnectionto DB2
v DISC-disconnectthreads
Theconnection betweenCICSandDB2isamultithreadconnection.Withinthe overallconnection betweenCICSandDB2,thereisa thread—anindividual connection intoDB2—foreach activeCICStransactionaccessingDB2.Threads allow eachCICStransactiontoaccessDB2resources,suchasa command processororanapplicationplan(theinformationthattellsDB2whattheapplication program’sSQLrequests are,andthemost efficientwaytoservicethem). See “Overview:Howthreadswork”onpage2 belowforafullexplanationofhow threadswork.
When anapplicationprogramoperating intheCICSenvironmentissues itsfirst SQLrequest,CICSandDB2processtherequestasfollows:
v Alanguageinterface,orstub, DSNCLI,thatislink-editedwiththeapplication
programcallstheCICSresourcemanagerinterface (RMI).
v TheRMIprocessestherequest,andpassescontrolto theCICSDB2attachment
facility’stask-relateduserexit (TRUE),themodulethatinvokesDB2foreach task.
v TheCICSDB2 attachmentfacilityschedulesa threadfor thetransaction.Atthis
stage,DB2checksauthorization,andlocates thecorrectapplicationplan. v DB2takescontrol,andtheCICSDB2attachmentfacilitywaitswhileDB2
servicestherequest.
v WhentheSQLrequestcompletes,DB2 passestherequesteddatabacktothe
CICSDB2attachmentfacility.
v CICSnowregainscontrol,andtheCICSDB2attachmentfacilitypasses thedata
andreturnscontrolto theCICSapplicationprogram.
The
DB2
address
spaces
DB2 requiresseveraldifferentaddressspaces.Figure1shows theseaddress spaces.
Varioustasksareperformedinthedifferentaddressspaces,asfollows: DSN1MSTR
for systemservicesthatperformavarietyofsystem-related functions. DSN1DBM1
for databaseservicesthatmanipulatemost ofthestructuresinuser-created databases.
DSN1DIST
for distributeddatafacilitiesthatprovidesupportfor remoterequests. IRLMPROC
for theinternalresourcelockmanager(IRLM),which controlsDB2locking. DSN1SPAS
for storedprocedures,which provideanisolatedexecutionenvironmentfor user-written SQL.
Overview:
How
threads
work
WithintheoverallconnectionbetweenCICSandDB2, eachCICStransactionthat accesses DB2needsathread,anindividual connectionintoDB2.Threadsare createdwhentheyareneededbytransactions,atthepointwhentheapplication
DSN1SPAS address space IRLMPROC address space DSN1DIST address space DSN1DBM1 address space CICS Connections DB2 Subsystem CICS address space DSN1MSTR address space
resourcesmanagedbyDB2. Whenathreadisnolongerneededbythetransaction, becausethetransactionhasaccessedalltheresourcesitneedstouse, thethread isreleased (typicallyaftersyncpointcompletion).It takesprocessorresourcesto createathread,sowhena threadisreleased,theCICSDB2attachmentfacility checkstosee ifanothertransactionneedsathread.Ifanothertransactioniswaiting for athread,theCICSDB2attachmentfacilityreusestheexistingthread forthat transaction toaccessDB2.Ifthethreadisnolongerneededbyanytransaction, it isterminated,unlessyouhave requestedthatit shouldbeprotected(kept)for a periodoftime.Aprotected threadisreusedifanothertransactionrequestsit within thatperiodoftime; ifnot,it isterminatedwhentheprotectiontime expires.
There aredifferenttypesofthread,andyoucansetalimitonthenumberofeach type ofthread thatcanbeactiveat anyonetime.Thisprevents theoverall CICS DB2 connectionfrombecomingoverloadedwithwork.Aspecialtypeof threadis used forDB2commands issuedusingtheDSNC transaction,andyoucanalso definespecialthreadsforCICStransactionswithparticularrequirements,suchas transactionsthatrequireafastresponsetime.Youcandefinewhata transaction must doif nomorethreadsofthetypeit needsareavailable—itcanwaituntil a thread oftherighttypeisavailable;it canuseageneral-purposethread,calleda pool thread;or itcanabend.
Thetypesofthread providedbytheCICSDB2attachmentfacilityare: Command threads
CommandthreadsarereservedbytheCICSDB2attachmentfacilityfor issuingcommandsto DB2usingtheDSNC transaction.Theyarenotused for commandsactingontheCICSDB2attachmentfacilityitself,because thesecommandsarenotpassed toDB2.When acommandthreadisnot available, commandsautomaticallyoverflowtothepool,andusea pool thread.Commandthreadsaredefinedinthecommandthreadssection of theDB2CONNdefinition.
Entry threads
Entrythreadsarespeciallydefinedthreadsintendedfor transactionswith specialrequirements,suchastransactionsthatrequireafastresponse time, ortransactionswithspecialaccountingneeds.Youcaninstructthe CICSDB2attachmentfacilitytogive entrythreadstoparticularCICS transactions.Youdefinethedifferenttypesof entrythreadsthatareneeded for differenttransactions,andyoucan setalimitonthenumberofeachof thesetypesofentrythread.Ifa transactionispermittedtouseanentry thread,butnosuitableentrythread isavailable, thetransaction can overflowtothepool anduse apoolthread,orwaitforasuitableentry thread,orabend,asyouhavechoseninthedefinitionfortheentrythread. Acertainnumberof eachtypeof entrythreadcanbeprotected.Whenan entry threadisreleased,if itisprotectedit isnotterminatedimmediately.It iskeptfor aperiodoftime, andifanotherCICStransaction needsthesame type ofentrythread duringthatperiod,itisreused.Thisavoidsthe
overhead involvedincreatingandterminatingthethread foreach
transaction.Anentrythread thatisunprotectedisterminatedimmediately, unless aCICStransactioniswaitingto useitthemomentitisreleased. EntrythreadsaredefinedusingaDB2ENTRYdefinition.
Pool threads
Poolthreadsareusedfor alltransactionsandcommandsthatarenotusing anentrythread oraDB2commandthread.Poolthreadsareintendedfor low volumetransactions,andforoverflowtransactionsthatcouldnotobtain
anentrythread oraDB2commandthread.Apoolthread isterminated immediatelyif noCICStransactioniswaitingtouseit.Poolthreadsare definedinthepoolthreadssectionof theDB2CONNdefinition.
For moredetailedinformationonhowthedifferenttypesofthread arecreated,used andterminated,see“Howthreadsarecreated,used,andterminated”onpage55. Each threadrunsundera threadtaskcontrolblock(threadTCB)thatbelongs to CICS.CICSandDB2bothhave connectioncontrolblockslinkedto thethreadTCB. They usetheseconnection controlblocksto managethethread intoDB2,andto communicateinformationto eachotherabout thethread.TheDB2connection controlblockcontrols thethread withinDB2.TheCICSconnectioncontrolblock, called theCSUB,actsasa pointerto theDB2connectioncontrolblock,and containstheinformationCICSrequirestocall theDB2 connectioncontrolblock whenthethreadisneeded.DB2callstheseconnectioncontrolblocks “agent structures”.
Thenature ofthethreadTCBs,andthewayinwhichtheyarelinkedtotheDB2 connection controlblock(andthereforeto thethread),differs dependingonthe version ofDB2to whichCICSisconnected.
While CICSisconnecting toa DB2subsystem,it checkstheDB2releaselevelof thesubsystem.IfCICSisconnectingto DB2Version6orlater, theCICSDB2 task-related userexit(themodulethatinvokesDB2foreachtask) isautomatically enabled asopenAPI,soitcan usetheopen transactionenvironment(OTE).If CICSisconnectingto DB2Version5orearlier,thetask-relateduserexit isnot enabled asopenAPI,anddoes notusetheopen transactionenvironment.
Thread
TCBs
in
a
non-open
transaction
environment
When CICSisconnectedto DB2Version5orearlier,andsoisnotusingtheopen transaction environment,thethreadTCBsaresubtaskscreatedbytheCICSDB2 attachmentfacilityto runeach threadthatisrequestedbytransactionsorDB2 commands. TheCICSDB2task-relateduserexit itselfremains ontheCICSmain TCB, theQRTCB.
Oncecreated,thesubtaskthreadTCBsarepermanentlyassociatedwitha particularCSUBandDB2connectioncontrolblock.Whentheprocessfor whicha subtaskthreadTCBwascreatediscomplete,thesubtaskthreadTCB,CSUB,DB2 connection controlblockandthreadarereleased,andthewholeassemblycanbe reusedbyanotherCICStransaction toaccessDB2resources.Sotoreuse an existingthread,theCICSDB2attachmentfacilitymustalso reusethesubtask thread TCBassociatedwithit.
If thethreadisterminatedbefore itisreused,thesubtaskthread TCBandits associatedCSUBandDB2connectioncontrolblockremainavailableinthesystem. Like thethreadsthemselves,it takesprocessorresource tocreatethese,sothe CICSDB2attachmentfacilityreusesthem.If athreadisrequestedandnoexisting threadsareavailable,theCICSDB2attachmentfacilitylooksfor anunusedsubtask thread TCB,CSUBandDB2connection controlblock,andreusesthem toruna new threadintoDB2.
Figure2onpage5 summarizeshow threadTCBsoperateinanon-open transaction environment.
In Figure2, situation1showsCICSusingathread toaccessDB2.OntheCICS main TCB,thelanguageinterfacethatislink-editedwiththeapplicationprogram callstheResourceManagerInterface(RMI),whichinvokestheCICSDB2 attachmentfacility’s task-relateduserexit.TheCICSDB2task-relateduserexit, operating ontheCICSmainTCB,usesanassembly consistingof asubtaskTCB,a CSUB,andaDB2connection controlblocktorunathreadinto DB2.Theplan associatedwiththethread isheldinDB2.
Situation 2showsa threadthatisnotcurrentlyinuse,butisprotected.The subtaskTCB,CSUBandDB2connection controlblockarestillassembledtogether, andthethread runsintoDB2.Thethreadisavailableforreuse.
Plan thread thread
DB2
CICS
Plan Subtask TCB DB2 connection control block CSUBCICS main TCB
Application program Language Interface (stub) Resource Manager Interface (RMI) CICS DB2 TRUE 1 Subtask TCB DB2 connection control block CSUB 2 Subtask TCB DB2 connection control block CSUB 3Situation 3shows anassemblythatisleftafterathread wasterminated.The assembly, consistingof thesubtaskTCB,CSUBandDB2connection controlblock, isavailablefor reuse.It needsa newthread.
Thread
TCBs
in
the
open
transaction
environment
When CICSisconnectedto DB2Version6orlater, itisusingtheopen transaction environment.(Thissituationthereforeappliesto userswithDB2Version7orlater andJDBC2.0.)In thisenvironment,theCICSDB2attachmentfacilityusesopen TCBs (L8mode) asthethread TCBs,ratherthanusingspeciallycreatedsubtask TCBs.OpenTCBs performothertasksbesidesaccessingDB2resources.In the open transactionenvironment,theCICSDB2task-relateduserexit runsonanopen TCBratherthan ontheCICSmainTCB.Iftheapplicationprogramthatmade the DB2 requestisthreadsafe,it canalsorunontheopenTCB.(See“EnablingCICS DB2 applicationstoexploittheopentransaction environment(OTE)through
threadsafeprogramming”onpage106for moreinformationonapplicationprograms intheopentransactionenvironment.)
OpenTCBsarenotpermanentlyassociatedwithaCSUBandDB2connection controlblock.TheCICSDB2attachmentfacilitycanassociate themwithanyCSUB andDB2 connectioncontrolblockthatareavailable,andthereforewithanythread thatisavailable.WhentheopenTCBnolongerneedstheconnectionto DB2,it dissociatesfrom, orreleases,thethread,CSUBandDB2 connectioncontrolblock. Thethread,CSUBandDB2connection controlblockcanthenbeused bya differentopenTCBfor thetasksit wishestoperforminDB2.
If thethreadisterminatedbefore itisreused,theCSUBandDB2connection controlblockremainavailableinthesystem.Ifnoexistingthreadsareavailable, andanopenTCBneedsaconnectionto DB2,theCICSDB2attachmentfacility can associatetheunusedCSUBandDB2connection controlblockwiththeopen TCB, andreuse themto runa newthreadinto DB2.
Figure3onpage7 summarizeshow threadTCBsoperateintheopen transaction environment.
In Figure3, situation1showsCICSusingathread toaccessDB2intheopen transaction environment.TheCICSDB2task-related userexithasbeeninvokedby theResourceManagerInterface (RMI),anditisoperating onanopenTCB.The CICSDB2attachmentfacilityhasassociateda CSUBanda DB2connectioncontrol blockwiththeopenTCB.TheDB2connection controlblockhasathreadinto DB2. Theplanassociatedwiththethread isheldinDB2.
Situation 2showsa threadthatisnotcurrentlyinuse,butisprotected.The CSUBandDB2connectioncontrolblockarestilllinked toeachotherandhave a thread,butnoopenTCBisattached tothem.Thethreadisavailablefor reuse. Situation 3showsanassemblythatisleftafterathread wasterminated.The CSUBandDB2connectioncontrolblockareavailableforreuse.Theyneedanew thread.
Situation 4showsopenTCBs thatareavailablefor reuse.TheCICSDB2 attachmentfacilitycanusetheseopenTCBsandassociateCSUBandDB2 connection controlblockassemblieswiththemto runthreadsintoDB2.
BothtypesofTCBthattheCICSDB2attachmentfacilityusestorunthethreads, theopenTCBs andthesubtaskTCBs,arereferredto inthis documentationas “thread TCBs”.In manysituations, thedifferentnature ofthetwotypesofthread TCBdoes notleadtoanydifferencesintheoperationof theCICSDB2connection.
Plan thread thread
DB2
CICS
1 DB2 connection control block CSUB 2 DB2 connection control block CSUBOpen
TCB
Open
TCB
4 3 DB2 connection control block CSUBOpen TCB
CICS DB2 TRUE PlanWhere thedifferenttypesofthreadTCBdocausetheCICSDB2 connectionto behave differently,a distinctionismadebetweenthetwotypes.Formoretechnical informationonthreadTCBs,see“ThreadTCBs(task controlblocks)”onpage177.
Overview:
How
you
can
define
the
CICS
DB2
connection
You useresourcedefinitiononline(RDO)todefinetheCICSDB2connection.If you aremigratingfromanearlierreleaseofCICSandhavenotused RDObefore,read “MigratingfromaCICSreleasethatusedRCTdefinitionsfor CICSDB2 resources” onpage17.Ifyour CICSsystem isconnected toDB2Version6or later,the MAXOPENTCBSsystem initializationparameteralso influencestheCICSDB2 connection —formoreinformation,see “TheMAXOPENTCBSsysteminitialization parameter andTCBLIMIT”onpage52.
As wehavereadin“Overview:HowCICSconnectsto DB2”onpage 1,theCICS DB2 connectionconsistsofanoverallconnectionbetweenCICSandDB2,and individual connectionsknownasthreads.Youcandefinetheattributesoftheoverall connection,andtheattributesof thedifferenttypesof thread.Ifyou havespecially defined entrythreadsforkeytransactions,youcantell theCICSDB2attachment facilitywhichCICStransactionscanusethosethreads. DefiningtheCICSDB2 connection involvesthreedifferentobjects:DB2CONN(theDB2connection definition),DB2ENTRY(theDB2entrydefinition),andDB2TRAN(theDB2 transaction definition).Thescopeof eachobjectisasfollows:
DB2CONN
DB2CONN isthemain definitionfor theCICSDB2 connection.Youneedto install aDB2CONNbefore youcanstarttheCICSDB2connection.Inthe DB2CONN definition,you:
v Definetheattributesof theoverallCICSDB2 connection,whichare:
– theDB2 subsystemthatCICSconnectsto,or thedata-sharinggroup of
DB2subsystemsfromwhichDB2picksanactivememberforCICSto connectto
– iftheconnectionto DB2fails,whetherCICSreconnectsautomaticallyor
not,and,ifyouareusingthegroup attachfacility,whetherCICS reconnectstothesameDB2subsystemor not
– ageneral-purposeauthorizationIDfortheCICSDB2attachmentfacilityto
signontoathread,if nootherauthorizationisneededforthethread – thelimitonthetotal numberof TCBsthatCICScanusetorunthreads
intoDB2atanyonetime
– howlongprotected threadsarekept beforetermination
– howerrormessagesarecommunicated toCICS,andwhattransactions
shoulddoif theirthreadfails
– wheremessages andstatisticsaresent
v Definetheattributesof commandthreads(thespecialthreadsusedbythe
DSNCtransactionfor issuingDB2 commands),whichare:
– thelimitonthenumberof commandthreadsthatCICScanuseat any
onetime
– whattype ofauthorizationIDDB2checkswhenacommandthreadis
requested(for example,theIDof theuser, theIDof thetransaction,the general-purposeCICSDB2attachmentfacilityID)
v Definetheattributesof poolthreads(thegeneral-purposethreadsusedwhen
– whattypeof authorizationIDDB2checkswhenapool threadisrequested
(forexample,theIDof theuser,theIDofthetransaction, the general-purposeCICSDB2attachmentfacilityID)
– whatthepriorityofthethreadTCBs isrelative totheCICSmainTCB
– thelimitonthenumberof poolthreadsthatCICScan useatanyonetime
– ifatransaction cannotgeta poolthread,whether itshouldwaitforone,or
beabended
– whatapplicationplanordynamicplanexit isused forthepoolthreads
(see“Plans,packagesanddynamicplanexits”onpage13)
– atwhatpointduringatransaction’suseof thethread DB2accounting
recordsareproduced
– ifthereisadeadlock,whether changesmade bythetransactionusingthe
threadarerolledback
You canhaveonly oneDB2CONNdefinitioninstalledinaCICSsystem atone time, andalltheDB2ENTRYandDB2TRANdefinitionsthatyouinstallinthe system areassociatedwiththeDB2CONNdefinition.If youdiscarda
DB2CONN definition,alltheDB2ENTRYandDB2TRANdefinitions are
discardedaswell.YoucannotdiscardaDB2CONN definitionandinstall another onewhileCICSisconnectedtoDB2.
You canstarttheCICSDB2connection withonly aDB2CONNinstalled—you donotneedanyDB2ENTRYandDB2TRANdefinitions tomaketheconnection. If youdothis, therearenospecialthreadsforkeytransactions(entrythreads). Alltransactionsusegeneral-purposethreadsfromthepool, andthemost important transactionshave towaitjustaslongastheleastimportant transactionsto gettheirindividual connectionintoDB2.Toensurethatyour important transactionsareprioritized,createDB2ENTRYand,ifnecessary, DB2TRANdefinitions forthem.
DB2ENTRY
You cansetupmanyDB2ENTRYdefinitions todefinedifferenttypesof entry threads.Theentrythreadscanbeusedbythetransactionsthatyou specify,to gain priorityaccess(orspecializedaccess)toDB2resources.In effect,youare reservingacertainnumberofthreadsthatcanonly beused bythose
transactions.Youcanalso protecta numberof eachtype ofentrythread,which improvesperformancefor heavily-usedtransactions.In aDB2ENTRYdefinition, youcan specifyaparticulartransaction,or (byusingawildcard)a groupof transactions,thatareassociatedwiththeDB2ENTRYandcanusethetypeof entry threadthatitdefines. Whenthosetransactionsrequestathread,theCICS DB2attachmentfacilitygivesthemthattypeof entrythread,ifoneisavailable. If youwantothertransactionsto usethesametypeof entrythread,youcan createaDB2TRANdefinitionforthosetransactions,whichsimplytellsCICS thatthetransactionsareassociatedwithaparticularDB2ENTRY.
In eachDB2ENTRYdefinition,you: v
Specifyatransaction, or(byusinga wildcardinthename)a groupof
transactions,thatcanusethistypeof entrythread
v Definetheattributesof thistypeof entrythread,whichare:
– whattypeof authorizationIDDB2checkswhenthistype ofentrythread is
requested(for example,theIDoftheuser, theIDof thetransaction,the general-purposeCICSDB2attachmentfacilityID)
– whatthepriorityofthethreadTCBs isrelative totheCICSmainTCB
– thelimitonthenumberof thistypeof entrythreadthatCICScanuseat
– thenumberof thistypeof entrythreadthatareprotectedfor aperiodof
timewhiletheyarenotbeingused
– ifatransaction associatedwiththeDB2ENTRYcannotgetthistypeof
entrythread,whether itshouldwaitforthis typeofentry thread,overflow tousea poolthread,or beabended
– whatapplicationplanordynamicplanexit isused forthis typeofentry
thread(see“Plans,packagesanddynamicplan exits”onpage13) – atwhatpointduringatransaction’suseof thethread DB2accounting
recordsareproduced
– ifthereisadeadlock,whether changesmade bythetransactionusingthe
threadarerolledback
You cannotdiscardaDB2ENTRYwhiletransactionsareusingthattype ofentry thread —youmustdisable itfirst,to quiesceactivityontheDB2ENTRY,and then discardit.If youdiscardaDB2ENTRY,theDB2TRANsassociatedwithit are“orphaned”,andthetransactionslistedinthem willusepool threads. DB2TRAN
You canuseDB2TRANdefinitionsto associateadditionaltransactionswitha particularDB2ENTRY—thetransactionswillthenuse thattypeofentry thread. OnlyoneDB2TRANdefinitioncanbeinstalledfor aspecifictransaction.In each DB2TRANdefinition,yousimply:
v Specifythenameof aDB2ENTRY
v Specifyatransaction, or(byusinga wildcardinthename)a groupof
transactions,thatareassociatedwiththeparticularDB2ENTRYandcanuse thistypeof entrythread
Whenthosetransactionsrequestathread,theCICSDB2attachmentfacility seesthattheyareassociatedwiththeparticularDB2ENTRY,andtreatsthem like thetransactionortransactionsnamedontheDB2ENTRYdefinitionitself. You candefineandinstallDB2CONN,DB2ENTRYandDB2TRANobjects using RDO. Theobjects canalsobedefinedinbatchusingDFHCSDUP.CICSplex SM usesEXECCICSCREATEto installtheseobjects.Fordetailed informationabout how todefineeach oftheseobjects,seetheCICSResourceDefinitionGuide.
Overview:
Enabling
CICS
application
programs
to
access
DB2
ACICSapplicationprogramthataccessesDB2mustbepreparedinthesameway asa normalCICSapplicationprogram,andalso gothroughDB2’sbindprocess. Thebind processisaDB2processthatproducesanapplicationplan(often just called a“plan”).Eachplan containstheboundformofalltheSQLstatementsfrom theapplicationprogramsthatuseit,anditallowsthoseapplicationprogramsto accessDB2dataat executiontime.
TheplansareheldwithinDB2,andeach threadintoDB2relatesto aplan.The plan thateachtypeof threadusesisnamedontheDB2CONNdefinition(forpool threads)or thethread’s DB2ENTRYdefinition(forentry threads).Theplanfor a particulartypeof threadmust containtheboundformof theSQLstatementsfrom alltheapplicationprogramsthatusethattypeof threadto accessDB2.Youcan either nametheplanexplicitly,orname adynamicplanexit,a routinethat
determineswhich plantouse forthetransactionthathasrequestedathreadof that type.
v “Thebindprocess”onpage12
v “Plans,packagesanddynamicplanexits”onpage13
Preparing
a
CICS
application
program
that
accesses
DB2
Figure4onpage12showsthestepsinpreparing aCICSapplicationprogramto accessDB2.
Thefirststep isto puttheprogramthroughtheDB2precompiler.TheDB2 precompiler buildsadatabaserequestmodel(DBRM)thatcontainsinformation about eachof theprogram’sSQLstatements.
Thesecond, thirdandfourthstepsarethenormalprocessfor preparinganyCICS applicationprogram,whetherornotit accessesDB2.Thesecondstepistoputthe programthroughtheCICScommandlanguagetranslator.Thethirdstepisto compileorassembletheprogram.Thefourth stepistolink-edittheprogramwith thenecessaryinterfaces(includingtheCICSDB2languageinterface module DSNCLI).TheendproductofSteps 2,3and4 isanapplicationload modulethat enables theprogramto run.Formoreinformationonthesesteps,see“CICSDB2 programpreparationsteps”onpage134.
An extrastepisrequiredtoenabletheprogramtousetheinformationintheDBRM thatwascreatedinStep1.This fifthstepisthebindprocess.Thebindprocess requiresDB2, anditusestheDBRMtoproduceanapplicationplan thatenables theprogramtoaccessDB2data.See“Thebindprocess”onpage12foran explanationofthebindprocess.
If youareusingoneof theLanguageEnvironment®-conformingcompilersfor COBOLandPL/I,youcancombinesomeof thesestepsintoa singletask,because thesecompilershaveintegratedtheCICScommandlanguagetranslator,and (dependingonyourversionof DB2)anSQLstatementcoprocessor.See“CICS DB2 programpreparationsteps”onpage 134formoreinformation.
The
bind
process
Before anyCICSapplicationthataccessesDB2canrun,it needsto gothroughthe bind process.For thebindprocess,yourequire:
v DB2
v TheDBRM(databaserequestmodule)produced bytheDB2precompilerfor
eachprogramintheapplication.
TheDBRMcontainstheSQLstatementsthattheDB2precompilerhasextracted fromtheapplicationprogram.Inthebindprocess,theSQLstatementsintheDBRM areputintoanoperational(“bound”)form,bybeingtranslatedintothecontrol structuresthatDB2useswhenitrunsSQLstatements. Theresultingmaterialcan bemade intoapackage,oritcan beplacedstraightintoanapplicationplan(see “Plans,packagesanddynamicplanexits”onpage 13).Thewholeprocessiscalled “binding” theDBRM. Formoreinformationonbinding,seetheDB2Universal Database forOS/390andz/OSApplication ProgrammingandSQLGuide.See “Bindoptions andconsiderationsforprograms” onpage 138formoredetailon options youshouldchooseduringthebind processintheCICSDB2environment..
USER JCL AND SUBMIT TO BATCH OR
DB2I
(1) DB2 PRECOMPILER DBRM
(2) CICS COMMAND LANGUAGE TRANSLATOR
(3) COMPILE OR ASSEMBLE PROGRAM
(4) LINK EDIT WITH INTERFACES (5) BIND
APPLICATION LOAD MODULE PLAN
Plans,
packages
and
dynamic
plan
exits
An applicationplan allowsapplicationprogramstoaccessDB2dataatexecution time. Itcontainsthebound(operational)formof theSQLstatementsfromthe DBRMsthatwerebuilt fromtheapplicationprograms.It alsorelatesthewhole applicationprocessto thelocalinstanceof DB2whereit willbeused.
TheoperationalSQLstatementsfromaDBRMcanbeplacedstraightintotheplan, inwhichcasewesaythattheDBRMisboundinto aplan.Alternatively,youcan bind aDBRMintoapackage(usingtheBINDPACKAGE command),which containstheoperationalSQLstatements froma singleDBRM.Youcangroup relatedpackagesintocollections.Youcanthen includethepackagename or collection nameinalistof packages,andbindthelistof packagesintotheplan.A single plancancontainbotha packagelist, andDBRMsbounddirectlyintothe plan. YoucancreateaplanusingtheDBRMsfromasingleCICSapplication,or you canusetheDBRMsfrommorethanoneapplicationtocreateasingleplan. As wellasbeingcreated,applicationplansneed tobemaintained.IftheSQL statements changeinoneor moreoftheapplicationprograms usinga plan,you need torebuildtheDBRMsfor thechangedapplicationprograms.Ifyouboundthe oldversionsof thoseDBRMsdirectlyintoyourplan, youneedto identifyallthe DBRMsthatarebounddirectlyinto thatplan,forboth thechanged programsand any unchangedprograms,andbindthemallintotheplan again.While youare binding theDBRMsintotheplan,applicationscannotusetheplanto accessDB2. However, ifyouboundtheoldversionsof theDBRMsfor thechanged application programs intopackages,andthenincludedthenamesof thepackages(orofthe collectionscontainingthem) onthepackagelistintheplan, youdonotneed tobind any otherpackagesordirectly-boundDBRMsinto theplan again.Yousimply bind thenew versionsof theDBRMsfor thechanged applicationprogramsinto
packageswiththesamenamesastheoldversions.You donotneedto bindthe plan again—itlocatesthenewversionsof thepackages. Whileyouarechanging thepackages,applicationprogramscanstillusetheotherpackagesand
directly-boundDBRMsintheplan. See“Whatto bindafteraprogramchange”on page 137formoreinformationonmaintainingplans.
Each threadintoDB2relatesto aplan—see“Overview:Howthreadswork”onpage 2 formoreinformationabout threads.Theplan thateach typeof threadusesis namedontheDB2CONNdefinition(forpoolthreads)or thethread’s DB2ENTRY definition(for entrythreads).WhenCICSrequeststheuseof athreadfor an applicationtoaccessDB2,it tellsDB2thename oftheplanassociatedwiththat type ofthread,andDB2locatestheplan.Thedefinitionforeach typeofthread can either namea specificplan, orit cannameadynamicplanexit, aroutinethat determineswhich plantouse forthetransactionthathasrequestedthethread. If thedefinitionof thepoolthreador entrythreadnamesa specificplan, allthe transactionsthatusethattypeof threadmust usethatplan.Thetransactionsthat can useatypeof entrythreadarespecifiedintheDB2ENTRYandDB2TRAN definitions forthethread.IftheDB2ENTRYdefinitionforthethread namesa specificplan, theDBRMsfromalltheapplicationprogramsthatcouldrununderall thosetransactionIDs mustbeboundintothesameplan,orboundintopackages thatarethenlistedinthesameplan.If theDBRMsfromanyof theapplication programs thatrununderthosetransactionIDs arebounddirectlyintotheplan, and you changetheSQLstatementsinanyofthoseapplicationprograms, thewhole plan willbeinaccessiblewhileyoubindallthedirectly-boundDBRMsintotheplan again.Thismeansthatnotransactioncanusethattypeof entrythreadwhileyou aremaintainingtheplan. Poolthreadscouldbeusedbyanyof yourCICS
applicationsthataccessDB2,soiftheDB2CONNdefinitionnamesa specificplan for thepoolthreads,theplanneedstobepreparedandmaintainedusingthe DBRMsfromallthoseapplications. Ifanyof theDBRMshavebeen bounddirectly into theplan, thewholeplanwillbeinaccessibleduringmaintenance,andno transaction willbeableto useapoolthread.
There aretwoways toavoidmakingtypesofthread unavailablewhileyouare maintainingplans.Thebest solutionistoavoidbindingDBRMsdirectlyinto plans, byusingpackagesinstead.If youbindeach separateDBRMasapackageand include theminpackagelistsinplans,theplansarestillaccessiblewhileyouare maintainingindividualpackages. Whileyouarecarryingoutmaintenanceworkona particularprogram,thepoolthreadsorentrythreadsrelatedtoplansinvolvingthat programarestillavailable, becausetheplansarestillaccessible.Thismeansthat you cansafelynameaspecificplan foreach thread.Ifyou wantto startusing packages, see“Usingpackages”onpage90andtheDB2Universal Databasefor OS/390andz/OSApplicationProgrammingandSQLGuidefor detailsof howto implementpackages.
An alternativesolution,developedbeforepackageswereavailableinDB2,isto use a dynamicplan exit.Usinga dynamicplan exitmeansthatyoudonothave to name aspecificplanfor eachtypeof thread,soeven whenaparticularplan is inaccessibleduringmaintenance,thethreadsarestillavailable.Toimplementthis solution,youcreatemanysmallplansfor yourCICSapplications, eachcontaining theDBRMsfromafewclosely-related programs.Then,insteadof specifyinga plan name inthePLANattributeof theDB2CONNorDB2ENTRYdefinitionfor eachtype of thread,youspecifyanexitprograminthePLANEXITNAMEattribute.Whenan applicationprogramissuesitsfirstSQLstatementandacertaintype ofthread is requested,theexitprogramthatyouhavespecifiedinthethreaddefinitionselects theplan tousefor thatapplicationprogram.Ifa particularplanisinaccessible duringmaintenance,theapplicationprogramsrequiring thatplancannotusea thread,butotherapplicationprograms canusethesametype ofthreadwiththeir own plans.However,notethatonce aparticularinstanceof atypeof threadhas been createdforanapplicationprogramtouse, thatthreadinstanceisassociated withtheplanthatthedynamicplanexitselected.Foranotherapplicationprogram to reusethethread,itmust usethesameplan. Ifthedynamicplan exitselectsa differentplan fortheapplicationprogram,it mustfindorcreateadifferentthread withthecorrectplan.Thisreducestheopportunitiesforthread reuse.See“Dynamic plan exits”onpage96formore informationondynamicplanexits.
Chapter
2.
Installation
and
migration
notes
for
CICS
DB2
This chapterprovidesinformationyoushouldknowwhenyouareplanningand carrying outinstallationormigrationproceduresintheCICSDB2environment. v “CICSstartupJCLrequirements forconnection toDB2”v “Supportedreleasesof DB2”
v “Migratingto adifferentreleaseofDB2”
v “Migratingfroma CICSreleasethatused RCTdefinitions forCICSDB2
resources”onpage17
CICS
startup
JCL
requirements
for
connection
to
DB2
TheCICSDB2attachmentfacilityhastoloadtheDB2programrequesthandler, DSNAPRH.Todothis,theDB2library,db2hlq.SDSNLOAD,shouldbeplacedinthe MVS linklist,oraddedtotheSTEPLIBconcatenation ofyourCICSjob(where db2hlqisyourchosenhigh-levelqualifier forDB2libraries).
TousetheDB2JDBCdriver shippedwithDB2Versions7or 8,the db2hlq.SDSNLOD2libraryalsoneedsto beaddedtotheCICSSTEPLIB
concatenation.TheDB2JDBCdriversshipped withDB2Versions 5and6donot requirethislibrary.
TomodifyyourCICSstartupJCLyoushouldconcatenatethefollowing librarieson theSTEPLIBDDstatementasfollows:
v db2hlq.SDSNLOAD(aftertheCICSlibraries)
v db2hlq.SDSNLOD2(aftertheCICSlibraries)
There shouldbenoDB2librariesintheDFHRPLDDstatement.If DB2librariesare requiredintheDFHRPLconcatenationbyanapplication,or byanotherproduct, they shouldbeplacedaftertheCICSlibraries.
Supported
releases
of
DB2
CICSsupports thefollowing releasesof DB2:
v DB2UniversalDatabaseServerfor OS/390Version6
v DB2UniversalDatabaseServerfor OS/390andz/OSVersion7
v DB2UniversalDatabaseServerfor OS/390andz/OSVersion8
CICSprovidesaCICSDB2attachmentfacility(theCICSDB2adaptor)thatworks withallsupportedreleasesof DB2.TheCICSDB2attachmentfacilityisshippedon theCICSTransactionServerproducttape, andyou mustusethisversion ofthe attachmentfacilitytoconnect aCICSTransactionServerregiontoDB2.
TheCICSDB2attachmentfacilityhasbeensuppliedbyCICSsinceCICS/ESA® 4.1.AlwaysusethecorrectCICSDB2attachmentfacilityforthereleaseof CICS under whicharegionisrunning—theCICS4.1attachmentfacilityfor aCICS4.1 region,andsoon.
Migrating
to
a
different
release
of
DB2
When youareplanningmigrationto anewerDB2release,considerthefollowing information:
To usethe DB2groupattachfacility withCICS,CICSmustbeconnectedto DB2Version7 orlater.You mustalsouse DB2Version7orlater“early” (ERLY) code,meaningthattheDB2Version7or laterversionof db2hlq.SDSNLINKmust bepresentintheMVS linklist (wheredb2hlqisyourchosenhigh-levelqualifier for DB2 libraries).Youmustalso applyAPARSPQ44614, PQ45691,andPQ45692. (An MVS IPLisrequiredfor theseDB2APARSto takeeffect.)
Withthegroupattachfacility,insteadof connectingtoa specificDB2subsystem, you canchoosetoconnect toanyonememberof adata-sharinggroupof DB2 subsystemswhich isactive onanMVSimage.Thisallowsyoutousea common DB2CONN definition,specifyinga groupID,acrossmultipleclonedAORs,andto reconnectrapidlyif theconnection toDB2fails.See“UsingtheDB2groupattach facility”onpage51formoreinformation.
For theCICSDB2attachmentfacility tousetheopentransactionenvironment (OTE),CICSmustbeconnectedtoDB2Version6 orlater.You mustalsouse DB2 Version6 orlater“early” (ERLY)code,meaningthattheDB2Version6or later version ofdb2hlq.SDSNLINKmust bepresentintheMVS linklist. Ifyouareusing DB2 Version6 earlycode,youmustapplyAPARSPQ43242andPQ50703.If you areusingDB2Version7early code,youmust applyAPARSPQ46501and PQ50703. (AnMVS IPLisrequiredfor theseDB2APARSto takeeffect.)
Theopen transactionenvironmentenablestheCICSDB2task-relateduserexit to execute onanopenTCB.OpenTCBs,unliketheQRTCBorsubtaskthreadTCBs, may beused forbothnon-CICSAPIrequests (includingrequeststo DB2)and threadsafeapplicationcode.Because threadsafeapplicationcodecanbeexecuted ontheopenTCB,athreadsafeCICSDB2applicationshouldnotneedto switch betweendifferentTCBsseveraltimesduringtheexecutionof aCICSDB2 application.Thissituationproducesa significantperformanceimprovement where anapplicationprogramissues multipleSQLcalls.See“Enabling CICSDB2 applicationsto exploittheopentransactionenvironment (OTE)throughthreadsafe programming” onpage106for moreinformationontheopen transaction
environment anditsperformancebenefits.
If youare migratingtoDB2Version6orlater,notethatwitheffectfromDB2 Version6, theCICS-DB2languageinterfacemodule, DSNCLI,isnolongershipped bytheDB2product.CICSshipsthelanguageinterface stubinboth the
SDFHLOAD andSDFHAUTHlibraries asaCICSnamedmodule, butalso with appropriatealiasesforcompatibility. InSDFHLOAD,thestub iscalled DFHD2LI, withaliasesofDSNCLI,DSNHLI,andDSNWLI.In SDFHAUTH,thestub iscalled DFHD2LIX,withaliasesDSNCLI,DSNHLI,andDSNWLI.Ensure thatthelibrary concatenation fortheDB2librarySDSNLOADandtheCICSlibrarySDFHLOAD are correctfor yoursite,becausebothlibrariescontaintheDSNHLIalias.
If youare migratingtoDB2Version6orlater,andusingtheopentransaction environment,ensurethatthelimitsetinyourMAXOPENTCBSsysteminitialization parameter isgreater thanthelimitsetintheTCBLIMITattributeof yourDB2CONN definition. Intheopentransactionenvironment,MAXOPENTCBSdefines thetotal numberof openTCBsallowedintheCICSsystem,andTCBLIMITdefinesthe numberof theseopenTCBs thatcanbeused toconnect toDB2.If your
MAXOPENTCBSlimitislowerthanyourTCBLIMIT,awarning messageisissued whenCICSconnectstoDB2, andyoumayfindthatyoudonothave enoughopen TCBs availabletoprocess yourDB2workload.Inaddition,whenrunningwith TransactionIsolationactiveandconnectedtoDB2Version6 orlater,set
MAXOPENTCBSto thevalueof maxtasks(MXT)or higher.This willminimisethe # # # # # # # # #
possibilityofTCBstealingduetoaTCBbeingallocatedtothewrongsubspace.For more information,see“TheMAXOPENTCBSsystem initializationparameterand TCBLIMIT” onpage52.
Migrating
from
a
CICS
release
that
used
RCT
definitions
for
CICS
DB2
resources
In releasesof CICSearlierthanCICSTransactionServerfor OS/390,Version1 Release2, theconnectionbetweenCICSandDB2wasdefinedintheresource controltable (RCT).TheRCTdescribedtherelationshipbetweenCICStransactions andDB2resources(applicationplansandcommandprocessors)andwas
generated usingtheDSNCRCTmacroprovidedbytheCICSDB2 attachment facility.VersionsandreleasesofCICSfromCICSTransactionServerfor OS/390, Version1 Release3onwardsdonotsupportrunningtheCICSDB2attachment facilityusingthemacroDSNCRCT.
If youaremigratingfromaCICSreleasethatdefinedtheCICSDB2connection usingaresource controltable,younow needtodefineDB2resource definitions usingCICSresourcedefinitiononline(RDO).MacroRCTscan stillbeassembled for thepurposeofmigratingthemtotheDFHCSD fileonly.TheDSNCRCTmacrois shipped withCICSto allowmigrationof RCTtablesto theCSD.Itisnow wholly owned by,andincorporatedin,CICS.For moreinformationaboutDSNCRCT,see CICSResourceDefinition Guide.
When describingparametersof theCICSDB2connection,thenamesofthe parametersof theRDO objectsarenowused,nottheDSNCRCTmacroparameter names.TheCICSResourceDefinitionGuidedescribeswhichDSNCRCTmacro parameter appliestowhich RDOparameter,andwhich RDOparameterapplies to which DSNCRCTmacroparameter.
AllchangesmadetoDB2 resourcedefinitionsinstalleddirectlyfromtheCSD,or made byusingEXECCICSCREATEcommands, arecatalogedandrecoveredina CICSrestart.Also,theDB2objectsinstalledfromtheCSDremaininstalledafterthe CICSDB2attachmentfacilityisstopped.
This topicprovidesinformationtoassist youwiththemigrationprocess,asfollows: v “Ifyouhave notused CICSresourcedefinitiononline(RDO)before”
v “EffectofmigrationtoRDO onCICSDB2attachmentfacilityoperations”onpage
18
v “EffectofmigrationtoRDO onapplicationprograms”onpage21
v “EffectofmigrationtoRDO ontheINITPARMsystem initializationparameter”on
page21
v “EffectofmigrationtoRDO ondefaults forresourcedefinitionparameters”on
page21
v “Migratingto RDOfor DB2resourcedefinition”onpage 21
If
you
have
not
used
CICS
resource
definition
online
(RDO)
before
Using onlineCICSDB2resource definitionmeansthatyoudonothaveto shut downtheinterfacebetweenCICSandDB2whenadding, deleting,orchanging CICSDB2resourcedefinitions.Thebenefits ofusingonlinedefinitionforDB2 resourcesarediscussedinthefollowingsections:
v Function
v Performance
Function
Thefunction oftheCICSDB2attachmentfacilityisenhancedbyusingonline resource definitioninthefollowingways:
v Existingmacro-definedRCTload modulescanbeeasilymigratedto theCICS
systemdefinitionfile(CSD)usinganRCTmigrationutility.
v TheCICSDB2 attachmentfacilityisfullyintegratedintoCICSproviding
enhancedfirstfailuredata capture,enhancedmessages withNLSsupport,more tracingincludingexceptiontracing,andsystemdump supportwithformatting integratedinto theCICSIPCSverbexit.
v Itenables managementoftheCICSDB2interfacebyCICSplexSM,including
singlesystemimageandsinglepoint ofdefinitionacrossaCICSplex.
v TheCICSDB2 definitionsbecomeaCICS-managed resourcewhichprovidesa
consistentenduserinterface:
– CEDAandDFHCSDUPfor definingandinstallingentries
– EXECCICSCREATEforinstallingentries
– CEMT/EXECCICSINQUIRE,CEMT/EXEC CICSSET,andCEMT/EXEC
CICSDISCARD formanipulatinginstalledentries.
Enhancementsmadeto theCICSDB2attachmentfacilitybeforeCICS TransactionServerforOS/390,Version1Release3included:
– ImprovedCICSDB2statisticsintegratedwithCICS
– ImprovedattachmentfacilityshutdowncoordinatedwithCICSshutdown
– ImprovedTCBmanagement
– Improvedthreadmanagement anddisplays
– Anewaccounting option
System
availability
Online CICSDB2 resourcedefinitionallowsyouto add,deleteorchangedefinitions without theneedtoshut downtheinterface betweenCICSandDB2.Youare thereforeprovided withcontinuous availability.
Performance
Online CICSDB2 resourcedefinitionprovidesbenefits toperformanceasfollows: v CICSDB2controlblocksaremovedabovethe16MBlineprovidingvirtual
storageconstraintrelief(VSCR).
v OnlineCICSDB2resourcedefinitionprovidestheability tospecifygeneric
transactionnames,usingwildcardsymbols,whichcanreducethenumberof definitionsrequiredinCICS.
Effect
of
migration
to
RDO
on
CICS
DB2
attachment
facility
operations
Changesto theCICSDB2attachmentfacilityaffecttheoperation ofthefacilityin thefollowingways:
Attachment startupandshutdown
You canusetheDSNCSTRTcommandto starttheCICSDB2attachment facility.
Thesyntaxof theDSNCSTRTcommandisDSNCSTRTyyyy.Anyvalue specifiedaftertheSTRTistreatedasaDB2ID.ThisoverridesanyDB2IDor DB2GROUPIDspecifiedintheDB2CONNdefinition.Ifnovalueisspecified, the valuefromtheinstalledDB2CONNisused.If youwantto usegroupattach,do notspecifyavalueontheDSNC STRTcommand.
CICSobtainstheIDof theDB2subsystemtowhich itconnectsfromoneofthe following sources,intheorderof priorityshown:
1. AsubsystemIDinaDSNCSTRTcommand,ifspecified.
2. ADB2ID intheinstalledDB2CONNresourcedefinition,if notblank.
3. ADB2GROUPIDintheinstalledDB2CONNforgroup attach,if specified.
4. AsubsystemIDspecifiedontheINITPARM systeminitialization parameter,
whentheDB2IDandDB2GROUPIDintheinstalledDB2CONNresource definitionareblank(orhavesubsequentlybeen settoblanks). Onany startup,INITPARM isalwaysused ifthelastinstalledDB2CONNcontained a blankDB2IDanda blankDB2GROUPID, eveniftheDB2IDor
DB2GROUPIDwere subsequentlychangedusingaSETcommand. 5. AdefaultsubsystemIDofDSN.
You canusetheDSNCSTOP<QUIESCE|FORCE>commandtostop theCICS DB2attachmentfacility.TheQUIESCEoptionnowwaitsfor allactive
transactionsto complete,thatis,new UOWscanstartandacquirethreads.In releasesofCICSearlierthanCICSTransactionServerforOS/390,Version1 Release2, aquiescewouldonlywaitforactivetransactionstoreleasetheir thread,which,typically, wasat theendof aunitof work(UOW).
Duringshutdownof theCICSDB2 attachmentfacilityinitiatedbyDSNCSTOP, theterminalremains lockeduntilthestopiscomplete,whenmessage
DFHDB2025isissued.
As analternativeto theDSNCcommand,youcanstartandstop theCICSDB2 attachmentfacilityusingtheEXECCICSSETDB2CONN
CONNECTED|NOTCONNECTEDcommands.You canalsostop theCICSDB2 attachmentfacilitybystartingtheCICS-suppliedtransactionsCDBQandCDBF fromanapplicationprogram,usinganEXECCICSSTARTcommand.CDBQ causes aquiescecloseandCDBFcauses aforceclose.
CICSDB2attachmentfacilitycommandchanges
Thepoolsection oftheDB2CONNresourcedefinitiondoes nothaveaTXID parameter associatedwithit.Tomodifythenumberof threadsallowedonthe pool, usereservedname CEPLontheDSNC MODIFYTRANScommand.For example,issuethefollowingcommand(wheren isthenew numberof threads).
DSNC MODIFY TRANS CEPL n
TheDSNC DISPTRANttttcommandnowdisplaysallthreadsrunningfor a particulartransid,insteadof allthetransactionsassociatedwithanRCTentry. In earlierreleases,CICSusesthettttoperandtolocateanRCTentryandthen displaysallthethreadsfor thatentry.
Whenyou usetheDSNC DISPSTATcommand,CICSdisplaysstatisticsfor DSNC commandsonalinebeginning’*COMMAND’.Poolthreadstatistics are displayed ona linebeginning’*POOL’.
WhenmodifyinganRCTentryusingtheDSNC MODIFYTRANSttttcommand, specifyttttexactlyasitwasdefinedintheRCT. Ifyoudefineda genericTXID, youmust refertothegenericnamewhenmodifyingit witha DSNCcommand. For example,ifyouhave transactionscalledTABandTAC,butthey aredefined genericallyasTA*,youcan modifytheseonaDSNC commandonly bytheir genericname: