Managing Adabas Stored Procedure Metadata

Topics:

Reference:

When the adapter invokes an Adabas stored procedure, it needs to know where to find the stored procedure and how to process its parameters. For each stored procedure the adapter will access, you create a synonym that describes this information.

Reference: Requirements for Creating a Synonym

Creating a synonym, that is, metadata, for Adabas Stored Procedures consists of mapping input and output parameters that are described in a Natural library as local or global (LDA/GDA) data areas.

Only the first record of a definition can be level 1. If a data area has more than one parameter, the parameters must be defined as a structure.

Example: Defining One Parameter in an Adabas Stored Procedure

Local     SAMPPRM1 Library SYSRPC                 DBID     3 FNR     8
Command                                                             > +
I T L Name                            F Leng Index/Init/EM/Name/Comment
All - ------------------------------- - ---- -------------------------
    1 PARAMETER                       A   10
 
-------------------------------------------------------- S 1    L 1

Example: Defining Multiple Parameters in an Adabas Stored Procedure

Local     SAMPPRM2 Library SYSRPC                 DBID     3 FNR     8
Command                                                             > +
I T L Name                            F Leng Index/Init/EM/Name/Comment
All - ------------------------------- - ---- -------------------------
    1 PARAMETERS
    2 TEXTINP                         A   60
    2 TEXTOUT                         A   60
    2 KEYWORD                         A   20 (1:20)
 
-------------------------------------------------------- S 4    L 1

Creating Synonyms

How to:

Reference:

x

A synonym defines a unique logical name (also known as an alias) for each Adabas stored procedure, and one set of input/output parameters. The adapter requires that you generate a synonym for each Adabas stored procedure that you want to invoke with the adapter.

Synonyms are also useful because they insulate client applications from changes to the location of a procedure. You can move or rename a procedure without modifying the client applications that use it. You need to make only one change, redefining the synonym used by the procedure on the server.

Creating a synonym generates a Master File and an Access File: these are metadata that describe the name, parameters, and options of the Adabas stored procedure to the server.

Procedure: How to Create a Synonym

  1. From the Web Console sidebar, click Applications or Connect to Data.

    The Applications page opens.

  2. If you started from the Applications page, right-click an application folder, point to New, and click Synonym on the context menu.

    The Connect to Data page opens.

  3. On the Configured list, click the down arrow next to a connection for the configured adapter, or right-click a connection.

    Depending on the type of adapter you chose, one of the following options appears on the context menu.

    • Show DBMS objects. This opens the page for selecting synonym objects and properties.
    • Create metadata objects. This opens the page for selecting synonym objects and properties.
    • Show files. This opens a file picker. After you choose a file of the correct type, the page for selecting synonym objects and properties opens.
    • Show local files. This opens a file picker. After you choose a file of the correct type, the page for selecting synonym objects and properties opens.
    • Show topics. This opens the page for selecting synonym objects and properties for topics within the Kafka environment.
  4. Enter values for the parameters required by the adapter as described in the chapter for your adapter.
  5. After entering the parameter values, click the highlighted button on the ribbon.

    The button may be labeled Next, Create Synonym, Create Base Synonyms, Create Cluster Synonym, or Update Base Synonyms.

    The synonym creation process for most adapters has been consolidated so that you can enter all necessary parameters on one page. However, for some adapters such as LDAP, you must click Next buttons until you get to a page that has a Create Synonym button.

The synonym is created and added under the specified application directory.

Note: When creating a synonym, if you choose the Validate check box (where available), the server adjusts special characters and checks for reserved words. For more information, see Validation for Special Characters and Reserved Words.

Reference: Synonym Creation Parameters for Adabas Stored Procedure

The following list describes the parameters for which you will need to supply values, and related tasks you will need to complete in order to create a synonym for the adapter. These options may appear on multiple panes. To advance from pane to pane, click the buttons provided, ending with the Create Synonym button, which generates the synonym based on your entries.

Data Base ID

The database ID.

Natural System System File

A number that identifies the Natural System system file.

Natural Stored Procedure Library

Natural library with stored procedure.

Enter a string for filtering library names, inserting the wildcard character (%) at the beginning and/or end of the string.

