Form Header Area
Shown here is an example of the Form Header Area. Used in the shown example is the FHA of a Form for the editing of Customer Information, hence the name CSTEDT. And since this was the second form defined it has the number 1, zero being the START form.
The total header follows the standard DPS structure. Not all of the fields are needed for AMT-COBOL, e.g. the fields S1-NUMBER-ROWS and S1-NUMBER-COLS are needed for text oriented termnals (24 rows by 80 columns). These values are not used in AMT-COBOL which uses a graphical layout.
The fields that need to be set to a correct value for AMT-COBOL are described below.
*
02 SCREEN-CSTEDT-001
*
* Screen Header Area
*
05 FILLER PIC X(2) VALUE SPACES.
05 FILLER PIC 9(5) COMP VALUE ZERO.
05 FILLER PIC X(4) VALUE SPACES.
05 S1-FILLER PIC X(8) VALUE '$DPS$SWS'.
05 S1-NUMBER PIC 9(4) VALUE 001.
05 S1-NAME PIC X(8) VALUE 'CSTEDT'.
05 S1-CHECK-NUMBER PIC 9(10) COMP VALUE 190076.
05 S1-FCA-LENGTH PIC 9(5) COMP VALUE 48.
05 S1-FCA-COUNT PIC 9(5) COMP VALUE 12.
05 FILLER PIC 9(2) COMP VALUE 24.
05 FILLER PIC 9(2) COMP VALUE 0.
05 S1-NUMBER-ROWS PIC 9(2) COMP VALUE 24.
05 S1-NUMBER-COLS PIC 9(2) COMP VALUE 80.
05 FILLER PIC 9(2) COMP VALUE 6.
05 FILLER PIC 9(2) COMP VALUE 0.
05 FILLER PIC 9(2) COMP VALUE ZERO.
05 S1-QUERY-STATUS PIC 9(2) COMP VALUE 0.
05 FILLER PIC 9(5) COMP VALUE 712.
05 S1-WSDATA-LENGTH PIC 9(5) COMP VALUE 77.
05 S1-SOE-YCO PIC 9(2) COMP VALUE ZERO.
05 S1-SOE-XCO PIC 9(2) COMP VALUE ZERO.
05 S1-FUNCTIONKEY PIC 9(5) COMP VALUE ZERO.
05 S1-OUT-YCO PIC 9(2) COMP VALUE 1.
05 S1-OUT-XCO PIC 9(2) COMP VALUE 8.
05 S1-OUT-FID PIC 9(5) COMP VALUE 2.
05 S1-IN-YCO PIC 9(2) COMP VALUE 0.
05 S1-IN-XCO PIC 9(2) COMP VALUE 0.
05 S1-IN-FID PIC 9(5) COMP VALUE 0.
05 S1-VALID PIC X(1) VALUE 'V'.
05 S1-DYNAMIC PIC X(1) VALUE 'D'.
05 S1-BACKGROUND PIC X(1) VALUE 'E'.
05 S1-FOREGROUND PIC X(1) VALUE 'W'.
05 S1-INTENSITY PIC X(1) VALUE 'L'.
05 S1-HIGHLIGHT PIC X(1) VALUE 'N'.
05 S1-FONT PIC X(1) VALUE 'N'.
05 S1-EMPHASIS PIC X(1) VALUE 'N'.
05 S1-CNUM-VALIDATE PIC X(1) VALUE 'Y'.
05 FILLER PIC X(3) VALUE SPACES.
05 S1-SCREENFILE PIC X(12) VALUE 'CSTEDT1 '.
05 FILLER PIC X(12) VALUE SPACES.
Screen number in the Field Names
All the Names of the Fields in the Screen Working Storage should start with the letter S directly followed by the unique Form Number without leading zero's (with the exception of the Form number 0 which translates into S000). In the example above the Form Number is 1. When using this example all the Form Numbers 1 should be replaced by the actual Form Number.
AMT-COBOL Mandatory Fields
In this list also the example Form Number 1 is used.
- S1-FILLER: should always be set to '$DPS$SWS'
- S1-NUMBER: the unique Form Number this Screen WS is for
- S1-FCA-LENGTH: the length of the Field Control Area in words. The value should be the Field Count times 4 (S1-FCA-COUNT x 4)
- S1-FCA-COUNT: the total number of Fields in the Screen WS
- S1-WSDATA-LENGTH: the length of the Field Data Area int he Screen WS. This calculates to the total number of PIC lengths divided by 4 and rounded up (the length of Computationals should be calculated and added to the total PIC length separately). E.g. a PIC X(5) and PIC 9(4) add up to 9 and lead to a length of 3.
- S1-SCREENFILE: the Form library name, should be uniquely chosen.