In this section: |
When the server accesses a data source, it needs information on how to interpret the data stored there. For each data source the server will access, you create a synonym that describes the structure of the data source and the server mapping of the Mumps data types.
How to: Reference: |
Synonyms define unique names (or aliases) for each Mumps table or view that is accessible from a server. Synonyms are useful because they hide the location and identity of the underlying data source from client applications. They also provide support for extended metadata features of the server such as virtual fields and additional security mechanisms.
Using synonyms allows an object to be moved or renamed while enabling client applications to continue functioning without modification. The only modification required is a redefinition of the synonym on the server. The result of creating a synonym is a Master File and Access File.
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.
If you wish to filter UCIs (User Class Identifiers), click the Filter UCIs check box and enter a UCI name, then click Next.
To select all UCIs, simply click Next.
Note that the list of UCIs displayed depends on the volume that was specified when the adapter was configured.
Choose the UCI that contains the tables (globals) for which you wish to create synonyms, then click Select Tables.
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.
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.
To select all globals in the list, select the check box to the left of the Default Synonym Name column heading.
To select specific globals, select the corresponding check boxes.
This column displays the name that will be assigned to each synonym. To assign a different name, replace the displayed value.
The Mark for Global Scan check box is activated for all selected globals.
Tip: You can modify the synonym manually from the navigation pane in the Web Console or the Data Management Console. Right-click the synonym and choose either Edit as Text to open a text editor or Edit/Open to open a graphical viewing/editing tool.
To generate a synonym for the global Civic, enter the following information on the Create Synonym panes of the Web Console or the Data Management Console:
Note that the list of UCIs displayed depends on the volume you specified when you configured the adapter. In this example, the volume is RAB.
A status window displays the message: All Synonyms Created Successfully
Generated Clinic Master File
FILE=CLINIC, SUFFIX=DSM, $ SEGMENT=GLOBAL, SEGTYPE=U, $ FIELD=DUMMY, ALIAS=SUBSCRIPT, USAGE=A1, ACTUAL=A1, $ FIELD=GLOBAL_VALUE, ALIAS=GLOBAL_VALUE, USAGE=A512, ACTUAL=A512, $ SEGMENT=SUB1, SEGTYPE=S0, $ FIELD=SUB1, ALIAS=SUBSCRIPT, USAGE=A245, ACTUAL=A245, $ SEGMENT=SUB2, SEGTYPE=S0, $ FIELD=SUB2, ALIAS=SUBSCRIPT, USAGE=A245, ACTUAL=A245, $ SEGMENT=SUB3, SEGTYPE=S0, $ FIELD=SUB3, ALIAS=SUBSCRIPT, USAGE=A245, ACTUAL=A245, $ FIELD=VAL3, ALIAS=VAL3, USAGE=A512, ACTUAL=A512, $
Note that, unlike other databases, Mumps does not provide column names. Therefore, the API does not return column names. All columns are assigned names prefixed with SUB and numbered sequentially (SUB1, SUB2,..., SUBn). However, if you wish you can manually change the field names generated in the synonym to make them more descriptive. Data value fields are placed in the segment associated with the subscript. Data values might contain a sequence of variable length fields delimited by special characters. These delimiting characters are described in the Access File and are associated with subscript segments.
Generated Clinic Access File
UCI=EDA, VOLUMESET=RAB, GLOBAL=CLINIC, CARDINALITY=6, WRITE=NO, $ SEGNAM=GLOBAL, DELIMITER=,$ SEGNAM=SUB3, DELIMITER=,$
To facilitate reporting, you can manually redefine data in the Master File, as illustrated in an edited version of the Master File synonym Clinic, where the field VAL3 has been redefined. To compare the edited version with the original, see Creating a Synonym.
FILE=CLINIC, SUFFIX=DSM, $ SEGMENT=GLOBAL, SEGTYPE=U, $ FIELD=DUMMY, ALIAS=SUBSCRIPT,USAGE=A1, ACTUAL=A1, $ FIELD=GLOBAL_VALUE, ALIAS=GLOBAL_VALUE, USAGE=A512, ACTUAL=A512, $ SEGMENT=SUB1, SEGTYPE=S0, $ FIELD=SUB1, ALIAS=SUBSCRIPT, USAGE=A245, ACTUAL=A245, $ SEGMENT=SUB2, SEGTYPE=S0, $ FIELD=SUB2, ALIAS=SUBSCRIPT, USAGE=A245, ACTUAL=A245, $ SEGMENT=SUB3, SEGTYPE=S0, $ FIELD=SUB3, ALIAS=SUBSCRIPT, USAGE=A245, ACTUAL=A245, $ FIELD=VAL3, ALIAS=VAL3, USAGE=A512, ACTUAL=A512, $ SEGMENT=SUB3RED, SEGTYPE=S0, PARENT=SUB3, POSITION=VAL3, $ FIELD=VAL3A, ALIAS=VAL3A, USAGE=A4, ACTUAL=A4, $ FIELD=VAL3B, ALIAS=VAL3B, USAGE=A4, ACTUAL=A4, $ FIELD=VAL3C, ALIAS=VAL3C, USAGE=A9, ACTUAL=A9, $ FIELD=VAL3D, ALIAS=VAL3B, USAGE=P6.2, ACUTAL=A6, $
Tip: To edit the Master File, click the synonym and choose either Edit as Text to open a text editor or Open to open a graphical viewing/editing tool.
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 clipboard. |
Delete |
Deletes the synonym. You are asked to confirm this selection before the synonym is deleted. |
Cut |
Deletes the synonym and places it in clipboard. |
Properties |
Displays the properties of the synonym, including physical location, last modified date, description, and privileges. |
Keyword |
Description |
---|---|
UCI |
User Class Identifier for the location of the global data structure. |
SEGNAM |
Corresponds to the number of segments with data values in a synonym created with default subscript names in the Master File. If a synonym template is create the number of segments is 25. |
VOLUME SET |
Volume set name where the global data structures reside. |
GLOBAL |
Is a table name. |
WRITE |
Specifies whether write operations are allowed against the table. |
All data in DSM Mumps is represented as alphanumeric. The format of the data can be changed manually in the USAGE attribute of the Master File. For example, see the VAL3D field in the previous example.
Mumps dates are represented as the number of days that have elapsed since Jan 1841, or its equivalent, Dec 31, 1840. (Mumps does not use Julian date format.)
There are two ways to convert Mumps dates:
-SET &BASEOFF = 'DEC 31 1900' - 'DEC 31 1840';<= 21914 is the number of elapsed days between the noted dates; it is stored in the variable &BASEOFF DEFINE FILE CAR BASEDATE/YYMD = 0 - &BASEOFF; XDATE/YYMD = 59823 - &BASEOFF; <= 59823 is the Mumps date for october 15, 2004 END TABLE FILE CAR PRINT COUNTRY BASEDATE XDATE END
Field=birthday Usage=A5 , Actual=A5,$
Field=birthday Usage=I5, Actual=A5,$ <=redefine the field using
a DEFINE command
DEFINE birth/YYMD = birthday - 21914
iWay Software |