For example, enter ABC% to display libraries whose names begin with the letters ABC; %ABC to display libraries whose names end with the letters ABC;%ABC% to display libraries whose names contain the letters ABC at the beginning, middle, or end; or % to display all libraries.

Mask for Subprogram Name

The mask for returning a list of subprograms from which to chose. Enter a string for filtering subprogram names, inserting the wildcard character (%) at the beginning and/or end of the string.

Subprogram names

Choose a program from the drop-down list.

To identify the request buffer for the stored procedure, enter values for the next three parameters:

Data Base ID

The database ID.

Natural System User File

A number that identifies the Natural System user file.

Mask for the Libraries

The mask for returning a list of libraries from which to chose the one containing local/global data areas that describe the parameters of the stored procedure.

Mask for the Data area names

Enter the mask for returning a list of the data areas from which you will chose the data area defining the stored procedure parameters.

Natural Libraries

Select a library from the drop-down list.

Trigger File Data Base ID

The trigger file database ID.

Trigger File Number

The trigger file number.

Transaction Option

Specifies the stored procedure transaction property.

Parameter Option

Specifies the type of parameters the stored procedure has: no parameters, control, or error message.

Synonym name

The name of the synonym. You can retain the current name or change it.

Changing a synonym name enables you to manage multiple synonym versions to reflect, for example, multiple environments, or synonyms with different application logic such as different sets of Master File DEFINE attributes.

Application

Select an application directory. The default value is baseapp.

Prefix/Suffix

If you have tables with identical table names, assign a prefix or a suffix to distinguish them. For example, if you have identically named human resources and payroll tables, assign the prefix HR to distinguish the synonyms for the human resources tables. Note that the resulting synonym name cannot exceed 64 characters.

If all tables and views have unique names, leave the prefix and suffix fields blank.

Providing a suffix enables you to manage multiple synonym versions to reflect multiple environments, or synonyms with different application logic such as different sets of Master File DEFINE attributes.

Overwrite Existing Synonyms

To specify that this synonym should overwrite any earlier synonym with the same fully qualified name, select the Overwrite existing synonyms check box.

Note: The connected user must have operating system write privileges in order to recreate a synonym.

Input Data Area/ Output Data Area

Specifies which data areas are for input parameters and which are for output parameters. You can specify the same data area as the source of both the input and output parameters.

You can specify a data area only if Parameter Option is set to a value other than None.

Reference: Managing Synonyms

Once you have created a synonym, you can right-click the synonym name in the Adapter navigation pane of either the Web Console or the Data Management Console to access the available options.

For a list of options, see Synonym Management Options.

Example: Generating a Synonym

The following sample Master File and Access File are generated from the Web Console using the Create Synonym facility.

Generated Master File SAMP_LEM.MAS

FILENAME=SAMP_LEM, SUFFIX=ADANAT  , $
  SEGMENT=SEG1, SEGTYPE=S0, $
