Viewing and Editing Synonym Attributes

How to:

Reference:

The Synonym Editor enables you to view and edit the attributes of a synonym.

Procedure: How to View and Edit Synonym Attributes

To view and edit synonym attributes:

  1. Double-click a synonym, or right-click it and click Open.

    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.

    Field View Tab

    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.

  2. You can change the attribute values by typing in new values or by using the drop-down menus and check boxes.

    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.

  3. Save changes by clicking Save from the Quick Access Toolbar.

    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.

  4. Close the Synonym Editor by clicking the X.

Note: If you close the Synonym Editor without saving your changes, you are prompted to do so.

Reference: File Attributes Summary

The image below is an example of an SQL data source with the synonym file name selected.

File Attributes Summary
Note:
  • Information about the attribute that has focus is displayed at the bottom of the attribute list.
  • The attributes available depend on the type of synonym.

Synonyms can have the following file attributes:

General
SUFFIX

Identifies the type of synonym or data source.

MFD_PROFILE

The name of the foxexec that will be executed before the request containing MFD.

FDEFCENT

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).

FYRTHRESH

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).

REMARKS

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.

DATASET

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.

DV_INCLUDE

Controls the base file DB info inheritance in a cluster.

BV_NAMESPACE

Controls the Business View run-time resolution strategy.

Reference: Segment Attributes Summary

If a synonym segment is selected, the attributes listed below are available.

Note:

  • Information about the attribute that has focus is displayed at the bottom of the attribute list.
  • The attributes available depend on the type of synonym.
General
SEGMENT

Is the name of the segment.

SEGTYPE

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

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.

Miscellaneous
DESCRIPTION

Contains a description or comments about the segment.

CRFILENAME

Is the name of the cross-referenced data source.

CRSEGNAME

Is the name of the cross-referenced segment.

CRKEY

Identifies the common join field for the cross-referenced segment.

Note: These cross-referenced values (CRFilename, CRSegname, CRKey) are available for FOCUS data sources.

SEG_TITLE_PREFIX

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

Adapter specific fields are shown if an Access File component has been generated with the synonym.

CARDINALITY

Defines how many members of a dimension can be retrieved for a report.

TABLENAME

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.

CONNECTION

Indicates the host server or data source for synonyms. This value may be a variable.

KEY

Identifies the names of the columns that constitute the primary key.

KEYORDER

Identifies the logical sort sequence of data by the primary key.

WRITE

Specifies whether write operations are allowed against the table.

DBSPACE

Identifies the storage area in which the table resides.

PERSISTENCE

Specifies the type of table persistence and related table properties. This is optional for database management systems that support volatile tables, and required otherwise.

Reference: Column/Field Attribute Summary

If a column or field in a synonym is selected, the attributes listed below are available.

Note:
  • Information about the attribute that has focus is displayed at the bottom of the attribute list.
  • The attributes available depend on the type of synonym.
General
FIELDNAME

Is the name of the column.

TITLE

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.

Usage Format

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.

ALIAS

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.

Key Component

Indicates whether the field is part of the primary key for the table.

ACTUAL

Describes the type and length of data as it is actually stored in the data source.

MISSING

Controls how null data is handled, that is, if no transaction value is supplied. This option is not available for KEY fields.

Miscellaneous
DESCRIPTION

Contains a description or comments about the column or field.

ACCEPT

Specifies criteria for validating data.

  • OR enables you to specify an acceptable value.
  • SYNONYM enables you to specify a synonym as the source of the accept list.
  • FOCEXEC enables you to specify a FOCEXEC as the source of the accept list.
  • FROM-TO enables you to specify a range of acceptable value fields.
  • FIND enables you to supply file and field names to instruct where to search for a data source and for a list of acceptable values. You supply the field name of the data field for which the validation criteria are being assigned, the file name of the target FOCUS data source where the field can be found, and the field name of the target data field that contains the validation criteria.

    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.

WITHIN

Contains the name of a field to be included in a dimension.

PROPERTY

Describes which hierarchy property the column represents.

REFERENCE

Points to the field that is the unique identifier for the hierarchy.

FIELDTYPE
  • I - Index identifies an indexed column in a FOCUS database.
  • R - Read only indicates a read-only column. This setting is useful for columns that are automatically assigned a value by the RDBMS.
ACCESS_PROPERTY

Specifies access options for the column data.

  • INTERNAL defines a column that does not appear in sample data or in the list of available columns. This restricts the field from showing in any of the field lists in the reporting tools.
  • NEED_VALUE defines a column that requires a value to access the data.
  • Select By defines a column by value, range, or multi-values.
HELPMESSAGE

Appends a help message to a column.

This attribute is not used by WebFOCUS.

SCD Type

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.

  • Logical Key Field. Is the source database key. Multiple columns may comprise the key.
  • Begin Date/End Date for Type II changes. Indicates date range for the row values. A null end date indicates the row is current. If you use Begin and End Date, the End Date column must be created as nullable, unless you override the default End Date value of NULL with a value for &&CM__SCDAEDATE.

    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.

  • Change Flag. For Type I changes, a value is assigned when a row is updated. If a value is not assigned in Target Transformations for the Date and Datetime columns, the current date or timestamp is assigned automatically.
  • Activation Flag. Indicates if the row is current.
    This field must be an integer. Valid values are:
    1

    Indicates that a record is active.

    0

    Indicates that a record is inactive.

  • Type I (overwriting history) designates columns whose database values are overwritten with new values.
  • Type II (preserving history) designates columns whose database rows are flagged as inactive or assigned an end date. New rows are inserted with the new values.
  • blank (non-key permanent columns) indicates that database values are not changed.
TEMPORAL_PROPERTY

