In this section: 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.
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.
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
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
How to: Reference: |
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.
To create a synonym, you must have previously configured the adapter. You can create a synonym from the Applications or Adapters pages of the Web Console.
The Applications page opens.
The Select adapter to configure or Select connection to create synonym pane opens.
The first of a series of synonym creation panes opens.
The Status pane indicates that the synonym was created successfully.
The synonym is created and added under the specified application directory.
Note:
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.
The database ID.
A number that identifies the Natural System system file.
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.
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.
Choose a program from the drop-down list.
To identify the request buffer for the stored procedure, enter values for the next three parameters:
The database ID.
A number that identifies the Natural System user file.
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.
Enter the mask for returning a list of the data areas from which you will chose the data area defining the stored procedure parameters.
Select a library from the drop-down list.
The trigger file database ID.
The trigger file number.
Specifies the stored procedure transaction property.
Specifies the type of parameters the stored procedure has: no parameters, control, or error message.
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.
Select an application directory. The default value is baseapp.
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.
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.
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.
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 following options.
Option |
Description |
---|---|
Open |
Opens the Master File for viewing and editing using a graphical interface. If an Access file is used it will be also available. |
Edit as Text |
Enables you to view and manually edit the Master File synonym. Note: To update the synonym, it is strongly recommended that you use the graphical interface provided by the Open option, rather than manually editing the Master File. |
Edit Access File as Text |
Enables you to view and manually edit the Access File synonym. Note: This option is available only when an Access File is created as part of the synonym. |
Sample Data |
Retrieves up to 20 rows from the associated data source. |
Data Profiling |
Data Profiling provides the data characteristics for synonym columns. Alphanumeric columns provide the count of distinct values, total count, maximum, minimum, average length, and number of nulls. Numeric columns provide the count of distinct values, total count, maximum, minimum, average value, and number of nulls. |
Refresh Synonym (if applicable) |
Regenerates the synonym. Use this option if the underlying object has been altered. |
Data Management |
Followed by these options, if applicable: Recreate DBMS Table. Recreates the data source table. You are asked to confirm this selection before the table is regenerated. (Note that the table will be dropped and recreated. During the process, data may be lost.) Delete All Data. Deletes all existing data. You are asked to confirm this selection before the data is deleted. Insert Sample Data. Inserts specified number of sample records, populating all fields with counter values. Reorganize. Recreates the data source table preserving original data. Note: This option is not available in the Web Console. |
Impact Analysis |
Generates reports on procedures, synonyms, and columns that provide information on the flows/stored procedures available on a particular server, and the synonyms and columns they use. These reports enable you to evaluate changes before they are made by showing which components will be affected. See the Server Administration for UNIX, Windows, OpenVMS, IBMÂ i, and z/OS manual for details about Impact Analysis reports. |
Copy |
Copies the synonym to the clipboard. |
Delete |
Deletes the synonym. You are asked to confirm this selection before the synonym is deleted. |
Cut |
Deletes the synonym and places it on the clipboard. |
Properties |
Displays the properties of the synonym, including physical location, last modified date, description, and privileges. |
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, $
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. |
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. |
iWay Software |