You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

In this section:

Introduction

Parasoft Copybook Builder provides a way for Parasoft SOAtest and Virtualize users to generate SOAtest messages and Virtualize responders based on COBOL copybooks. The output of the tool is a single jar file that can be imported into Parasoft products. The jar file contains:

  • An XML schema of each copybook.
  • Java classes to manipulate copybook data.
  • XML files to integrate copybooks as message types in Parasoft SOAtest and Virtualize.

This tool supports syntactically correct copybooks and includes:

  • Support for all COBOL numeric types including COMP-3 (Packed Decimal).
  • Support for multiple occurrences on elementary and group level fields (OCCURS statement).
  • Support for nested copy statements.

The tool does not support OCCURS DEPENDING ON statements or COPY REPLACING statements.

Requirements

  • Java 1.5 or higher installed.
  • Parasoft SOAtest and/or Virtualize installed.

Preparing Copybook Files

The Copybook tool searches for copybook files in a list of directories provided at runtime. Within each directory, the tool searches a list of filenames and wildcards for copybook files to process.

We recommend that your copybook files have an extension that distinguishes them from COBOL source code (.cpy vs. .cob) or that you store the copybook files in separate directories from any COBOL source code.

Copybook files from Z/OS systems are limited to eight characters, but the Copybook tool does not require this.

If a copybook file contains a COPY statement, the Copybook tool resolves the name by checking for an identical file with the same extension as one provided at run time.

For example, if the copybook contains a COPY ACCTDATA statement and the filename list was *.cpy,*cbl, the copybook tool will attempt to find  ACCTDATA.cpy or ACCTDATA.cbl in the list of directories provided at runtime.

Usage

SOAtest and Virtualize support various types of requests (SOAtest) and Responders (Virtualize). These types can include XML, JSON, CSV, plain text and fixed length. When the output of Parasoft Copybook Builder is integrated into these products a new Copybook Message type is created. Each copybook becomes a Message Format for the Copybook format request and responder. Perform the following steps to use the Copybook Message type:

Executing the Command

Run the com.parasoft.soavirt.messages.copybook-<version>.jar file using the following command to build read the copybook files and generate the JAR file that you will integrate into the UI:

java -jar [path_to_executable_jar]parasoft_copybook_builder.jar -copybookinput directory_list - filenames filename_list

The command uses the following arguments:

  • directory_list: A comma separated list of directories where the copybooks are located. Use quotes if the directory contains special characters.
  • filename_list: A comma separated list of copybook files (wildcards allowed).

Example

java -jar parasoft_copybook_builder.jar -copybookinput "C:\My Projects\proj_a\cobol_src","C:\My Projects\proj_a\cobol_src\copy books" -filenames *.cbl,*.cpy

The example searches the following folders:

  • C:\My Projects\prog_a\cobol_src
  • C:\My Projects\proj_a\cobol_src\copy books.

Any file that matches the wildcards *.cbl or *.cpy wil be processed as a copybook.

Copybook Builder doesn’t recurse sub-directories. Specify subdirectories as a separate entries in the copybookinput option. Also use quotation marks if the directories contain spaces or special characters.

When the Copybook tool finishes, there will be two files created in the directory: copybook.jar and velocity.log. Assuming there are no errors, velocity.log can be deleted. Integrate the copybook.jar file as described in Integrating the Copybook Tool into the UI.

Integrating the Copybook Tool into the UI

The Copybook tool is implemented in the SOAtest and Virtualize UI as a system JAR file, which is output by executing the JAR in Executing the Command.

  1. Choose Parasoft> Preferences.
  2. Choose System Properties and remove any existing copybook.jar entries. 
  3. Click Add JARs and browse to the copybook.jar file created after executing the JAR file in Executing the Command.
  4. Click Open and apply the changes
  5. Restart SOAtest/Virtualize.

Using a Copybook in a Responder

This example demonstrates how to create a Virtualize responder from a copybook.

  1. In the Virtualize perspective, choose Parasoft> Show View> Virtual Asset Explorer
  2. Right-click the VirtualAssets folder and choose Add New> Virtual Asset (.pva) File… 
  3. Enter a file name and click Next.
  4. Choose Empty and click Finish. A new .pva file is created in the VirtualAssets folder.
  5. Right-click the Responder Suite under the new .pva and choose Add New> Responder.
  6. Choose CopyBook Message Responder and click Finish.
  7. Open the Copybook Message Responder you just created. 
  8. All available copybooks are presented in the Message Type drop-down menu. Choose a copybook and the fields for the copybook will be displayed as responder fields.

You can repeat these steps to create a copybook request in your SOAtest environment. 

  • No labels