Jan Panneels - GSE Young Professionals aM Smart - I am using IMS - 2010-11... · Jan Panneels...
Transcript of Jan Panneels - GSE Young Professionals aM Smart - I am using IMS - 2010-11... · Jan Panneels...
VilvoordeVilvoorde
November November 18, 201018, 2010Jan PanneelsSenior Consultant
Sogeti Belux
Back to Reality
•• Most ‘new’ application Most ‘new’ application development is done development is done offoff--MainframeMainframe
•• Young IT professionals Young IT professionals don’t know the Mainframedon’t know the Mainframe
•• Not all Mainframe data is Not all Mainframe data is easy to get toeasy to get to
2
easy to get toeasy to get to
•• A Mainframe does not have A Mainframe does not have the sexiest user interfacethe sexiest user interface
•• A Mainframe has unique A Mainframe has unique capabilitiescapabilities
The Mainframe is very often the host of the critical The Mainframe is very often the host of the critical business data and the operational business logicbusiness data and the operational business logic
Application re-write
Application Development
MachineReRe--write observations:write observations:
�� Data location ?Data location ?
�� CostlyCostly
�� Often only new FrontOften only new Front--EndEnd
�� Time consumingTime consuming
3
Solution : reSolution : re--use existing:use existing:
�� DataData
�� Business LogicBusiness Logic
�� ApplicationsApplications
Time
Cost
Quality
Time consumingTime consuming
Application Empowerment
Operational
Applications
Operational
Applications
Operational
Applications
Front-end
AdaptorConnectivity Web Service
Service Service
ESB
4
Adaptor
GUI Interface
New
ApplicationNew
Application
ESB
Service Service
Application reApplication re--useuse SOASOA
IMS Connectivity
OtherOther ::
�� DB2 SP’s and ODBADB2 SP’s and ODBA
�� IMS Open DatabaseIMS Open Database
�� DRDDRD
5
•• Observations :Observations :
�� Few nonFew non--WAS / nonWAS / non--Java solutionsJava solutions
�� IMS Connect becomes essentialIMS Connect becomes essential
•• IntroductionIntroduction
•• DB2 SP using ODBADB2 SP using ODBA
•• Issue with DB2 SP using ODBAIssue with DB2 SP using ODBA
•• ECE and IMS ConnectECE and IMS Connect
•• Q & AQ & A
Agenda
6
7
Application View
Application
Servers
Data
Source
Client
IN
OUT
8
Server DataThe application is unaware of the The application is unaware of the
format or the location of the dataformat or the location of the data
DB2 Stored Procedures
9
DB2 Stored Procedures
WorkstationWorkstation Application ServersApplication Servers DB2 Connect ServersDB2 Connect Servers System zSystem z
••SQLSQLDB2DB2
DB2 Stored ProcedureDB2 Stored Procedure
10
EXEC SQL CALL SPEXEC SQL CALL SP••DL/IDL/I
••DSNAIMSDSNAIMS
••DSNACICSDSNACICS
••Get/PutGet/Put
••MQ UDFMQ UDF
IMSIMS
IMS TransactionIMS Transaction
NonNon--DBDB
CICS TransactionCICS Transaction
MQ QMQ Q
DB2 Stored Procedure
11
DB2 SP and ODBA Overview
12
What is involved ?
13
•• BrowserBrowser
•• Calling applicationCalling application
•• DB2 Client softwareDB2 Client software
•• DB2 ConnectDB2 Connect
•• DDFDDF
•• DB2 Stored ProcedureDB2 Stored Procedure
•• WLM Application EnvironmentWLM Application Environment
•• RRSRRS
•• Security systemSecurity system
•• TCPIP networkTCPIP network
•• IMS/DB; IMS/TM; CICS; …IMS/DB; IMS/TM; CICS; …
DB2 SP – ODBA – IMS/DB
14
IMS Setup for ODBA
IMS Stop/Start required
Update IMS Startup Parameter member
Create a PSB
Create a DRA Startup Table
15
Assembled and Linked as DFSiiii0 in
SDFSRESLBSample in : IMSxxx.INSTALIB(IV3E306J)
WLM APPLENV Setup
11 22
33
16
44
55
DB2 Stored Procedure
17
DB2 SP : another AS using IMS
Application EnvironmentApplication Environment PSB sheduled byPSB sheduled by
DLI RegionDLI Region Parameter in JCLParameter in JCL
MPPMPP IMS/TMIMS/TM
BMPBMP Parameter in JCLParameter in JCL
CICSCICS CICS ApplicationCICS Application
18
DB2 Stored ProcedureDB2 Stored Procedure DB2 SP applicationDB2 SP application
DB2 SP with ODBA : coding
11
22
19
33
Beware !!!
•• Can have mutilple TCB’s in 1 DB2 SP WLM regionCan have mutilple TCB’s in 1 DB2 SP WLM region
•• Same program can run in parallel in 1 ASSame program can run in parallel in 1 AS
•• No storage isolationNo storage isolation
•• DLI return code and reason codeDLI return code and reason code
�� Decimal in AIBDecimal in AIB
�� Hex in Messages & CodesHex in Messages & Codes
20
�� Hex in Messages & CodesHex in Messages & Codes
Access IMS/DB via ODBA
DB2 SP access to IMS/DB via ODBADB2 SP
AERTDLI
ame
ode
WLM
DB2
SP
1
2
3
1
2
3 ODBA
APSB (Allocate the PSB)
AERTDLI calls using AIB interface
DPSB (Deallocate the PSB)
Multiple TCB’s in one SPAS
21
Existing Mainfra
Application Co
IMS IMS
JCL
MPP /
BMP
1
2
33
2
1
IMS DB
DFSLI000
D/I calls CBLTDLI
Setup checklist
Infrastructure setup
Set RRS=Y in IMS startup parameter list DFSPBiii X
STOP / START IMS System to activate RRS support X
Define application environment in WLM
Create the WLM Stored Procedure JCL procedure
Create the DRA startup table source DRAimid X
Ass. & Link the DRA startup table into IMS.SDFSRESLB X
22
Define IMS Application
Define new PSB in the IMS sysgen input X
Create the new PSB source X
Perform PSBGEN X
Perform ACBGEN X
Perform IMS sysgen X
Perform Online Copy utility X
Perform MODIFY PREPARE/COMMIT X
DB2 Application Definitions
Setup DB2 Stored Procedure
Create the DB2 Stored Procedure from the DDL
Write the DB2 SP Cobol program using AIB interface X
Compile and link the DB2 SP Cobol program
Bind the SP package
Refresh the WLM application environment
23
Useful Commands
•• zOS CommandszOS Commands
�� V WLM,APPLENV=db2wlm,RESUMEV WLM,APPLENV=db2wlm,RESUME
�� V WLM,APPLENV=db2wlm,QUIESCEV WLM,APPLENV=db2wlm,QUIESCE
�� V WLM,APPLENV=db2wlm,REFRESH V WLM,APPLENV=db2wlm,REFRESH (can also be done with a DB2 SP : (can also be done with a DB2 SP :
WLM_REFRESH)WLM_REFRESH)
�� D WLM,APPLENV=db2wlmD WLM,APPLENV=db2wlm
•• DB2 CommandsDB2 Commands
24
•• DB2 CommandsDB2 Commands
�� --DIS DDFDIS DDF
�� --DIS PROCEDURE (procname) DIS PROCEDURE (procname)
�� --START PROCEDURE (procname)START PROCEDURE (procname)
�� --STOP PROCEDURE (procname) STOP PROCEDURE (procname)
•• IMS CommandsIMS Commands
�� /DIS CCTL/DIS CCTL
�� /STO THREAD reg#/STO THREAD reg#
CMD sample output
/DIS CCTL/DIS CCTL/DIS CCTL/DIS CCTL
D WLM,APPLENV=TDB2ODBAD WLM,APPLENV=TDB2ODBAD WLM,APPLENV=TDB2ODBAD WLM,APPLENV=TDB2ODBA
IWM029I 10.43.55 WLM DISPLAY 580 IWM029I 10.43.55 WLM DISPLAY 580 IWM029I 10.43.55 WLM DISPLAY 580 IWM029I 10.43.55 WLM DISPLAY 580
APPLICATION ENVIRONMENT NAME STATE STATE DATA APPLICATION ENVIRONMENT NAME STATE STATE DATA APPLICATION ENVIRONMENT NAME STATE STATE DATA APPLICATION ENVIRONMENT NAME STATE STATE DATA
TDB2ODBA AVAILABLE TDB2ODBA AVAILABLE TDB2ODBA AVAILABLE TDB2ODBA AVAILABLE
ATTRIBUTES: PROC=TDB2ODBA SUBSYSTEM TYPE: DB2 ATTRIBUTES: PROC=TDB2ODBA SUBSYSTEM TYPE: DB2 ATTRIBUTES: PROC=TDB2ODBA SUBSYSTEM TYPE: DB2 ATTRIBUTES: PROC=TDB2ODBA SUBSYSTEM TYPE: DB2
25
/DIS CCTL/DIS CCTL/DIS CCTL/DIS CCTL
V72 CCTL STATUS V72 CCTL STATUS V72 CCTL STATUS V72 CCTL STATUS
V12 ODBA011F ATTACHEDV12 ODBA011F ATTACHEDV12 ODBA011F ATTACHEDV12 ODBA011F ATTACHED
X99 *08311/102301* X99 *08311/102301* X99 *08311/102301* X99 *08311/102301*
011F is the address
space id in hex
Where to find information
Redbooks :Redbooks :
26
IMS Product Documentation :IMS Product Documentation :
IMS Installation Volume 2: System Definition and Tailoring ;
•Chapter 8. Accessing IMS Databases through the ODBA Interface.
Issue with ODBA in DB2 SP
.Net ApplIMS
DB2
• EXEC SQL
• AIBTDLI (read)
.Net ApplIMS
DB2
• EXEC SQL
•CALL pgm
Access Module
• AIBTDLI (read)
Business Module
• CALL pgmBusiness Module
• CALL pgm
27
DB2• CALL pgm
.Net ApplIMS
DB2
• EXEC SQL
• CALL pgm
• ROLLBACK
Access Module
• AIBTDLI (Update)
• DB2 ROLLBACK
Business Module
• CALL pgmBusiness Module
• CALL pgm
• IMS ROLB
Only DB2
updates are
rolled back
Connect Type 2
28
Connect Type 1
Connect to DB2
SQL : CALL SP
Client Application Mainframe z/OS Environment
Cobol external module
AERTDLI APSB
EXECSQL INSERT
AERTDLI ISRT
EXECSQL UPDATE
WLM Managed DB2 Stored Procedure Address Space
IMS IMS
DB
Connect Type 1
Syncpoint : one-phase
29
SQL : ROLLBACK
SQL : COMMIT
Disconnect from
DB2
RRS
AERTDLI UPDT
AERTDLI ROLB
AERTDLI DPSB PREP
EXECSQL ROLLBACK
DB2 DB2
DB
AERTDLI ROLB not
allowed in a DB2 SP
EXECSQL ROLLBACK
does only backout of
DB2 changes
EXECSQL ROLLBACK
SQLCODE = zero
Although IMS changes
were not backed out
ROLLBACK backs out
changes of IMS and DB2
COMMIT commits
changes of IMS and DB2
After a very ....
Reviewing this from the IMS and overall system perspective, I don't
agree at all with the DB2 contention that this is 'normal'.
What I suppose is happening is that if the DB2 Connect protocol is 2PC,
then they can unconditionally reject SQL ROLLBACK.
But if it is 1PC from DB2 Connect, it can still really be 2PC
in stored procedure, because of IMS ODBA call. As was mentioned on
p77 by Knut, it is the responsibility of the DB2 when processing
the ROLLBACK call to issue the appropriate RRS API calls to
determine how many RMs have interest in the . If the answer is > 1, then
DB2 needs to issue ATRBACK as part of the SQL ROLLBACK
processing.
This will cause RRS to force IMS to backout it's updates - will drive
IMS BACKOUT exit.
IMS has the analagous situation when it receives an unprotected
input transaction, say from a legacy SNA terminal. The application
runs and invokes another resource manager - usually via APPC
•• After ...After ...
•• 6 Months6 Months
•• 60 emails60 emails
•• Lot of BSTLot of BST
•• Problem will be solved in DB2 10Problem will be solved in DB2 10
�� Type 1 and Type 2 will both behave like Type 2Type 1 and Type 2 will both behave like Type 2
30
runs and invokes another resource manager - usually via APPC
protected conversation. Then the application issues IMS ROLB.
This is equivalent of SQL ROLLBACK. IMS will find out as part of
the ROLB backout processing that another RM has interest in the
, by making an RRS ATRREIC call, and then will issue ATRBACK.
This will cause the other RM to backout as well.
I think DB2 needs to look at this, maybe with some RRS traces,
and determine EXACTLY what they are doing during ROLLBACK
execution. It does not appear correct to me.
Kevin Stewart IMS FP/TM L2
•• Problem recognized & Problem recognized & rere--created at IBMcreated at IBM
31
Common Service Layer
32
Common Service Layer
33
Enhanced Command Environment (ECE)
34
Documentation
IMS Manuals :
•Open Transaction Manager Access Guide and Reference
•Base Primitive Environment Guide and Reference
•Common Service Layer Guide and Reference
•IMS Connect Guide and Reference
35
CSL Definition
36
•• Activate OTMAActivate OTMA
�� Update IMS Update IMS StartupStartup parameters in parameters in DFSPBxxxDFSPBxxx proclibproclib membermember
•• Implement BPEImplement BPE
�� Update the z/OS PPTUpdate the z/OS PPT
�� Create BPE configuration member Create BPE configuration member xxxxxxxxxxxxxxxx in the IMS in the IMS proclibproclib
�� Update IMS Update IMS StartupStartup parameters in parameters in DFSPBxxxDFSPBxxx proclibproclib membermember
•• Implement CSLImplement CSL
�� Create SCI initialisation member Create SCI initialisation member CSLSINIxxCSLSINIxx in the IMS in the IMS proclibproclib
�� Create the SCI STC Create the SCI STC startupstartup JCL in a system JCL in a system proclibproclib
�� Create OM initialisation member Create OM initialisation member CSLOINIxxCSLOINIxx in the IMS in the IMS proclibproclib
Installation Overview
�� Create OM initialisation member Create OM initialisation member CSLOINIxxCSLOINIxx in the IMS in the IMS proclibproclib
�� Create the OM STC Create the OM STC startupstartup JCL in a system JCL in a system proclibproclib
•• Implement ICONImplement ICON
�� Update the z/OS PPTUpdate the z/OS PPT
�� Update TCP/IP profile to define listener portUpdate TCP/IP profile to define listener port
�� Create ICON initialisation member Create ICON initialisation member HWSCFxxxHWSCFxxx in the IMS in the IMS proclibproclib
�� Create the ICON STC Create the ICON STC startupstartup JCL in a system JCL in a system proclibproclib
•• Implement IMS Control CentreImplement IMS Control Centre
�� Install the DB2 Connect Client on your workstationInstall the DB2 Connect Client on your workstation
�� Configure an IMS session in the DB2 Control Configure an IMS session in the DB2 Control CenterCenter
IMS GSE MeetingVilvoorde 18/11/2010
37I aM Smart – I am using IMS
•• Activate the new IP port using an Activate the new IP port using an obeyfileobeyfile
�� Update TCPIP.TCPPARMS(member) Update TCPIP.TCPPARMS(member) –– add line ‘PORT 3250 TCP HWSIMS’add line ‘PORT 3250 TCP HWSIMS’
�� Execute Execute cmdcmd : : V TCPIP,TCPIP,OBEYFILE,TCPIP.TCPPARMS(member)V TCPIP,TCPIP,OBEYFILE,TCPIP.TCPPARMS(member)
•• Stop CSL address spaces :Stop CSL address spaces :
�� F IMSXSCI,SHUTDOWN CSLLCLF IMSXSCI,SHUTDOWN CSLLCL
�� OrOr
•• P IMSXOMP IMSXOM
•• P IMSWSCIP IMSWSCI
Some usefull info
•• P IMSWSCIP IMSWSCI
•• Stop IMS Connect :Stop IMS Connect :
�� Rxx,CLOSEHWSRxx,CLOSEHWS
•• Start / Stop tracing in IMS ConnectStart / Stop tracing in IMS Connect
�� Rxx,RECORDERRxx,RECORDER OPENOPEN
�� Rxx,RECORDERRxx,RECORDER CLOSECLOSE
(Print trace file (Print trace file HWSRCDR using IDCAMS )HWSRCDR using IDCAMS )
38
DB2 Control Center
39
DB2 Control Center
40
IMS SPOC
41
DB2 Stored Procedures : “A window into the Mainframe" 42