Pathway/iTS Web Client Programming Manual (G06.24+)
SCREEN COBOL-to-Web Conversion Mappings
Compaq NonStop Pathway/iTS Web Client Programming Manual—520270-001
5-4
Mappings to Java Classes
described in Section 6, Java Import Package Reference. The name of the nested Java
class is derived by prefixing the name of the group item with c_.
Each data item in the Working-Storage Section is mapped to a Java object. Hyphens in
the SCREEN COBOL names are replaced by underscores in the Java names. An
instance of each elementary item is created by using the data-type objects provided in
the Java import package.
Example 5-1
shows a fragment of SCREEN COBOL Working-Storage code, and
Example 5-2 illustrates the corresponding Java code.
In Example 5-2
, the following conversion mappings occur:
•
The group item WS-NAME is converted to the class name c_WS_NAME.
•
The data items FIRST-NAME and LAST-NAME, of type PIC X (), are converted
respectively to the Java objects FIRST_NAME and LAST_NAME, of type PicX.
•
The data items are instantiated in the constructor of c_WS_NAME and added to the
ScobolGroupType class using addScobolData API.
For details about the various library classes used, refer to Class PicX
in Section 6, Java
Import Package Reference.
Example 5-1. SCREEN COBOL Working-Storage Code Fragment
01 WS-NAME.
05 FIRST-NAME PIC X (10).
05 LAST-NAME PIC X (20).
Example 5-2. Java Code Resulting From Conversion of Working-Storage Code
class c_WS_NAME extends ScobolType{
public PicX FIRST_NAME;
PicX LAST_NAME;
// Constructor of the group class
public c_WS_NAME{
FIRST_NAME = new PicX (10);
addScobolData(FIRST_NAME);
LAST_NAME = new PicX (20);
addScobolData(LAST_NAME);
}
// Implementation of other methods
}
c_WS_NAME WS_NAME;