CPG2...the modern programming Language
is the modern actual programming generator, which supports the evolution in program developing platforms of the last 20 years. The structure of the written programs and the layout of user applications are state of the art using up to date technical capabilities.

CPG2             Pfeil

Tabelle CPG2

The main difference between CPG1 and CPG2 is the syntax of writing statements. While CPG1 uses the forms as RPGII, the format of CPG2 is a free format and not based on specific columns to write a program. See the example above.

Important notice: of course there is a co-existence of CPG1 and CPG2 formats. No code has to be changed when you start with CPG2 format!

CPG2 is a precompiler, generating a code that is transformed to CPG1 code, which is then  generated as S/390 assembler code.

The next advantage is the usage of  the data dictionary. Formerly programs did contain the problem code and the description of records - today the records are described in the central data dictionary.

3270 maps are designed externally from the program code. This is realized with QSF (Quick Screen Facility) where the maps are designed and executed when starting an application. 

Testing applications is done with the internal debugging feature QDF (Quick Debugging Facility). CPG programs can be tested on statement level.

QDD (Quick Data Dictionary).
The description of records and the single fields is maintained in the central data dictionary. The application program uses the structures by a specific reference name. So the application programmer can use the same structure in each application where he needs it. Besides this, all programs use the same field names for the program variables.


Each field is defined in the data dictionary. Fields are composed to record structures and the application program uses the name of the structure to include all fields.
QDF (Quick Debugging Facility)
QDF is the debugging tool in CPG2. Before starting a transaction or even when running, QDF allows to specify stop points. At this stop points the program is stopped, terminal data is saved, and actual program status information is displayed. This includes all fields defined in the program code. User fields may be shown and changed if necessary. Stop conditions can be changed while executing the program.


This part of a terminal display shows where a program should be stopped. Stop is requested for any READ operation, for statements 125-130, and also for statement number 177, 245, and 333.
The debug is only done if the calling program's name is TEST and the module is TEST1. Only on Terminal LU12 the debug mode is executed.
QSF (Quick Screen Facility)
In CPG1 terminals were handled as normal list files. The output section declares all literals and variables to be displayed on the screen. CPG2 uses the screen definition facility QSF, where maps are designed and tested interactively stand alone in a seperate program. QSF maps can display all fields defined in the program code. QSF handles 3270 extended data stream, so the maps can be typed into a blank screen as they will appear in the final map. Variables are indicated by a % sign at the beginning.

Step 2 of developing a 3270 map is to describe each field giving the color, extended high-light and the 3270 attribute. The map is saved into an CPG internal map file which is available at execution time to the specific CICS system. For migration and shipment of maps to other installation sides, there are several batch functions to backup maps and to install them.

A great enhancement to 3270 processing is, that a field name is the reference to the field attributes. You may set the cursor for example by moving the field name to an internal field where the cursor should be placed when the map is sent to the terminal. Arrays are supported with minimum declarations. The array name for the first element defines the start line, the following elements are repeated in the next rows on a terminal.

The greatest advantage of QSF is the fact, that the map can be changed without changing the program code. The map is an object, which is maintained independently and allows to pick up any field defined in the program code. 
QSTS (Quick Service Temporary Storage)
The service program for temporary storage displays CICS temporary storage entries in hex and character format. For a temporary storage queue the records may be displayed sequentially. By specifying a password, specific entries may be deleted.

Further Display Features
for the main storage (dump format), for Transient Data areas, for system information, of PPT/PCT and of online manuals complete the online programming system CPG2.

... here you can find more information about :  

CPG3, the modular programming language 
CPG4, the intelligent programming language
CPG5, the programming language for the web
CPG1, the proven programming language

Last updated: 10/04/2007