Calling COBOL from webMethods Integration Server is easy with EntireX. Read how EntireX helps you to connect them with quick results, even without specific COBOL knowledge.
By Juergen Lind, Director, Product Management, Adabas & Natural, and Bernhard Fricke, Sr. Lead Software Specialist, Software AG
|Issue 3, 2018||Download PDF|
You have been using AS/400 (System i®) machines to run your business-critical and mission-critical applications for years.
Nowadays, new markets need to be addressed. New applications, developed with new technologies, need to be able to use your existing COBOL applications running on AS/400, rather than having to reinvent them at high cost, after the huge investments poured into these core business applications over the years.
You need to connect a variety of COBOL applications to webMethods Integration Server (IS).
The COBOL server EMPLOYEE on AS/400 (Fig. 1) needs to be called from IS. With EntireX, you develop the scenario in three phases: 1 extract 2 generate 3 test
Fig 1: COBOL Server EMPLOYEE on AS/400 and COBOL Environment for IBM i (AS/400 Operating System)
Before you start the extraction, the following preparation is necessary:
- Create a project in Software AG Designer.
- In our example, the source of the COBOL server EMPLOYEE is a member of file QCBLLESRC in library EMPLAPPL of AS/400 (Fig. 1). Therefore, you download (e.g., with FTP) the COBOL Source from AS/400 into the Software AG Designer project.
- For extraction, define a COBOL Environment for IBM i (AS/400 Operating System): see Preferences Software AG > EntireX > COBOL > IDL Extractor for COBOL; Press button Insert and select IBM i as Operating System.
- Make sure you are in the EntireX perspective of the Software AG designer.
Extract the interface of the COBOL server subprogram 1
COBOL extraction is done as usual with EntireX. There are no AS/400 specifics to consider.
Fig 2: Extract AS/400 COBOL server EMPLOYEE
The full set of features for EntireX COBOL extractions is available, as it is for other COBOL environments (e.g., z/OS ®, z/VSE®, BS2000).
Fast path extraction
Use the fast path extraction if you require quick results, as described in article: “How to call COBOL from webMethods Integration Server” (see (2) under Related Articles). Fast path extraction automatically includes Map OCCURS DEPENDING ON; i.e., the COBOL term for a variable-sized table or IDL unbounded array, often abbreviated as ODO.
Use interface shaping to produce small and modernized IS services, rather than one big IS service. Without changing the COBOL server itself, interface shaping allows you to:
- Map to multiple IDL interfaces: Your COBOL server has multiple functions implemented which are controlled by an operation or function code parameter. With this feature you map every COBOL function to a separate, small and handy IS service. You can specify meaningful long IS service names instead of being restricted to the 10-character limitation on AS/400. Refer to the former TECHniques article: “How to shape a call to COBOL from webMethods Integration Server – the modern way” (see (1) under Related Articles) for more information.
- Map to in, out, inout: Defines the input/output signature of the IS service.
- Select REDEFINE paths: Either the parameter which is redefined or one of its redefinitions is available as an IS field.
- Suppress unneeded COBOL data items: The COBOL parameter does not exist in the IS service as an IS field.
- Set COBOL data items to constants: The COBOL parameter does not exist in the IS service as an IS field. The constant value is provided internally by EntireX runtime.
Usage of Suppress and Set Constant keeps focus on relevant data items and keeps the client’s interface clean. It may also improve performance.
Refer to EntireX documentation for more information:
Software AG IDL Extractor for COBOL > COBOL Mapping Editor > IDL Extraction per Interface Type > (Interface Type) Standard Linkage > Mapping Editor IDL Interface Mapping Functions.
Generate IS service and IS connections 2
You generate the Connection and Integration Server services in the usual way: Use the context menu of the Software AG IDL and invoke Integration Server > Generate webMethods IS Connection...
Fig 3: Generate IS Service and Connection
Of course, you have to select type AS/400 Connection (see Fig.3), then specify target package, folder, connection name and hostname.
Test IS service to COBOL server on AS/400 3
For testing, use the service development perspective, as you do for every other IS service test. On the context menu of the generated IS service, select Run As > Run Service...
Fig 4: Call the AS/400 COBOL Server from IS
With EntireX 10.3 (GA: 2018Oct) the IS service generation wizard will allow for generating REST resources on the IS at the same time. This will open all back-end services for further API management.
RPC Server for AS/400
For accessing AS/400 server from environments other than webMethods IS, use the RPC Server for AS/400. A typical architecture consists of RPC client, the EntireX Broker and RPC server for AS/400. The RPC Server for AS/400 acts on one side as an RPC server and on the other side as a client for calling AS/400 server programs.
Fig 5: Architecture diagram for accessing AS/400 server from environments other than webMethods IS
As demonstrated, it is quite easy to develop a scenario where IS calls COBOL on AS/400. You can rely on EntireX to do all of the work for you from the design phase through runtime. COBOL- specific data types are mapped automatically to suitable IS data types.
To learn more, read Common Integration Scenarios from webMethods EntireX documentation.
“How to shape a call to COBOL from webMethods Integration Server – the modern way" TECHniques, January 2018 (Issue 1)
“How to call COBOL from webMethods Integration Server,"
TECHniques, April 2017 (Issue 2)
“How to call webMethods Integration Server from COBOL – mainframe outbound," TECHniques, April 2016 (Issue 4)
Glossary of terms
AS/400® – midrange hardware; also known as iSeries, iSeries i5; System i
IDL – Interface Description Language
Interface Shaping – advanced extractions to shape a call to COBOL; also called User-defined mapping resulting in IDL and CVM (client-side server mapping) file
IS – webMethods Integration Server
OCCURS DEPENDING ON table – COBOL array of variable length
OS/400® – midrange operating system; also known as i5/OS, IBM i
REDEFINE – same memory area described by different data items
REST – REpresentational State Transfer: A paradigm that allows to describe structure and behavior of the World Wide Web