Assign Screen Field Edits

Walks you through the steps to assign field edits to the fields on the BLDRCU screen.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Here you assign field edits to entry fields on the BLDRCU screen, and then set up a PF key that enables the end user to bypass screen edits. Screen field edits enable you to define the type of and format for data that a field can accept or send as output. The following table describes the edits required for the BLDRCU screen:

Field Type Edit(s)
Function Character
  • Require data entry.
  • Do not allow embedded spaces or punctuation.
Part Number Character
  • Store data as an 8-byte alphanumeric number.
  • Require data entry.
  • Define input picture as NNNNNNN9.
  • Define output picture as XXXXXXX9.
Units Numeric
  • Allow data between 0 and 50.
  • Move zeros to field if data not entered.
  • Remove special characters.
  • Specify an error message that says VALID VALUES FOR UNITS ARE 0 THROUGH 50.
  • Define output picture as Z9.
Base Price Numeric
  • Store data as a 4-digit number with 2 decimal places.
  • Move zeros to field if data not entered.
  • Remove special characters.
  • Define output picture as ZZZ9.99.
Inventory Value Numeric
  • Store data as a 12-digit number with 2 decimal places and a $ to represent monetary value.
  • Computational field.
  • Move zeros to field if data not entered.
  • Define output picture as $$$$$$$$9.99

Assign screen edits to BLDRCU fields

Complete the following procedures to assign screen edits to the BLDRCU fields you painted in Paint a Screen.

Function
In this procedure, you assign field edits to the FUNCTION field on the BLDRCU (Parts Update) screen. The edits you assign here set the field to require input from the end user.
  1. Click on the Function entry field to select it.
  2. Click Edit > Field Edits. The Field Edit Data Type dialog box appears.
  3. To accept the default Character Local Data Class and Character String (Fixed) Local Data Type, click OK. These selections define the internal representation for the field. The Field Edits window appears, showing default edits for the field.
  4. Click Input. The Input Representation dialog box appears. Here, you specify format and data requirements that the end user must adhere to when entering data into the field.
  5. Check Input Required. When checked, this option requires the end user to enter data for the field.
  6. Uncheck Embedded Spaces.
  7. Click OK. This returns you to the Field Edits window.
  8. Click OK. This returns you to your painted screen.
Part Number
In this procedure, you assign field edits to the Part Number entry field on the Parts Update screen.
Accept default class and type
  1. Click the Part Number entry field to select it.
  2. Click Edit > Field Edits. The Field Edit Data Type dialog box appears.
  3. To accept the default Character Local Data Class and Character String (Fixed) Local Data Type, click OK. The Field Edits summary dialog box appears, showing default edits for the field.
