Using the PowerExchange CallProg Function to Call a User Exit Program

Using the PowerExchange CallProg Function to Call a User Exit Program

Step 3. Add User-Defined Fields

Step 3. Add User-Defined Fields

In this step, you add user-defined fields.
The user-defined fields invoke the PowerExchange CallProg function, which calls the user exit program. For more information about the CallProg function, see CallProg.
The user exit program processes data in and returns the class types of the REC_TYPE, BIN_NO, and DECIMAL_NO fields.
  1. Open the demo.userexit data map and the MASTER_REC record.
  2. In the
    Record
    window, click the
    Expr(0)
    tab.
  3. Right-click anywhere on the
    Expr(0)
    tab and click
    Add Field at End
    .
  4. Add the classtype_rec_type field, which is an output field that contains the result from the user exit program when it is invoked for the REC_TYPE field. Define the following properties for the field:
    Property
    Value
    Name
    classtype_rec_type
    Type
    CHAR
    Precision
    0
    Scale
    0
    Length
    1
  5. Right-click anywhere on the
    Expr(0)
    tab and click
    Add Field at End
    .
  6. Add the rc_rec_type field, which calls the user exit program to process the REC_TYPE field. Define the following properties for the field:
    Property
    Value
    Notes
    Name
    rc_rec_type
    Type
    NUM32
    Precision
    0
    Scale
    0
    Length
    0
    Phase
    RW
    Indicates that the operation is read or write.
    Expression
    CallProg('UCPGCLSC', 'UCPGCLSC','COBOL', REC_TYPE,classtype_rec_type)
    To enter the expression for the field, complete the following steps:
    1. Click in the cell in the
      Expression
      column and click the Browse button. The
      Expression Editor
      dialog box appears.
    2. In the
      Function List
      list in the
      Expression Editor
      dialog box, double-click the CallProg function.
    3. In the
      Expression List
      list, enter
      ('UCPGCLSC','UCPGCLSC','COBOL',REC_TYPE,classtype_rec_type)
      at the end of the CallProg function name.
    4. Click
      Validate
      . In the
      Validate
      box, the
      No Errors
      message appears.
    5. Click
      OK
      .
  7. In the
    Record
    window, click the
    Expr(0)
    tab.
  8. Right-click anywhere on the
    Expr(0)
    tab and click
    Add Field at End
    .
  9. Add the classtype_bin_no field, which is an output field that contains the result from the user exit program when it is invoked for the BIN_NO field. Define the following properties for the field:
    Property
    Value
    Name
    classtype_bin_no
    Type
    CHAR
    Precision
    0
    Scale
    0
    Length
    1
  10. Right-click anywhere on the
    Expr(0)
    tab and click
    Add Field at End
    .
  11. Add the rc_bin_no field, which calls the user exit program to process the BIN_NO field. Define the following properties for the field:
    Property
    Value
    Notes
    Name
    rc_bin_no
    Type
    NUM32
    Precision
    0
    Scale
    0
    Length
    0
    Phase
    RW
    Indicates that the operation is read or write.
    Expression
    CallProg('UCPGCLSC', 'UCPGCLSC','COBOL', BIN_NO,classtype_bin_no)
    To enter the expression for the field, complete the following steps:
    1. Click in the cell in the
      Expression
      column and click the Browse button. The
      Expression Editor
      dialog box appears.
    2. In the
      Function List
      list in the
      Expression Editor
      dialog box, double-click the CallProg function.
    3. In the
      Expression List
      list, enter
      ('UCPGCLSC','UCPGCLSC','COBOL',BIN_NO,classtype_bin_no)
      at the end of the CallProg function name.
    4. Click
      Validate
      . In the
      Validate
      box, the
      No Errors
      message appears.
    5. Click
      OK
      .
  12. Right-click anywhere on the
    Expr(0)
    tab and click
    Add Field at End
    .
  13. Add the classtype_dec_no field, which is an output field that contains the result from the user exit program when it is invoked for the DECIMAL_NO field. Define the following properties for the field:
    Property
    Value
    Name
    classtype_dec_no
    Type
    CHAR
    Precision
    0
    Scale
    0
    Length
    1
  14. Right-click anywhere on the
    Expr(0)
    tab and click
    Add Field at End
    .
  15. Add the rc_decimal_no field, which calls the user exit program to process a copy of the DECIMAL_NO field. Define the following properties for the field:
    Property
    Value
    Notes
    Name
    rc_decimal_no
    Type
    NUM32
    Precision
    0
    Scale
    0
    Length
    0
    Phase
    RW
    Indicates that the operation is read or write.
    Expression
    CallProg('UCPGCLSC', 'UCPGCLSC','COBOL', DECIMAL_NO,classtype_dec_no)
    To enter the expression for the field, complete the following steps:
    1. Click in the cell in the
      Expression
      column and click the Browse button. The
      Expression Editor
      dialog box appears.
    2. In the
      Function List
      list in the
      Expression Editor
      dialog box, double-click the CallProg function.
    3. In the
      Expression List
      list, enter
      ('UCPGCLSC','UCPGCLSC','COBOL',DECIMAL_NO,classtype_dec_no)
      at the end of the CallProg function name.
    4. Click
      Validate
      . In the
      Validate
      box, the
      No Errors
      message appears.
    5. Click
      OK
      .

0 COMMENTS

We’d like to hear from you!