How to: |
Reference: |
The Synonym Editor enables you to view and edit the attributes of a synonym.
To view and edit synonym attributes:
The Synonym Editor opens to the Field View tab, which shows a hierarchy of segments and columns on the left, with the attributes and values of the selected item on the right.
The attributes available depend on the type of synonym.
The image below is an example of an SQL data source with a key column selected.
The values for Usage Format, Expression, Description, and Nulls are viewable in the hierarchy with the columns. To edit these values, use the corresponding attribute fields in the Properties pane on the right-hand side of the Synonym Editor.
The Synonym Editor does not let you make any changes that would render the synonym unusable. Therefore, you cannot edit any value field that is highlighted gray. In addition, if a change does not have proper syntax or format applied, the field may appear in red text. Messages and warnings appear if you try to save a file that contains an error.
Note: You can multi-select fields to change attributes for multiple fields in a single operation. The display changes to show only those attributes that can be changed.
Note: If you close the Synonym Editor without saving your changes, you are prompted to do so.
The image below is an example of an SQL data source with the synonym file name selected.
Synonyms can have the following file attributes:
Identifies the type of synonym or data source.
The name of the foxexec that will be executed before the request containing MFD.
Defines the default century value, specifying a century number for handling cross-century dates.
Note: Use the default setting (0) unless you wish to retrieve data from a earlier century (for example, 19xx).
Defines the base years, to represent the lowest year to which the century value applies (FDEFCENT).
Note: Use the default setting (0) unless you wish to retrieve data from a earlier century (for example, 19xx).
Enables you to include descriptive information at the file level and specify multiple language descriptions for the synonym. Remarks are displayed along with the file name during reporting.
Identifies the location of the data source to be used in the file name, including the extension and the location of the data file. This option is only available for file data sources, such as flat files or XML and JSON documents.
Controls the base file DB info inheritance in a cluster.
Controls the Business View run-time resolution strategy.
If a synonym segment is selected, the attributes listed below are available.
Note:
Is the name of the segment.
Specifies the type of relationship that a segment has to its parent, and indicates which of the segment fields are key fields and in what order they are sorted.
Type. Identify the segment type and sorting options from the Type drop-down list.
KEY. Enter the names of key fields that you want to use for sorting. For example, no two employees can have the same employee ID number, so you can use that field as the key. A segment instance can have more than one field that makes up the key. That is, two or more field values may be used to distinguish records.
SEGSUF is used when part of the data source being described by the synonym is of a different data source type than that declared for the entire structure. This option is not available for the first segment in a synonym.
Note: SEGSUF is the data source type of a segment and any descendants it might have, where that type differs from the SUFFIX value.
Contains a description or comments about the segment.
Is the name of the cross-referenced data source.
Is the name of the cross-referenced segment.
Identifies the common join field for the cross-referenced segment.
Note: These cross-referenced values (CRFilename, CRSegname, CRKey) are available for FOCUS data sources.
An optional attribute that enables you to provide the title prefix for the segment fields that appear in reports. You can split the text across up to five separate title lines by separating the lines with a comma.
Adapter specific fields are shown if an Access File component has been generated with the synonym.
Defines how many members of a dimension can be retrieved for a report.
Identifies the table or view. It may contain the owner ID, as well as the table name. For some synonyms, it must also contain the data source name. This value may be a variable.
Indicates the host server or data source for synonyms. This value may be a variable.
Identifies the names of the columns that constitute the primary key.
Identifies the logical sort sequence of data by the primary key.
Specifies whether write operations are allowed against the table.
Identifies the storage area in which the table resides.
Specifies the type of table persistence and related table properties. This is optional for database management systems that support volatile tables, and required otherwise.
If a column or field in a synonym is selected, the attributes listed below are available.
Is the name of the column.
Supplies a title to replace the column name that is normally used in reports and enables you to specify multiple language titles for the column or field.
Describes the data type and format for the column for usage or display.
Note: Additional attributes, DEFCENT and YRTHRESH, are available if the Usage field is set to Date, Time, or DateTime (Timestamp) format. Use these attributes to enter the century and year threshold values for the column or field.
Assigns an alternative name for a column, or the real column name for a DBMS synonym.
For file data sources, a special reserved ALIAS of INSTANCE means the associated FIELD will show the name of the file when it is read.
When a FIELDNAME of RECTYPE is used, the ALIAS contains the value that identifies the record type.
Indicates whether the field is part of the primary key for the table.
Describes the type and length of data as it is actually stored in the data source.
Controls how null data is handled, that is, if no transaction value is supplied. This option is not available for KEY fields.
Contains a description or comments about the column or field.
Specifies criteria for validating data.
FIND is only available for FOCUS data sources and does not apply to OLAP-enabled synonyms. Also note that, in the Maintain environment, FIND is not supported when developing a synonym.
Contains the name of a field to be included in a dimension.
Describes which hierarchy property the column represents.
Points to the field that is the unique identifier for the hierarchy.
Specifies access options for the column data.
Appends a help message to a column.
This attribute is not used by WebFOCUS.
Sets slowly changing dimension attributes. This option is only available for existing relational targets and is only used by a flow when SCD is enabled in the target object.
A surrogate key is the KEY column in the table and has an SCD type of blank. Other columns with a blank SCD type have no SCD processing done to them. In a synonym, this column will always appear first, even if it is not the first column in the table.
Note: The surrogate key must be an integer. If the column is identified in the synonym as read-only and uses AUTOINCREMENT, then the database native processing is used to assign surrogate key values. If it is not so identified, then DataMigrator processing assigns values for this column, incrementing for each new row added.
The data type must be either a Date format or a Date and Time format, however, the formats of the two fields must be identical.
Begin/End Date values for Slowly Changing Dimensions can also be Datetime or Timestamp values.
Indicates that a record is active.
Indicates that a record is inactive.
Inserts virtual fields in the Master File to show how selected totals progressed through a time period for specified intervals.
Are the styles (for example, font and color) to apply to the field.
The attributes available depend on the type of synonym.
Adapter Specific
Indicates that the field is automatically incremented by the relational database when rows are inserted. This option is only available for selected relational databases. When selected, the field must also be identified with a field type of read-only.
The following attributes are only used if AUTOINCREMENT is checked.
You can assign SCD (Slowly Changing Dimension) Types column attributes from a single dialog box in the Synonym Editor. This operation is performed on the segment level from the Field View, Segment View, or Modeling View.
The Assign SCD columns dialog box opens.
If the validation passes, the synonym can be used as a target synonym in a Data Flow with the Load Type Property set to Slowly Changing Dimensions.
If the validation does not pass, the segment name appears in red. To view the explanation of the error, right-click the segment name and click Error Details, as shown in the following image.
The image below is an example of a flat file data source with DATA_ORIGIN of LISTENER.
A flat file data source may have the following attributes:
The name of a connection for a flat file source that identifies an FTP or SFTP server. This field is optional. If not specified, the file resides locally.
Indicates the origin of data described by the synonym.
FILE. Indicates that a file (or collection of files if a wildcard is used in the dataset parameter) is read once. This is the default.
LISTENER. Indicates that files are read as they appear, as specified in the remainder of the File Collection Parameters.
TAIL. Is reserved for future use.
Defines the location of data files for polling. This can be an application directory, a mapped application name, or a directory location on your file system.
When using a directory on a file system for local files, the name of the physical directory can be used.
When using a directory on a file system for remote data files, a directory relative to the initial directory can be used. For example, if your remote initial directory is /home/user1/apps, using sales will set the data files directory location to /home/user1/apps/sales.
Indicates the name of the file. May include wildcard characters. The default is *.
Indicates the file type that the listener is checking. The default is .ftm.
The parameters below only apply to Origin of Listener.
Indicates the mechanism used to pick up files from their directories. The options are:
IMMEDIATE. Processes the file as soon as it is detected. This is the default.
TRIGGER. Processes the file when a trigger file is detected. This setting requires an additional setting for the trigger file extension.
A trigger is typically used when processing needs to be delayed. For example, when using FTP to copy files, if you wait until this secondary file appears while a large file is being copied into a directory, the trigger file indicates when processing can begin.
When a pickup strategy of trigger is used, indicates the trigger file extension. The trigger file extension is added to the full name of the file being listened for. For example, if the trigger file extension is .trg, the trigger file for a data file named input.dat would be input.dat.trg. There is no default value.
Note: For VMS only, use an underscore. For example, input_dat.trg.
MONITOR. Monitors the file as soon as a file change is detected.
The files themselves are not read, only their name and location are recorded. This processes files and sub-directories when they are added, changed, or deleted.
Indicates what to do with the file after it has been processed by a file agent. The options are:
DELETE. Deletes the file.
ARCHIVE. Moves the file, while adding a timestamp to the name, to a specified directory. This is the default.
ARCHIVE_LOCAL. Defines the location where the data files will be archived. This location can be an application directory, a mapped application name, or a directory on your local file system.
This option must be used only for a CONNECTION that is set with FTP or SFTP protocol.
This option allows archiving the files locally, where DataMigrator Server is running, while the listening directory is on a remote location.
KEEP. Keeps the file. This option is only available for the Trigger pickup type.
Defines the location where the data files will be archived when DISCARD strategy of ARCHIVE is used. This can be an application directory, a mapped application name, or a directory location on your file system.
When using a directory on a file system for local files, the name of the physical directory can be used.
When using a directory on a file system for remote data files, a directory relative to the initial directory can be used. For example, if your remote initial directory is /home/user1/apps, using sales will set the data files directory location to /home/user1/apps/sales.
Indicates the polling interval (in seconds) for new files arriving in the specified directory. For example, a polling interval of 10 means the directory is scanned every ten seconds for new files. The default is 10 seconds.
Indicates the timeout interval (in seconds) a flow or other read request should wait before terminating. For example, a timeout value of 100 means if no new files arrive in the directory after 100 seconds, the job should stop. The default is 10 seconds.
The maximum number of errors allowed.
The maximum number of files in the processing queue.
The sort order for files in the processing queue.
Indicates the maximum number of data files processed by the request. The default is 99999999.
Used only for the data origin of TAIL. Indicates the maximum number of records processed by the request. The default is 99999999.
Indicates a missing alpha value in the data source.
Indicates a missing numeric value in the data source.
Indicates a missing date/time/timestamp value in the data source.
How to: |
The File Listener can be used to process flat files as they appear in a specified directory. It's also possible to use it with Excel files with some additional preparation. These instructions describe the additional steps required to use an Excel worksheet as a source.
Use of the File Listener is documented in the DataMigrator User's Guide. For a complete example of using the File Listener see the section "Loading a Target Table Using the File Listener." For further explanation of the attributes described see the reference for "File Listener Attributes."
A new synonym opens in the workspace.
If the Properties panel is not visible, right-click the synonym name (for example baseapp/synonym01) and click Properties.
A new segment named SEG1 and a new field named FIELD1 are added. SEG1 is selected.
Expand the DBMS/Source Data Attributes section.
If you have a synonym for the Excel worksheet already in place, follow this procedure.
The Insert Reference to Existing Synonym as Child dialog box opens.
The reference to the synonym is added and the segment name is selected.
Now you can use the synonym you created as a source in a Data Flow or a Direct Load Flow.
A prototype synonym is provided as filemntr.mas for a user with the File Listener pickup strategy Monitor. To create this synonym, first follow the instructions outlined in How to Create Sample Procedures and Data for File Listener. Then, copy it to an application directory in your application path and edit the File Listener parameters as needed. At a minimum, edit the value for DIRECTORY to point to the application directory (or mapped application name) that you want to monitor. Edit the NAME and EXTENSION values to show the file name (or * for all names) and extensions that you want to monitor.
Note: These virtual fields can also be used with pickup strategy other than Monitor, except as noted.
This synonym contains fields with special values for the ALIAS, as described below.
The properties of the prototype synonym are shown in the following image.
WebFOCUS | |
Feedback |