Define user inputs
  1. Click Input. The Input Representation window appears.
  2. Check Input Required.
  3. Click Use Input Mask.
  4. In the Input Mask field, type nnnnnnn9 (7 n's).
  5. Click OK. The Field Edits window reappears.
Define outputs
  1. Click Output. The Output Representation dialog box appears. Here, you can specify format requirements for displaying the data.
  2. Click Use Output Mask.
  3. In the Output Mask entry field (located below the Type drop-down list), enter xxxxxxx9 (7 x's).
  4. Click OK. This returns you to the Field Edits window.
  5. Click OK. This returns you to your painted screen.
Units
In this procedure, you assign field edits to the Units field on the Parts Update screen.
  1. Click on the Units entry field to select it.
  2. From the Edit menu select Field Edits. The Field Edit Data Type dialog box appears.
Set local data
  1. On the Local Data Class list, click Numeric.
  2. On the Local Data Type list, click COBOL Display.
  3. Click OK. The Field Edits dialog box appears.
Assign input edits
  1. Click Input. The Input Representation window appears. The Use Characteristics radio button is selected by default.
  2. Check Zero When Blank. Checking this option moves zeroes to the field if the end user does not enter data.
  3. Check Ensure Computational. Checking this option prevents premature termination of the program if a user enters non-numeric data into the field.
Assign an error message
  1. Click Message. The Input Messages and Attributes dialog box appears. Here you can specify error messages to display if the field fails input edits or if data for a required field is not entered.
  2. In the Error field, type Valid values are 0 through 50.
  3. In the Attributes field, type pos+brt. This positions the cursor at the beginning of the field when invalid data is entered, and assigns a bright intensity to the error message.
  4. Click OK. This returns you to the Input Representation window.
  5. Click OK. This returns you to the Field Edits window.
View default output edits (optional)
  1. Click Output. The Output Representation dialog box appears.
  2. After viewing the information on this window, click Cancel. This returns you to the Field Edits window.
Specify values and conversions
  1. Click Values. The Values and Conversions dialog box appears. Here you can specify that only certain values, ranges of values, or conversion values can be entered.
  2. To assign a range of acceptable input values, type 0 to 50 on the first value entry line.
  3. Click OK. This returns you to the Field Edits window.
  4. Click OK. This returns you to your painted screen.
Base Price
In this procedure, you assign field edits to the Base Price field on the Parts Update screen.
  1. Click on the Base Price entry field to select it.
  2. Click Edit > Field Edits. The Field Edit Data Type dialog box appears.
Set local data
  1. On the Local Data Class list, click Numeric.
  2. On the Local Data Type list, click COBOL Display.
  3. Click OK. The Field Edits dialog box appears.
Define internal edits
  1. Click Internal. The Internal Representation dialog box appears. Here, you can define storage requirements for the field.
  2. You originally painted this field as 7 bytes. To account for the decimal point in this field, in the Total field, type 6.
  3. In the Right of Decimal field, type 2. This specifies that this field has 2 decimal places.
  4. Click OK. An internal Pic message appears.
  5. Click OK to clear the message. This returns you to the Field Edits window.
Define input edits
  1. Click Input. The Input Representation dialog box appears.
  2. In the Max column of the Left Input Digits field, type 4.
  3. In the Max column of the Decimal Digits field, type 2.
  4. Check Zero When Blank.
  5. Check Ensure Computational.
  6. Click OK. This returns you to the Field Edits window.
Define output edits
  1. Click Output. The Output Representation dialog box appears.
  2. In the Output Mask field, change ZZZZZZ9 to zzz9.99.
  3. Click OK. This returns you to the Field Edits window.
  4. Click OK. This returns you to your painted screen.
Inventory Value
In this procedure, you assign field edits to the Inventory Value field on the Parts Update screen.
  1. Click on the Inventory Value entry field to select it.
  2. Click Edit > Field Edits. The Field Edit Data Type dialog box appears.
Set local data
  1. On the Local Data Class list, click Numeric.
  2. On the Local Data Type list, click COBOL Display.
  3. Click OK. The Field Edits dialog box appears.
Define internal edits
  1. Click Internal. The Internal Representation dialog box appears. Here, you can define storage requirements for the field.
  2. You originally painted this field as 12 bytes. To account for the decimal point in this field, in the Total field, type 11.
  3. In the Right of Decimal field, type 2. This specifies that this field has 2 decimal places.
  4. Click OK. An internal Pic message appears.
  5. Click OK to clear the message. This returns you to the Field Edits window.
Define input edits
  1. Click Input. The Input Representation dialog box appears.
  2. Check Ensure Computational.
  3. Check Zero When Blank.
  4. Click OK. This returns you to the Field Edits window.
Define output edits
  1. Click Output. The Output Representation dialog box appears.
  2. In the Output Mask field, change ZZZZZZZZZZZ9 to $$$$$$$$9.99 (8 $s).
  3. Click OK. This returns you to the Field Edits window.
  4. Click OK. This returns you to your painted screen.

Now is a good time to save your work. Click File > Save.

Bypass assigned field edits

You might wonder why you would want to bypass field edits. If, for example, an end user accesses the BLDRCU screen by mistake, escaping the screen is impossible until they enter valid data into the Function field, because you assigned the Required field edit to the Function field.

For the BLDRCU screen, you set up the PF3 key to bypass all input edits on the screen. Then, in the Online Express tutorial, you assign it a termination function that enables an end user to escape from the screen without affecting the database. When you bypass edits, you bypass all the field edits and all the screen edit routines.

  1. Double-click on any empty portion of the painted screen. The Screen Parameters dialog box appears.
  2. On the tool bar, click EDITS. The Field Edit Messages and Attributes dialog box appears.
  3. On the tool bar, click Bypass. The Field Edit Bypass Criteria dialog box appears.
  4. Check PF03.
  5. Click OK. This returns you to the Field Edit Messages and Attributes window.
  6. Click OK. This returns you to the Screen Parameters window.
  7. Click OK. This returns you to the Screen Painter.

Exit the Screen Painter

You have now completed your work in the Screen Painter and can exit back to the AppMaster Builder perspective.

  1. In the Screen Painter, click File > Exit.
  2. Click Yes on the prompt to save all of your work.