|...we connect your IBM mainframe to the web!
Sample for CPG5
|Click here for Technical Description|
What do you have to do to display a CICS file in a browser?
The language of CPG5 is QPG, a just-in-time compiler.
In the OPTIONS statement you see two options:
The File statement defines the file CPGKDN. All parameters are token from the CPG .. Data Dictionary.
- HTML for an application running in a net via browser.
- DAT for dataset, that means file processing.
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.
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).
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'.
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.
A button needs different entries:
The execution will run on your S/390 system, but you will start it and get
your results in a browser:
Last updated: 10/04/2007