$  GROUP=REC_BUFFER, USAGE=A49, ACTUAL=A28, $
    FIELDNAME=#REF_NAME, USAGE=A8, ACTUAL=A8, $
    FIELDNAME=#REF_COUNT, USAGE=P4, ACTUAL=Z3, $
    FIELDNAME=#REF_FROM, USAGE=P16, ACTUAL=P8, $
    FIELDNAME=#REF_TO, USAGE=P16, ACTUAL=P8, $
    FIELDNAME=#REF_RC, USAGE=A1, ACTUAL=A1, $
  SEGMENT=SEG2, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_NAME, $
   GROUP=#REF_NAME, USAGE=A8, ACTUAL=A8, $
    FIELDNAME=#REF_NAME_FIRST_2, USAGE=A2, ACTUAL=A2, $
    FIELDNAME=#REF_NAME_LAST_6, USAGE=A6, ACTUAL=A6, $
  SEGMENT=SEG3, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_FROM, $
   GROUP=#REF_FROM, USAGE=A8, ACTUAL=A8, $
    FIELDNAME=#FCHAR, USAGE=A8, ACTUAL=A8, $
  SEGMENT=SEG4, SEGTYPE=S0, PARENT=SEG3, OCCURS=8, POSITION=#FCHAR, $
    FIELDNAME=#FCHAR, USAGE=I9, ACTUAL=I1, $
  SEGMENT=SEG5, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_FROM, $
   GROUP=#REF_FROM, USAGE=A5, ACTUAL=A5, $
    FIELDNAME=#RESET_PARM, USAGE=A5, ACTUAL=A5, $
  SEGMENT=SEG6, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_FROM, $
   GROUP=#REF_FROM, USAGE=A8, ACTUAL=A8, $
    FIELDNAME=#REF_FROM_A, USAGE=A8, ACTUAL=A8, $
  SEGMENT=SEG7, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A8, $
    FIELDNAME=#TCHAR, USAGE=A8, ACTUAL=A8, $
  SEGMENT=SEG8, SEGTYPE=S0, PARENT=SEG7, OCCURS=8, POSITION=#TCHAR, $
    FIELDNAME=#TCHAR, USAGE=I9, ACTUAL=I1, $
  SEGMENT=SEG9, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A8, $
    FIELDNAME=#REF_TO_A, USAGE=A8, ACTUAL=A8, $
  SEGMENT=SEG10, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A1, $
    FIELDNAME=#REF_TO_P1, USAGE=P2, ACTUAL=P1, $
  SEGMENT=SEG11, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A2, $
    FIELDNAME=#REF_TO_P3, USAGE=P4, ACTUAL=P2, $
  SEGMENT=SEG12, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A3, $
    FIELDNAME=#REF_TO_P5, USAGE=P6, ACTUAL=P3, $
  SEGMENT=SEG13, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A4, $
    FIELDNAME=#REF_TO_P7, USAGE=P8, ACTUAL=P4, $
  SEGMENT=SEG14, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A5, $
    FIELDNAME=#REF_TO_P9, USAGE=P10, ACTUAL=P5, $
  SEGMENT=SEG15, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A6, $
    FIELDNAME=#REF_TO_P11, USAGE=P12, ACTUAL=P6, $
  SEGMENT=SEG16, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A8, ACTUAL=A7, $
    FIELDNAME=#REF_TO_P13, USAGE=P14, ACTUAL=P7, $
  SEGMENT=SEG17, SEGTYPE=U, PARENT=SEG1, OCCURS=1, POSITION=#REF_TO, $
   GROUP=#REF_TO, USAGE=A16, ACTUAL=A8, $
    FIELDNAME=#REF_TO_P15, USAGE=P16, ACTUAL=P8, $

Generated Access File SAMP_LEM.ACX

SEGNAME=SEG1, STPNAME=SAMPP001, OPTTRN=N, OPTPRM=C, OPTUPD=U,
  TRGDBID=3, TRGFILE=5, $

Reference: Master File Attributes

The following Master File attributes describe Adabas Stored Procedure data segments.

Attribute

Description

FILENAME

The Master File name. This name may or may not match the stored procedure name.

SUFFIX

Identifies the adapter, and is always ADANAT.

SEGMENT

The segments in the description that are created when the synonym is generated. The segment names follow a logical format to provide uniqueness within the file.

FIELDNAME

The field name from the data area.

GROUP

The fields from the data areas that were redefined or that were defined as arrays.

USAGE

The display format and length of the field. This attribute determines how the value is displayed in reports. Values are determined based on the format and length specified by the ACTUAL attribute.

ACTUAL

The format and length of the field as described in the data area.

Reference: Access File Attributes

Attribute

Description

SEGNAME

The name of the Master File segment that describes the stored procedure input parameters.

If the stored procedure does not have input parameters, the synonym generation process creates a dummy segment.

STPNAME

The name of the stored procedure. You specify the value when you create the stored procedure synonym.

TRGDBID

The database ID of the trigger. You specify the value when you create the stored procedure synonym.

TRGFILE

The name of the trigger file. You specify the value when you create the stored procedure synonym.

OPTTRN

The transaction option. You specify the value when you create the stored procedure synonym.

OPTPRM

The parameter option. You specify the value when you create the stored procedure synonym.

OPTUPD

The update option. This is based on values that you specify when you create the stored procedure synonym.

WebFOCUS

Feedback