Sample Programs

A number of sample programs and source code comes with the Topaz for Total Test and are installed as part of the Compuware Enterprise Common Components (ECC) installation. The default source library is hlq.SLCXCNTL and the default load library is hlq.SLCXLOAD. It can be beneficial to define a System called Total Test samples with these values, and then add each sample program to the repository by referencing the system. Sample programs using Db2 will not work out of the box.

Available Sample Programs

Program

Description

XAPGMTST

Uses a complex input/output data structure with most types. Echoes input data and generates current time and date in the output.

Simple COBOL program that takes input parameters and returns them. It generates a time, date and some hardcoded fields. The primary use of the program is to show a complex data structure with most of the field types supported by Non-virtualized Test.

The structure includes a pointer. The pointer points to data structure also defined in the linkage section. This structure is not part of the call area, and it is setup when adding the component to the repository after having extracted the data definitions from the web page. In Figure XAPGMTST Data Structure you can see that the pointer field areapointer uses the area areaforpointer, and that this area is not included (see the Include column) in the call area.

XADB2TST

Db2 CRUD program that operates on an employee table. Primary use of the program is to test and use Db2 in a program. The data structure is illustrated in Figure XADB2TST Data Structure. The field xadb2tst-imp-function is used to tell the module what operation to perform (CREATE, GET, UPDATE, DELETE, LIST). Execute the program with LIST in this field and it will return the first 7 employees in the export area. Execute the program with GET in the function field and an ID (rident) if the employee in the rident field and the program will return the employee in the first xadb2t-exp-table.

XAMOCTST

Wrapper program that has the same data structure as XADB2TST and calls XADB2TST as a sub module. Primary use of this program is to test and use sub module virtualization and the Stub feature.

XAPGMCAL

Program that takes a timestamp as input and returns calculated minutes and seconds until midnight. This program can be used with XAPGMTST in a sequence in a test scenario. XAPGMTST generates and returns a timestamp that can then be used as input for XAPGMCAL, that will return minutes and seconds until midnight.

XDPGMBT1

Main batch program that uses JCL to setup input and output dataset and does not have a linkage section. The program reads from an input file with a number of car manufactures, looks up data in Db2 and writes the rows to an output dataset. The program can be used to test features related to main batch program testing. See sample JCl and input and files at this link.

XARISCAL

Simple program used for demonstration purposes and showing the code coverage feature. It takes an input parameter age and calculates and returns a risk number based on the age.

XARISCA2

Calls XARISCAL 1-5 times with different ages. Used for illustrating sub module virtualization and sub module recording.

XARISCA3

Calls XARISCAL and uses a condition to either approve or reject thr customer request. Used for demonstrating sub module virtualization.

XADPTRS1

Pointer example with both Non-virtualized Test and program assigned memory.

XADENCOD

Program that takes parameters in UTF16 and ENCDIC format.

XADRETRN

Program that has a Returning parameter and several Redefines. Used to demonstrate Returning and how to use Non-virtualized Test with Redefines.

XADCICC0

CICS program using commarea. Receives a program name in DfhProgram and returns miscellaneous information about the program.

XADCICC1

CICS program using commarea. Can get information about a program on CICS. By default it returns information about itself.

XADCICC2

CICS program using ts storage queue. Does the same as XADCICC1.

XADCICC3

CICS program using ts storage queue and containers. Does the same as XADCICC1.

XADCICC4

Component registered as CICS transaction that will execute XARISCAL through a transaction.

XADCICC5

CICS program that calls XARISCAL by using TWA memory.

XADALTM1

Sample test batch main program for testing sub modules or entries in statically linked load modules. XADALTM1 has two entries: XADALTE1 and XADALTE2. XADALTM1 has two static linked sub programs, XADALTS1 and XADALTS2.1  

XADALTS1

Sample test batch sub program for testing sub modules or entries in statically linked load modules. XADALTS1 has two entries: XADAL1E1 and XADAL1E2. XADALTS1 does not exist as a stand-alone program, but is statically linked in load module XADALTM1. When testing this sub module or entries, make sure the Optional main module in the Component Definition is set to XADALTM1.1 

XADALTS2

Sample test batch sub program for testing sub modules or entries in statically linked load modules. XADALTS2 has two entries: XADAL2E1 and XADAL2E2. XADALTS2 does not exist as a stand-alone program, but is statically linked in load module XADALTM1. When testing this sub module or entries, make sure the Optional main module in the Component Definition is set to XADALTM1.1 

 

1. The return value is an 8 character field containing the name of the program name or entry point where execution was started.
 
 

XAPGMTST Data Structure

inset_0.jpg

 

 

XADB2TST Data Structure

inset_4.jpg

 

Program XAPGMBT1 Example JCL and Files

Example JCL that can be used when defining the component:

//XAINPFIL DD DSN=XATESTER.UDV.XAPGMBT1.XAINPFIL,DISP=SHR
//XAOUTFIL DD DSN=XATESTER.UDV.XAPGMBT1.XAOUTFIL,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,SPACE=(TRK,(15,5)),
//            DCB=(LRECL=132,RECFM=FB,BLKSIZE=27984)
//XAERRFIL DD DSN=XATESTER.UDV.XAPGMBT1.XAERFIL2,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,SPACE=(TRK,(5,1),RLSE),
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=32720,DSORG=PS)

The input file looks like this:

inset_1.jpg

It will produce an output file that looks like this:

inset_5.jpg