Inserts virtual fields in the Master File to show how selected totals progressed through a time period for specified intervals.

USE_STYLE

Are the styles (for example, font and color) to apply to the field.

The attributes available depend on the type of synonym.

Adapter Specific

AUTOINCREMENT

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.

  • START. Indicates the starting value for this AUTOINCREMENT field. If not specified, 1 is used.
  • INCREMENT. Indicates the increment value for this field. If not specified, 1 is used.
  • SEQUENCE. Is the name of the corresponding database SEQUENCE object for this field. This option is only available for ORACLE tables.

Procedure: How to Assign SCD Columns on a Synonym

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.

  1. In the Synonym Editor, right-click the segment name and click Assign SCD Columns from the shortcut menu, as shown in the following image.
    Assign SCD Columns

    The Assign SCD columns dialog box opens.

  2. To assign the SCD Type to a column, click the column in the Available Field(s) section and the SCD type in the Selected SCD Type(s) section, followed by the right arrow. You can also drag the column from the left to the desired SCD Type on the right. An example of assigning SCD types to a column is shown in the following image.
  3. Click Validate to confirm that all SCD Types are assigned to the synonym columns correctly.

    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.

    Error Details option

Reference: File Listener Attributes

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:

Data Allocation
CONNECTION

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.

DATA_ORIGIN

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.

DIRECTORY

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.

NAME

Indicates the name of the file. May include wildcard characters. The default is *.

EXTENSION

Indicates the file type that the listener is checking. The default is .ftm.

The parameters below only apply to Origin of Listener.

Pre Processing Actions
PICKUP

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.

Post Processing Actions
DISCARD

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.

ARCHIVE

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.

Listening Parameters
POLLING

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.

TIMEOUT

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.

MAXERRORS

The maximum number of errors allowed.

MAXQSIZE

The maximum number of files in the processing queue.

QSORT

The sort order for files in the processing queue.

Read Limits
MAXFILES

Indicates the maximum number of data files processed by the request. The default is 99999999.

MAXRECS

Used only for the data origin of TAIL. Indicates the maximum number of records processed by the request. The default is 99999999.

Adapter Specific
MISSVAL_CHAR

Indicates a missing alpha value in the data source.

MISSVAL_NUMB

Indicates a missing numeric value in the data source.

MISSVAL_DATE

Indicates a missing date/time/timestamp value in the data source.

Reference: File Listener for Use With Excel Sheets

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."

Reference: Create a Synonym for Use With the File Listener and Excel Files

  1. Right-click an application directory, point to New and click Synonym via Synonym Editor.

    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.

  2. From the SUFFIX drop-down menu, select Flat File.
  3. From the IOTYPE drop-down menu, select BINARY.
  4. Right-click the synonym name, point to Insert, and click Segment Manually.

    A new segment named SEG1 and a new field named FIELD1 are added. SEG1 is selected.

  5. In the Properties panel, from the Type drop-down menu, select Multiple.
  6. From the DATA_ORIGIN drop-down menu, select LISTENER. Enter the following values:
    1. From the CONNECTION drop-down menu, select <local> or an [S]FTP server.
    2. In the DIRECTORY and NAME boxes, enter the location and name of the file(s) you want to listen for.
    3. In the EXTENSION box, enter xlsx.
    4. Enter values for PICKUP, DISCARD, POLLING, and TIMEOUT as required.
  7. In the workspace, click FIELD1. Enter the following values in the Properties pane:
    1. In the FIELDNAME box, enter FILENAME_FULL.
    2. In the Usage Format box, enter A512.

      Expand the DBMS/Source Data Attributes section.

    3. In the ALIAS box, enter INSTANCE_FULL.
    4. In the ACTUAL box, enter A512.

Reference: Add a Reference to an Existing Synonym for an Excel Worksheet

If you have a synonym for the Excel worksheet already in place, follow this procedure.

  1. Right-click the SEG1 segment, point to Insert, and click Reference to Existing Synonym as Child.

    The Insert Reference to Existing Synonym as Child dialog box opens.

  2. Click the synonym that describes the Excel worksheets that you want to use as a source and click Select.

    The reference to the synonym is added and the segment name is selected.

  3. In the Properties panel, from the POSITION drop-down menu, select INSTANCE_FULL.
  4. From the Quick Access toolbar click the save icon. Enter a name for the synonym and click Save.

Now you can use the synonym you created as a source in a Data Flow or a Direct Load Flow.

Reference: Prototype File Monitoring Synonym

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.

  • INSTANCE_FULL - The full path and name of the file. Cannot be used in conjunction with INSTANCE. Also available with IMMEDIATE.
  • INSTANCE_SIZE - The size of the file in bytes. Also available with IMMEDIATE.
  • INSTANCE_DATE - The date that the file was last modified. Also available with IMMEDIATE.
  • INSTANCE_TIME - The time that the file was last modified. Also available with IMMEDIATE.
  • INSTANCE_TYPE - The value File to indicate a file, or when DATA_ORIGIN is FILE, the value <DIR> to indicate a directory. This directory is only available with MONITOR. Otherwise, the value is always File.
  • INSTANCE_ACCS - The access mode for the file. Available on UNIX systems only.
  • INSTANCE_RDWR - Indicates if the file is READONLY. Available on UNIX systems only.
  • INSTANCE_USER - The user that owns the file. Available on UNIX systems only.
  • INSTANCE_GROUP - Group identification. Available on UNIX systems only.
  • INSTANCE_MONS - Monitoring status. Blank for the initial run, then ADDED, DELETED, MODIFIED, or RENAMED to reflect changes. Only available with MONITOR.

The properties of the prototype synonym are shown in the following image.

Synonym properties

WebFOCUS

Feedback