Sample for CPG5
Click here for Technical Description

What do you have to do to display a CICS file in a browser?
Example_1

Program Description:

The language of CPG5 is QPG, a just-in-time compiler.
In the OPTIONS statement you see two options:
  • HTML for an application running in a net via browser.
  • DAT for dataset, that means file processing.
The File statement defines the file CPGKDN. All parameters are token from the CPG .. Data Dictionary.
The Input Division describes the input of data. With the statement FILE CPGKDN DD DEF, the fields described in the Data Dictionary are imported into the program. The optional parameter DEF defines all fields of the structure CPGKDN for the program (in this sample: CUNO, NAME, CITY, ZIP).
The Procedure Division contains the operations. The first statement is a sequential READ (NEXT) starting with the content of the field CUNO. The second is the output of a browser map designed with NetPage under the name of SAMPLE1.

How does it work:

The first 'Map' designed with NetPage is called from your browser. In that map, you start the CICS task for example by button click. The program started by click automatically imports the data from the calling browser map (driven by field name) and exports it to the map specified in the HTMLO statement.
That's all.


The HTML-Map, from which the QPG program is started, could look like this:

It contains an input field (%CUNO) into which the key for the sequential read has to be entered. A button (%DISPLAY) is used to start a QPG-program (see description below).

Example_2

The following map SAMPLE1 is designed to output the result of the processing.

The field names must be the same as the field names used in the program.

The fields CUNO, NAME, CITY, ZIP are output fields, LOGO is a variable of the type 'Picture'.
Example_3

After the design, all variables have to be described. There are much more types than in a 3270-environment: Output field, Input/Output field, Button, Hyperlink, Listbox and much more.

The first variable CUNO is described as an output field.

Example_4


A button needs different entries:
Example_5

The execution will run on your S/390 system, but you will start it and get
your results in a browser:
Example_6

Example_7








Last updated: 10/04/2007