Your SlideShare is downloading. ×
Calling out from IMS Applications: Methods and Best Practices - IMS UG July 2013 NYC
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Calling out from IMS Applications: Methods and Best Practices - IMS UG July 2013 NYC

783
views

Published on

Jack Yuan's presentation on IMS Callout - Methods and Best Practices - from the IMS RUG in NYC, July 18, 2013

Jack Yuan's presentation on IMS Callout - Methods and Best Practices - from the IMS RUG in NYC, July 18, 2013

Published in: Technology, Education

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
783
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
28
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. © 2013 IBM Corporation ® IMS Calling out from IMS applications: methods and best practices IMS User Group Meeting With THANKS to Dave Cameron, Ben Johnson, July 18, 2013 – New York City Steve Nathan, Ken Blackman, Himakar Chennapragada Jack Yuan – jackyuan@us.ibm.com
  • 2. IMS 2 When IMS was created in 1968…..
  • 3. IMS 3 Today, IMS is everywhere...
  • 4. IMS 4 Customers running IMS have a variety of computer hardware and network configurations installed, typically employing IMS as a repository for information. Some customers also use IMS as one of their application platforms in Enterprise resource planning (ERP) systems that integrate internal and external management information. Why call out?
  • 5. IMS 5 Topics Overview of 7 IMS callout methods Deep-dive of the DL/I ICAL call for callout and program switch Best practices Case study Summary
  • 6. © 2013 IBM Corporation ® IMS Overview of 7 IMS callout methods
  • 7. IMS 7 IMSA-PGMA GU IOPCB ISRT ALTPCB IMSA/IMSB(MSC) PGM-B #1 IMS-Managed ALTPCB Callout (program to program switch) GU IOPCB ISRT IOPCB CLIENT UOW1 UOW2
  • 8. IMS 8 IMSA-PGMA GU IOPCB ISRT ALTPCB CPI-C TP-A CMRCV CMSEND CMDEAL APPC/IMS CMALLC Allocate TP-A Type=NONE/CONFIRM CMSEND SEND_DATA CMDEAL DeAllocate ConversationA CLIENT ISRT IOPCB UOW1 IMS LU6.2 Descriptor UOW2 CPI-C/APPC Synchronous CMALLC Allocate TP-B Type=NONE/CONFIRM/SYNCPT CMSEND SEND_DATA CMRCV RECEIVE_and_WAIT CMDEAL DeAllocate ConversationB UOW1 CPI-C TP-B CMRCV CMSEND CMDEAL #2 Callout using APPC APPC Asynchronous
  • 9. IMS 9 IMSA-PGMA GU IOPCB MQCONN MQ-B MQPUT NO-SYNCPOINT MQGET NO-SYNCPOINT MQDISC MB MQGET MQPUT MQDISC Queue messages #3 Callout with WebSphere MQ API CLIENT ISRT IOPCB IMS Managed UOW1
  • 10. IMS 10 Service IMSA-PGMA GU IOPCB EXEC SQL: CALL PROC ( :aaa : bbb … DB2 stored procedure User-defined function (UDF) data #4 DB2 Stored Procedure via ESAF CLIENT ISRT IOPCB IMS Managed UOW1
  • 11. IMS 11 READ_DATA WRITE_DATA CLOSE Socket Connect - TCP/IP-B WRITE_DATA READ_DATA CLOSE TCP/IP-B READ_DATA Socket Connect -TCP/IP-C Connection datagrams #5 User-Written TCP/IP Synchronous callout CLIENT IMSA-PGMA GU IOPCB ISRT IOPCB UOW1 UOW2
  • 12. IMS 12 IMS-Appl GU IOPCB ISRT ALTPCB OTMA Descriptor TMEMBER TPIPE IMS Connect Socket Message #6 Asynchronous callout via OTMA TCP/IP-B Resume_TPIPE READ_DATA ACK CLIENT ISRT IOPCB UOW1 UOW2
  • 13. IMS 13 IMS-Appl GU IOPCB ICAL OTMA Descriptor TMEMBER TPIPE IMS Connect Socket Message #7 Synchronous callout using DL/I ICAL TCP/IP-B Resume_TPIPE READ_DATA(COR_ID) ACK SEND_DATA(COR_ID) CLIENT ISRT IOPCB UOW1 UOW2 SEND_DATA RECEIVE_DATA
  • 14. © 2013 IBM Corporation ® IMS Synchronous callout using DL/I ICAL Deep-dive
  • 15. IMS 15 DL/I ICAL call provides the capability to callout to resources outside IMS synchronously IMS SOAP GATEWAY z/OS IMS Database DB Services OTMA TM/CTL Services IMS Connect TCP/IP user-written Client WebSphere IMS TM resource adapter Application Program ICAL MPP/JMP/IFP/BMP/JBP OTMA Descriptor OTMA Descriptor
  • 16. IMS 16 Overview - IMS Synchronous Callout using DL/I ICAL It is a SYNCHRONOUS call in your IMS application. – Need to change your existing IMS application or create a new IMS application Does not go through IMS Message Queue, and the synchronous callout message/response are not recovered. Does not support 2 phase commit support using RRS Callout message needs to go through IMS Connect – It does not go through MQSeries support IMS listener in WAS or distributed application
  • 17. IMS 17 Overview - IMS Synchronous Callout using DL/I ICAL… Supports messages larger than 32K without segmentation – No need to build data in LLZZ format Timeout support to optionally terminate callout request and free the dependent region IMS commands enhanced to view synchronous callout status and stop the callout processing Limited security credentials propagated by IMS to external server If a shared queues back-end IMS does not have an IMS Connect connection, the back-end IMS cannot process DL/I ICAL for callout Leverage asynchronous flow, although appears synchronous to IMS application – Based on OTMA Resume TPIPE/Send Only protocol function for retrieving synchronous callout requests and sending responses.
  • 18. IMS 18 Steps to have a synchronous callout application using ICAL STEP 1: STEP 2: STEP 3: STEP 4: Determine the external application (WebSphere TMRA, TCP/IP roll-your-own application, TCP/IP application using IMS Connect API, or IMS Soap Gateway application) Setup IMS (OTMA destination descriptor) Setup IMS application (COBOL, PL/I, REXX, C, JAVA…..) Setup the external application or server for callout messages
  • 19. IMS 19 Determine the external application Database Management A light-weight Web Service solution for IMS without the need of a Java EE server Java EE apps (MDB or EJB) running in WebSphere Application Server (WAS) using IMS TM Resource Adapter (IMS TM RA) Transaction ManagementWebSphere MDB/EJB appl. TCP/IP application connects to IMS Connect Need to understand IMS Connect and OTMA protocols SOAP Gateway Appl. SystemRoll-your-own Appl. Supports the high performance IMS Callout solution, and DataPower’s hardware acceleration for XML processing. Roll-your-own w/ DataPower A simplified callable interface for interaction with IMS Connect Addresses the complexities of writing RYO applications Roll-your-own w/ ICON API
  • 20. IMS 20 Setting up OTMA destination descriptor in IMS PROCLIB D destname keywords Where: destname is destination names and can be masked by ending in an * keywords are: TYPE=IMSCON TMEMBER=name TPIPE-name SMEM=YES|NO ADAPTER=adapname CONVERTR=convname SYNTIMER=timeout (If both ICAL & Descriptor specify timeout, the lower value is used) D OTMDEST1 TYPE=IMSCON TMEMBER=HWS1 TPIPE=TPIPE1 SYNTIMER=500 The OTMA Destination Routing Descriptors were introduced in IMS 10. They externalize the routing definitions and specifications for callout messages without IMS user exits. Descriptors are read and initialized at IMS startup. – Use ‘D’ descriptor type in DFSYDTx member of IMS.PROCLIB. For example: D SOAPGW1 TYPE=IMSCON TMEMBER=HWS1 TPIPE=HWS2SOAP D SOAPGW1 ADAPTER=XMLADPTR CONVERTR=XMLCNVTR SYNTIMER=200 D SANDY01 TYPE=IMSCON TMEMBER=HWS2 TPIPE=TPIPE2
  • 21. IMS 21 IMS type-2 commands for OTMA destination routing descriptors Type-2 commands can also be used to update, create, delete, or query the descriptor entries – CREATE OTMADESC – UPDATE OTMADESC – QUERY OTMADESC – DELETE OTMADESC For example: UPDATE OTMADESC NAME(OTMDEST1) SET(SYNTIMER(800)) QRY OTMADESC NAME(OTMDEST1) SHOW(ALL)
  • 22. IMS 22 Prepare your IMS application for the DL/I ICAL >>-ICAL--aib---request_area---response_area----------------->< The format of the ICAL call for a synchronous callout request:
  • 23. IMS 23 COBOL Application with ICAL Descriptor name Timeout Request Area Length Response Area Length Output return codes ICAL AIB IOAreas
  • 24. IMS 24 BMP with DDLT0 tool 25-32 a destination name in OTMA destination descriptor name, 8–byte character field (ICAL). Our example is JOHNSON1 34-39 The wait time for the synchronous call to be processed, 6–byte character field with a range from 1 to 999999 (ICAL), our example is 100 seconds 41-45 The input message length nnnnn The length of the input data in the request area (ICAL). Our example is 50 bytes 47-51 The response area length nnnnn The length of the response area for the output message (ICAL). Our example is 1000 bytes //JACK EXEC DDLT0,PSBNAME=PSAPP99,TYPE=BMP,IMSID=TEST, // QUAL=IMSTSYS,NBA=50 //SYSIN DD * S1111 1 1 1 1IOPCB AIB L ICAL SENDRECV JOHNSON1 010000 00050 01000 L DATA HELLO FROM IMS E OK -------------------------------------------------------------------------------- SEGMENT =(HELLO FROM IMS ) ................................................................................ CALL=ICAL SEGMENT =(HELLO FROM WS ) COMP RET CODE=OK IOPCB LTERM= RET CODE= RACFUSER=PSAPP99 . 0003 0003 0000 AIB BLOCK AIBOALEN = 0002, AIBOAUSE = 0006, RETURN CODE = 0000, REASON
  • 25. IMS 25
  • 26. IMS 26 WebSphere and IMS TM Resource Adapter WAS/WPS/WTX/WMB/WESB IMS TM resource adapter Web Service TCP/IP Web Component Enterprise Bean IMS Connect IMS DB * IMS IMS App Enable an IMS transaction as Web Service with full SOA support – Integrate with a variety of Java EE or WebSphere-based servers with built-in QoS support (2PC, connection pooling, security management) – Java EE Connector Architecture (JCA/J2C) compliant – Recommended when Java EE server (e.g. WAS) is already in-use – Supports rapid application development with Rational tooling Rational Application Developer (RAD) or WebSphere Integration Developer (WID) IMS app Source (COBOL, PLI, C, MFS) Generates * Binary, text or XML data
  • 27. IMS 27
  • 28. IMS 28 Synchronous Callout Flow IMS IMS App1 z/OS z/OS, zLinux, Win, AIX etc.. DL/I ICAL Descriptor name Timeout IMS Enterprise Suite SOAP Gateway Server IMS Connect Receive Callout Request in XML Send Callout Response in XML Web Service A XML Adapter Msg1 Msg2 TPIPE Send ACK XML Converter 1 2 3 5 6 7 Development & Runtime Environment 4 ExecutionExecution GenerationGeneration RD/z Meet-In-The-Middle Wizard Existing WSDL Correlator File RD/z Generate Task Existing COBOL Copybook Development environment Error Handling: If Web Services returns a Web Service Fault error, SOAP Gateway sends an error response with the Fault message to the DLI call
  • 29. IMS 29
  • 30. IMS 3030 IMS Synchronous Callout Overview for RYO client RYO Application ACK Response 1 3 4 IMS Connect z/OS IMS IMS Application 2 Initiating Client Resume TPIPE TPIPE1 ICAL SENDRECV OTMDEST1 HELLO FROM IMSHELLO FROM IMS Request TPIPE TPIPE1 HELLO FROM RYO HELLO FROM RYO OTMDEST1 TPIPE1 HWS1 HWS1 OTMA Descriptor
  • 31. IMS 31 Callout with RYO - Programming 1. Issue Resume TPIPE request – CM0, Synclevel Confirm, RT Auto/Single, timeout – Resume TPIPE on client ID or alternate client ID 2. Receive the callout request and correlation token 3. Send an ACK to acknowledge the callout request – Alternately, you may send a NAK to stop the callout request 4. Send an response back to IMS with correlation token – Commit Mode 0, Send-Only – Alternately, an error response maybe sent in case of error situation
  • 32. IMS 32
  • 33. IMS 33 IMS Connect API - Overview IMS Connect API Client Application IMS Connect API Client Application IMS Connect API Client Application IMS Connect Windows or z/OS O T M A IMS App IMS App IMS App z/OS Connection And TMInteraction property files
  • 34. IMS 34 IMS Connect API Provides simplified API to build roll-your-own IMS Connect client application to invoke IMS transactions from Java and C environments Shields users from IMS Connect protocol (IRM, CSM, RSM, etc.) and low-level socket communications Recommend to use in RYO client application that does not run in an application server Value – Extends the value of IMS resources by allowing easy access from new Java or C-based applications – Simplifies migration of existing applications from SNA to TCP/IP – Simplifies development of new applications to access IMS transactions
  • 35. IMS 35
  • 36. IMS 36 Inbound / Outbound DataPower flow for IMS Callout Response DataPower XI52, XI50B, XB62 Multi-Protocol Gateway Transformation IMSCalloutFrontSideHandler Transformation Request Outbound Rule Inbound Rule IMS V12 IMS application .. ICAL (synchronous) IMS Connect TPIPE Services WS Proxy
  • 37. IMS 3737 Solution Highlights • The IMS callout connection is a DataPower “Front Side Handler” that can retrieve IMS callout messages and send response data. • The handler internally creates one or more IMS Connect dedicated persistent socket connections to the host system, using Enterprise Suite V2.2 IMS Connect API in Java. • The handler communicates with IMS Connect via a new DataPower dedicated user message exit, HWSDPWR1. • For shared queue environment, user can choose to create multiple IMS Callout connections, one for each IMS datastore. IBM Confidential
  • 38. © 2013 IBM Corporation ® IMS Synchronous program switch in IMS V13
  • 39. IMS 39 Synchronous Program Switch New capability that enhances the DL/I ICAL support – Allows an IMS application program to synchronously call and wait for a reply from another IMS application program • Within the calling program’s UOW Database IMS DB services IMS dependent region IMS TM services MPP, JMP IFP, BMP, JBP OTMA Application Program ICALIMS SOAP GATEWAY IMS Connect TCP/IP user-written Client WebSphere IMS TM resource adapter
  • 40. IMS 40 Synchronous Program Switch… Benefits – Modernization of the IMS application infrastructure • Provides an internal service flow of IMS transactions to complete a business process – In the same IMS or a different IMS – Implementation of a Process Server or Broker inside IMS • Reduces unnecessary network traffic when accessing multiple applications in the same IMS or IMSplex WAS Application WAS IMS Connect IMS MPPx MPP4 MPP2 MPP3 ICAL ICAL ICAL ICAL WAS Application WAS IMS Connect IMS MPP4 MPP2 MPP3 MPP1 MPP1
  • 41. © 2013 IBM Corporation ® IMS Calling out from IMS applications: Best Practices
  • 42. IMS 42 Choose the asynchronous callout method to avoid tying up IMS regions while the callout request is processed Sync Callout Response Callout Request Async Callout Response IMS Application 1 IMS Application 2 Async: ISRT ALTPCB Sync: ICAL
  • 43. IMS 43 Evaluate if the two-phase commit process is needed to ensure data consistency for your callout application z/OS Resource Manager IMS transaction Orchestration Business Logic X Getting Request Sending Answer IMS Business Logic Y DB2 z/OS Apps & Data
  • 44. IMS 44 Choose a synchronous callout method that is scalable and provides good performance for your installation Using APPC/CPI-C Using TCP/IP socket calls Using ESAF/MQSeries Using ESAF/DB2 Using ICAL DL/I call (This is the IMS strategic direction)
  • 45. IMS 45 Best practices for using ICAL DL/I call from IMS applications Design synchronous callout applications to minimize resource contention – After an IMS application issues an ICAL call for a synchronous callout, it waits in the IMS dependent region until either the response is received from the external application or the timeout interval expires. While waiting, all of the resources that the application program has accumulated during the current unit of work are held. – To avoid excessive resource contention, have the application program issue the ICAL DL/I call as early as possible, before too many resources are obtained.
  • 46. IMS 46 Best practices for using ICAL DL/I call from IMS applications… Define an appropriate number of IMS dependent regions – When many IMS applications use synchronous callout, especially with slow external service providers, it may become necessary to increase the number of IMS dependent regions. This comes with the concerns of more resources and greater chances for resource contention. Define appropriate timeout values on the ICAL call – The synchronous callout request also allows for setting a timeout value so if the callout response is delayed the IMS application will receive return and reason codes indicating the timeout and the application can decide whether to proceed without the callout information or to retry the callout request. The timeout value must be balanced between allowing sufficient time for the callout request to be processed and protecting the IMS dependent region from being held up.
  • 47. IMS 47 Best practices for using ICAL DL/I call from IMS applications… Manage high volume and multiple destinations with OTMA destination descriptors – If high volumes of callout requests are anticipated then the service provider should make retrieval requests to different destinations and separate descriptors can be used to route callout requests to these separate destinations. This can improve throughput, but might add complexity to the IMS applications.
  • 48. © 2013 IBM Corporation ® IMS Case Study
  • 49. © 2013 IBM Corporation ® IMS Summary
  • 50. IMS 50 Function Method Asynchronous Communication Synchronous Communication Coordinated Commit and rollback IMS program switch APPC/ CPI-C z/OS TCP/IP stack ESAF to MQ ESAF to DB2 for z/OS ALTPCB OTMA ICAL call Table 1. Key functionalities supported by each callout method
  • 51. IMS 51 Table 2. By looking at some of the supported service providers and environments Target Method IMS Appl. APPC/ CPI-C Appl. DB2 for z/OS Appl. MQ Series Appl. Webspher e Appl. with TMRA TCP/IP Appl. SOAP Appl. with Soap Gateway Datapowe r Appl. IMS program switch APPC/ CPI-C z/OS TCP/IP stack ESAF to MQ ESAF to DB2 for z/OS ALTPCB OTMA ICAL call * The IMS application calls the service provider indirectly.
  • 52. IMS 52 Summary of callout highlights 1. When choosing a synchronous or asynchronous callout method, consider your needs for scalability and performance. 2. The ICAL DL/I call has been available for synchronous callout since IMS Version 10. 3. All messages that use the ICAL callout method go through IMS Connect. 4. IMS Version 13 expands the ICAL DL/I call to support synchronous program switch function to “call out” to other IMS application program.