Browse Prior Art Database

Automatic CICS* COMMAREA data conversion and serialization using language-specific metadata

IP.com Disclosure Number: IPCOM000189305D
Original Publication Date: 2009-Nov-04
Included in the Prior Art Database: 2009-Nov-04
Document File: 4 page(s) / 80K

Publishing Venue

IBM

Abstract

IBM* CICS* programs can be passed data in a COMMAREA, a 32KB block of data, the structure of which is defined by the program. Calling applications must serialize their data into specific offsets in the COMMAREA using specific data formats that the CICS program expects. Increased complexity in the structure of the COMMAREA data requires increased complexity in the application logic for data conversion and serialization. Tools exist to generate the necessary code, but there are drawbacks to using code generation tools, such as the need to rerun the tool when the formats change. This article presents an alternative approach to data conversion and serialization for calling CICS programs, utilizing the metadata facilities provided by languages such as Java** , in the form of Java annotations, and .NET, in the form of .NET attributes.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 34% of the total text.

Page 1 of 4

Automatic CICS* COMMAREA data conversion and serialization using language-specific metadata

Disclosed is a technique for specifying how data should be converted and serialized when calling CICS* programs without requiring external tools or a detailed knowledge of the data representation used by the programming language that the CICS program was written in (such as COBOL or C). This is achieved by creating a set of metadata attributes or annotations which an application developer can use to decorate their code to describe how objects and variables should be serialized. Introduction

    CICS programs can be passed data in a COMMAREA, a 32KB block of data, the structure of which is defined by the program. Calling applications must serialize their data into specific offsets in the COMMAREA using specific data formats that the CICS program expects. Increased complexity in the structure of the COMMAREA data requires increased complexity in the application logic for data conversion and serialization. Tools exist to generate the necessary code, but there are drawbacks to using code generation tools, such as the need to rerun the tool when the formats change.

    This article presents an alternative approach to data conversion and serialization for calling CICS programs, utilizing the metadata facilities provided by languages such as Java**, in the form of Java annotations, and .NET, in the form of .NET attributes.

Overview of metadata in Java and .NET

    Both Java and .NET allows different entities, such as types, methods, and variables, to be decorated with metadata annotations and attributes. This metadata is attached to the entity at compile time and is available for discovery and inspection at run time. This allows compilers, runtime environments, and APIs to behave differently according to the information described in the metadata.

    In .NET, the Marshal class allows member variables to be decorated with a [MarshalAs] attribute. At run time, the Marshal class inspects this metadata and uses it to infer how best to marshal the variable when calling native code. The developer does not have to write any code for marshalling the data.

    In Java, the JUnit framework allows methods to be decorated with an @Test attribute. At run time, the framework identifies methods annotated with @Test as being those that should be executed in the test run. The developer does not have to write any code to call the annotated methods directly or handle specific outcomes.

    The remainder of the article refers only to .NET for brevity, but all of the techniques described can be applied in Java as well.

Calling CICS programs using the CICS Transaction Gateway

    The CICS Transaction Gateway (CICS TG) provides a .NET API which can be used to call programs in CICS. The application creates a connection to the CICS TG and then creates an ECIRequest object containing the details of the CICS server to connect to, the name of the CICS program to...