Create an Object-Browse Process

This section describes the Object-Browse code generator. The following topics are covered:


Introduction

The Object-Browse code generator creates the browse subprogram for an object, as well as three parameter data areas:

Data Area Description
Object PDA Defines the returned row data.
Object key PDA Defines the search key values.
Restricted PDA Contains private data used internally by the browse object to maintain context.

Generate the Object-Browse Subprogram

Start of instruction setTo generate an object-browse subprogram and data areas

  1. Open the context menu in the Navigator view for the NaturalONE project into which you want to generate the modules.

    Or:
    Open the context menu in the Navigator view for the library into which you want to generate the modules.

  2. Select Code Generation > New Object Browse.

    The Define Object Browse Details panel is displayed. For example:

    graphics/define-object-browse-details.png

  3. Type the location of the Natural library in which to generate the subprogram and associated modules in Library.

    The library must currently exist.

    Or:
    Select Browse to display a window listing the existing libraries for selection.

    Note:
    The libraries listed for selection are based on the current project.

  4. Type the name of the object-browse subprogram in Name.

  5. Select the DDM for the object-browse subprogram in DDM.

    Tip:
    The DDMs are typically located in the SYSTEM library.

    Using this panel, you can:

    Task Procedure
    Select another NaturalONE project in which to generate the object-browse modules. Type the name of the project in Project or select Browse to display a window listing the existing projects for selection. The project must currently exist.
    Select a folder in which to generate the object-browse modules. Type the name of the folder in Folder or select Browse to display a window listing the existing folders for selection. The folder must currently exist within the selected NaturalONE project.

    Note:
    This option allows you to generate modules into more complex library structures (for example, "Natural-Libraries/my library (MYLIB)/SRC"). When this option is not specified, the modules will be generated into the basic library folder (for example, "Natural-Libraries/MYLIB/SRC", "Natural-Libraries/MYLIB/Subprograms", etc.).

    Change or provide a description of the object-browse subprogram. Type a brief description in Description.
  6. Select Next.

    The Change Defaults panel is displayed. For example:

    graphics/change-defaults-ob.png

    This panel displays the default specification values for the subprogram to be generated. Using this panel, you can:

    Task Procedure
    Provide a description of the subprogram to be generated. Type the description in Object description.
    Change the name of the object PDA. Type the name in Object PDA.
    Change the name of the object key PDA. Type the name in Object key PDA.
    Change the name of the restricted PDA. Type the name in Restricted PDA.
    Define the primary key field used for browse operations. Select the field in Primary key.

    Note:
    This option is only available when the primary key is not known (for example, DB2 files). For Adabas files, the primary key is the ISN.

  7. Select Finish.

    When generation is complete, the available user exits are displayed in the Outline view (see User Exits for the Object-Browse Subprogram) and the generated modules are displayed in the Navigator view. For example:

    graphics/object-browse-example-in-navigator.png

    These modules are:

    Module Description
    MYOBDA1.NSA Object PDA
    MYOBJB.NSN Object-browse subprogram
    MYOBKA1.NSA Object key PDA
    MYOBPA1.NSA Restricted PDA

    The subprogram is displayed in the editor view. For example:

    graphics/object-browse-example-in-editor.png

  8. Save the subprogram and associated modules.

    At this point, you can:

    • Define user exits for the subprogram. For information, see Defining User Exits.

    • Use the NaturalONE Testing option to test the subprogram. For information, see Test a Subprogram Directly in Application Testing.

    • Use NaturalONE functionality to upload the generated subprogram to the server.

User Exits for the Object-Browse Subprogram

The Outline view for the object-browse subprogram displays the available user exits. For example:

graphics/user-exits-in-outline-view-object-browse.png

You can use these exits to define additional processing.

Notes:

  1. All user exits are empty when generated.
  2. For information about adding custom code within user exits, see Defining User Exits.