Pathway/iTS Web Client Programming Manual (H06.03+, J06.03+)

Table Of Contents
SCREEN COBOL-to-Web Conversion Mappings
HP NonStop Pathway/iTS Web Client Programming Manual520270-003
5-4
Mappings to Java Classes
methods defined in the ScobolType base class in the Pathway/iTS Java import
package, as 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, these 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, see 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;