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-6
Mappings to Java Classes
•
In PROCESS-PARA, the MOVE SPACES statement is converted to calls to the
setSpaces() methods in the FIRST_NAME and LAST_NAME data objects.
•
To display the NAME-SCREEN base screen, the converted code invokes the
displayBase method in the HTMLHandler object, passing the name of the related
HTML file.
Conversion of Screen Fields
Each input-output element used in the Screen Section of the SCREEN COBOL program
is converted into a ScreenField object in the Java class. The name of this ScreenField
object is derived by prefixing the name of the SCREEN COBOL data object with s_.
The ScreenField objects in the Java classes are related to their corresponding HTML
fields by means of this name attribute. The same name is used to set the name attribute
in the corresponding field in the HTML pages.
Example 5-5
shows a sample SCREEN COBOL input-output element that is related to a
Working-Storage item. Example 5-6 illustrates the corresponding Java code.
The name of the screen field object s_FIRST_NAME is obtained by prefixing with s_
the name of the FIRST_NAME data object that represents the Working-Storage item
FIRST-NAME.
Differences in Behavior Between SCREEN COBOL Statements and
Their Java Implementations
The SCREEN COBOL ACCEPT statement and its Java implementation have somewhat
different behavior. In SCREEN COBOL, the displayed value of a screen-field item is
not moved into the corresponding working-storage data item unless it has been modified
by the user or unless the MDTON (Modified Data Tag On) attribute is specified for that
screen-field item. However, in Java the displayed value of the screen-field item is
always moved to the corresponding working-storage data item. But if the length of the
screen-field value is zero, the corresponding working-storage data item remains
unmodified.
Example 5-5. SCREEN COBOL Input-Output Element
10 EMP-FIRST-NAME at 10, 20 PIC X(10) using FIRST-NAME.
Example 5-6. Java Code Resulting From Conversion of SCREEN COBOL Input-
Output Element
s_FIRST_NAME = new ScreenField("s_FIRST_NAME",
WS_NAME.FIRST_NAME,
WS_NAME.FIRST_NAME
10, 20, “XXXXXXXXXX”);