How to call COBOL on IBM i (AS/400) from Integration Server
Tags: webmethods, integration, entirex, cobol
Published: 2019-09-18 11:55:59

---
title: How to call COBOL on IBM i (AS/400) from Integration Server
published: true
tags: #webmethods, #integration, #entirex, #cobol
canonical_url: http://techcommunity.softwareag.com/techniques-blog/-/blogs/how-to-call-cobol-on-ibm-i-as-400-from-integration-server
---

# webMethods EntireX

**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 | [<font color="#000000"><img alt="" id="yui_patched_v3_11_0_1_1435667347988_855" src="http://techcommunity.softwareag.com/image/image_gallery?uuid=202eb7e1-9148-4c65-b29a-54c4302ab65e&amp;groupId=10157&amp;t=1326987658425" style="width: 22px; height: 22px; vertical-align: text-bottom;"> <span id="yui_patched_v3_11_0_1_1492771711676_1198">Download PDF</span> </font>](http://bit.ly/2L8O13F) |
|-|-|-|
## Scenario

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).

## Hands-on example

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

![](http://techcommunity.softwareag.com/documents/10157/9808473/entirex1.jpg/0694b1dc-b4e9-48d8-9221-575e9ad904dc?t=1531388832880)  
**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

COBOL extraction is done as usual with EntireX. There are no AS/400 specifics to consider.

![](http://techcommunity.softwareag.com/documents/10157/9808473/entirex2.jpg/965c6649-2622-4460-93a0-074d5c6050ce?t=1531388836928)  
**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.

## Interface shaping

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

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..._

![](http://techcommunity.softwareag.com/documents/10157/9808473/entirex3.jpg/06345121-7a60-4825-93f2-f9dae0c3feaa?t=1531388841139)  
**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

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...

![](http://techcommunity.softwareag.com/documents/10157/9808473/entirex4.jpg/994ba425-d2c3-473a-a6a6-a3133b156828?t=1531388845528)  
**Fig 4:** Call the AS/400 COBOL Server from IS

## REST enablement

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.

![](http://techcommunity.softwareag.com/documents/10157/9808473/entirex5.jpg/b55131f8-3d85-48f8-a5c8-9fb0e8897738?t=1531388850178)  
**Fig 5:** Architecture diagram for accessing AS/400 server from environments other than webMethods IS

## Summary

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](https://documentation.softwareag.com/webmethods/wmsuites/wmsuite9-9/EntireX/9-9_EntireX/scenarios/overview.htm) from webMethods EntireX documentation.

## Related articles

“[How to shape a call to COBOL from webMethods Integration Server – the modern way](http://techcommunity.softwareag.com/techniques-blog/-/blogs/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](http://techcommunity.softwareag.com/techniques-blog/-/blogs/webmethods-entir-2),"  
TECHniques, April 2017 (Issue 2)  
“[How to call webMethods Integration Server from COBOL – mainframe outbound,](http://techcommunity.softwareag.com/techniques-blog/-/blogs/how-to-call-webmethods-integration-server-from-cobol-mainframe-outbound)" TECHniques, April 2016 (Issue 4)

| 
## Glossary of terms

**AS/400<sup>®</sup>**  – 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<sup>®</sup>**  – 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