Previous Topic Next topic Print topic


Fields and Flags, Field Edit

You can interrogate the following AMB-generated flags and data fields to determine input data errors when you code your application edit routines. Instructions for coding application edit routines are in online Help.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Fields:

These are the AMB-generated fields. The option Execute Before/After Edits determines which field to reference.

Representation Execute Option Field Name and Format
Representation Execute Option Field Name and Format

Input

After AMB edits

Screenname-fieldname. Internal picture was updated by any previous field edits.

Input

Before AMB edits

Screenname-fieldname-INPT. Data field containing any invalid data entered by the end user. Edits have not been performed; data is in screen input format. Field length is field length painted on the screen; definition is PIC X.

Output

After AMB Edits

Screenname-fieldname-EDIT. Data was moved to -EDIT by previous output edits. Data may contain special symbols. Default length is field length painted on the screen; definition is PIC X.

Output

Before AMB Edits

Screenname-fieldname. Data was not processed by previous output edits and is still in the internal format. Data in this field moves to the -EDIT field when an output format is specified. Default length is field length painted on the screen; definition is PIC X.

Input or Output

Before or After AMB Edits

(APS-ROW-SUB). This data field contains the row number being processed for fields in a repeated block, or in a list box or combination box.

Input or Output

Before or After AMB Edits

APS-EDIT-MESSAGE. Data field that lets you display an error message in addition to any you defined in the field edits for the field. Move a literal or data name containing the text into this field.

Input or Output

Before or After AMB Edits

Screenname-fieldname-LEN. For CICS only. Contains the length of the field; definition is PIC X.

Input or Output

Before or After AMB Edits

Screenname-fieldname-ATTR. For CICS only. Contains the attribute values assigned to the field; definition is PIC X.

Flags:

These are the AMB-generated flags:

Flag Description

APS-EDITS-PASSED

Flag that AMB sets to T(rue) if there are no input errors and F(alse) if there are

APS-EDIT-ERRORS-CTR

Data field containing the number of screen fields in error

screenname-fieldname-FLAG

Flag that AMB sets to T(rue) if an error occurs and F(alse) if not

General Rules:

  1. AMB processes input data from the screenname-fieldname-INPT field. After the data passes the input edits, the data moves to screenname-fieldname and takes on the characteristics of the internal picture. For output, the data moves to the screenname-fieldname-EDIT field and takes on the characteristics of the output format specifications.
  2. Application edit routines execute for a field whether the data passes or fails field edits, unless you set various switches in the APFEIN control file . To indicate an error in an application edit routine, move T to screenname-fieldname-FLAG. This tells AMB to execute error processing; you can display an additional error message from the APS-EDIT-MESSAGE field.
  3. Do not code database calls in application edit routines.

Examples:

The following is sample generated code for a screen record with input and output edits.
01  EMPLOYEE-RECORD.
    05 EMPLOYEE-SALARY-GRP.
       10 EMPLOYEE-SALARY-INPT.
          15  FILLER             PIC X(03).
          15  EMPLOYEE-SALARY    PIC S9(O5)V99.
       10 EMPLOYEE-SALARY-OUTP REDEFINES
                          EMPLOYEE-SALARY-INPT.
          15  EMPLOYEE-SALARY-EDITPIC $$$,$$9.99.

The following example shows the generated code when you code an application edit routine as a subprogram. The routine:

  • Validates the customer number entered in the CUSTOMER-NO field.
  • Is invoked during field edit input logic execution.
  • Executes After AMB Edits.
  • Passes the following arguments: *CUSTOMER-NO, *CUST-NO-FLAG, APS-EDIT-MESSAGE
The edit routine uses the CUSTVER subprogram. The subprogram accepts the arguments into the Linkage Section.
CALL 'CUSTVER' USING
... SCRN-CUSTOMER-NO,
... SCRN-CUST-NO-FLAG,
... APS-EDIT-MESSAGE
Previous Topic Next topic Print topic