Using VB Script - IBM-CICS

VBScript (short form of Microsoft Visual Basic® Scripting Edition) is a scripting language and is based on Microsoft’s Visual Basic. It can be executed as a standalone application, or, as in our example, it can be embedded in a Web page.

Here we present two scripts, the first to invoke a check for a change of address and the second provides a report of all corporate clients who acknowledged receipt of the change of address notification.

1. VBScript Retrieve Address Query

The intention was to demonstrate how a simple Web page, (with embedded VBScript) could be used to implement our Query Change of Address Request.

We wanted to have a Web page with a command button that when clicked would check WMQ for a change of address notification. If one existed it would retrieve the data and then use the data to invoke the RetrieveAddress CICS Web service to retrieve the new address details.

In order to run the application we required the following:

  • IBM WebSphere MQ Client, which we downloaded from the following Web address:
  • An HTML file containing the required VBScript code. The contents of this file, RetAddr.html.
    When the HTML file was displayed in a Web browser it gave the panel shown in Figure.

VBScript embedded in an HTML page to invoke Web service

VBScript embedded in an HTML page to invoke Web service

2. VBScript code overview

When the Check button is clicked the cmdSubmit_OnClick subroutine is invoked. The first call made by this code is to the MQGet function, which makes the WMQ calls to check and retrieve any data from the relevant queue.

If data is returned from MQGet, the cmdSubmit_OnClick subroutine then uses this data to build a Web service request to query the new address details. The request is built based on the wsdl file generated from the DFHLS2WS invocation for the ITSORA03 source.

Having received the new address details from the CICS Web services call, the code parses it and displays the results in the corresponding fields on the Web page.

It should be noted that the VBScript code is not particularly robust and makes certain assumptions. We preferred taking this approach to writing a more robust version that would detract from the core aspects that we are trying to demonstrate.

3. VBScript Corporate Acknowledgement Query

This second VBScript runs in much the same was as the first. This time we call the Corporate Acknowledgements CICS Web service to retrieve the audit records of all the corporate clients who received the change of address notification and then retrieved the new address. Although this does not guarantee that the external client successfully updated their customer database, it is a close approximation.

Unlike the rest of the CICSWSAP application suite, the ITSOCA03 code is CICS/DB2 COBOL. This difference presents no difficulties either in Web service generation or invocation. In keeping with the Web service philosophy, the client side has no knowledge of the implementation details of the server side. So this makes no difference.

VBScript Corporate Acknowledgement Query

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status