General Rules

This section covers the following topics:


Applying Predict Defaults

When applying API functions, settings in session profiles or the General defaults menu are evaluated as if standard Predict functions were being performed. Information is taken from the Predict system profile or a user-specific profile if a program using API functions is called by a user and the profile of this user is activated.

The following defaults are evaluated:

  • Upper/lower case conversion: Object IDs, abstracts, extended descriptions and owners are converted to upper case if the respective parameters in the General defaults menu are set to U.

  • The force owner/description parameter in the Metadata Administration is evaluated.

  • The modification log (date, time and user of modification) is updated if this function is activated in the session profile.

  • A complete maintenance check is performed if Y is specified with the parameter Full maintenance check in the session profile.

Executing User Exits

User exits that have been activated with the Activate user exits function of the Modify Defaults menu are executed in combination with programs using the API functions. The field SYSDIC-USER is defined for all user exists and the API. It can be used to pass values from user programs to user exits and vice versa.

The following user exits can be executed together with API functions:

  • U-MNT before a maintenance function is executed.

  • U-MNT1 before a maintenance function for an elementary field is executed.

  • U-ACM before updated attributes are stored in Predict.

  • U-PUR before an object is purged or scratched.

  • U-DESC after an extended description has been modified.

  • U-OW before the owner list is modified.

  • U-ACMR after an Add, Copy, Modify or Rename function has been executed.

  • U-OBJID after the object ID has been checked.

The user exit CATOWEX is not supported.

Validation Checks

Predict checks if values specified with function calls have been specified correctly. The following checks are applied:

  • Are object types and object IDs specified correctly?

  • Does any of the alphanumeric or numeric values specified exceed the length of the respective field definitions in the metadata definitions of the object type?

  • Are more attribute values specified than defined in the metadata definitions of the object type?

  • Is any keyword specified that is not yet defined in the data dictionary?

  • If verification rules for attributes have been defined in the Metadata Administration, these rules are evaluated.

Rules and Hints

The following rules apply when using API functions:

  • An END OF TRANSACTION statement must be executed within the user programs; API functions do not execute this statement.

  • The field #OBJECT-COMPLETE contains a return code specifying whether an object has been defined completely or - in the case of an END OF TRANSACTION - the definition of an object is incomplete. Consistency of data can be ensured by evaluating this field within user programs modifying Predict objects of user-defined types.

    Possible values of field #OBJECT-COMPLETE:

    • 0 Complete

    • 1 Owner missing (force)

    • 2 Description missing (force)

    • 3 Owner and description missing (force)

  • Numeric variables are stored in the field #NUM-VALUES without decimal places. The number of decimal places is determined by the format definition of a field. For example: the value 10 will result in numeric values depending on different format definitions as shown below.

    Format definition Numeric value
    N4.3 10000
    N4 10
  • The variable #INTERNAL determines whether General default or profile parameters are evaluated. #INTERNAL should not be changed with RESET or by assigning a value to prevent Predict from reading the default values unnecessarily often.