Pathway/iTS Web Client Programming Manual (G06.24+)

SCREEN COBOL-to-Web Conversion Mappings
Compaq NonStop Pathway/iTS Web Client Programming Manual520270-001
5-5
Mappings to Java Classes
Conversion of Paragraphs
Each program unit class has a method named eXecute. This method provides the
starting point for executing that class. Each paragraph in the SCREEN COBOL
program is converted to a method in the Java code. The names of these methods are
derived from the names of the corresponding paragraphs, with hyphens replaced by
underscores.
In addition to the methods created for each paragraph, the converter creates extra
methods in the program unit class to perform tasks such as handling level-88 data items
and handling parameter passing between calling and called program units. The names
for these methods are generated internally by the converter. The converter generates
one or more Java statements for each SCREEN COBOL statement.
The converter uses the HTMLHandler class from the Pathway/iTS Java import package
to manage the screen-related functions. Similarly, all SCREEN COBOL functions
related to the NonStop Kernel, such as the BEGIN-TRANSACTION and SEND
statements, are implemented by calling methods in the Gateway class in the Java import
package.
Example 5-3
shows a sample SCREEN COBOL paragraph, and Example 5-4 illustrates
the corresponding Java code.
In Example 5-4
, the following conversion mappings occur:
The statement PERFORM PROCESS-PARA is converted to a call to the method
PROCESS_PARA().
Example 5-3. SCREEN COBOL Paragraph
MAIN-PARA.
PERFORM PROCESS-PARA.
PROCESS-PARA.
MOVE SPACES TO FIRST-NAME, LAST-NAME.
DISPLAY BASE NAME-SCREEN.
Example 5-4. Java Code Resulting From Conversion of SCREEN COBOL
Paragraph
public void eXecute () {
PROCESS_PARA ("PROCESS-PARA");
}
public void PROCESS_PARA (String ret_func) throws
ScobolTxnException {
FIRST_NAME.setSpaces();
LAST_NAME.setSpaces();
HTMLHandler.displayBase("TEST_SCRN0000.html", "SCRFORM",
"UFrame", "Action");
}