In this section: |
When the server accesses a data source, it needs to know 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 Flat or Delimited Flat Files data types.
Synonyms define unique names (or aliases) for each Flat or Delimited Flat File that is accessible from the server. Synonyms are useful because they hide the underlying data source location and identity 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 allowing 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 that represents the server metadata.
How to: Reference: |
As defined in this chapter, a Flat file is a fixed-format sequential file in which each field occupies a predefined position in the record, with unoccupied positions filled by blanks to maintain the fixed structure.
To create a synonym, you must have previously configured the adapter. You can create a synonym from the Web Console or the Data Management Console.
or
From the Data Management Console, right-click an application directory, then select New, and then Synonym.
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.
Path to the directory containing multiple COBOL files.
Select Customize COBOL FD conversion options to customize how the COBOL FD is translated. If you do not select this check box, default translation settings are applied.
For more information, see Customization Options for COBOL File Descriptions.
Choose one of two options:
Indicates the data retrieval type.
File Listener attributes
Indicates how often the listener will check for the presence of a file in number of seconds. The default is 10 seconds.
Indicates the timeout interval for the listener in number of seconds. The default is 10 seconds.
Indicates the number of records processed within one request. This option is available for single file processing.
Indicates number of files processed within one request. This option is available for processing collection of files. The default is 99,999,999.
Indicates the mechanism used by files agents to pick up files from their directories.
Note: In OpenVMS, a dot (.) cannot be a part of a file name (that is, the file name prior to the extension). If the trigger file name for a listener includes a dot, the dot will be replaced with an underscore (_). For example, if a user enters file1.ext1.trig for the trigger file name, DataMigrator will replace it with file1_ext1.trig.
Indicates the extension of the trigger file. The trigger file extension is added to the full name of the file being listened for.
Indicates how the file is handled after it has been processed by a file agent.
Defines the full physical path to a directory where processed files will be archived.
Collection Definition attributes
Defines the location type of the data files. It can be the name of the physical directory for local files or a directory relative to the initial directory for remote data files. For example, if your remote initial directory is /home/user1/apps, using sales will set the data files location to /home1/user1/apps/sales.
Path to the directory containing multiple COBOL files.
File Selection Mask attributes
These attributes allow you to limit the list of data files.
Type a full name or a partial name with a wildcard symbol %. A full name returns just that entry. A name with a wildcard symbol may return many entries.
Type an extension with or without the wildcard symbol %.
Synonym field names processing options
Select the Validate check box if you wish to convert all special characters to underscores and perform a name check to prevent the use of reserved names. (This is accomplished by adding numbers to the names.) This parameter ensures that names adhere to specifications. See Validation for Special Characters and Reserved Words for more information.
When the Validate option is unchecked, only the following characters are converted to underscores: '-'; ' '; ' \'; '/'; ','; '$'. No checking is performed for names.
Select the Make unique check box if you wish to set the scope for field and group names to the entire synonym. This ensures that no duplicate names are used, even in different segments of the synonym. When this option is unchecked, the scope is the segment.
Indicates the name of the synonym.
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.
Extended data format attributes
This option provides data portability between servers by enabling processing of data loaded in different encoding systems.
Click the Extended data format attributes check box to display the Codepage option.
In the input box provided, enter the code page of the stored data. Your entry is added to the Master File of the generated synonym.
Note: The code page must have a customized conversion table as part of your NLS configuration. If you have not already requested a conversion table for the designated code page, you can do so now. On the Web Console menu bar, click Workspace, then Configuration, and choose NLS under General settings. The NLS Configuration Wizard opens. Click Customize code page conversion tables and select the check box for the code page you wish to use. Click the Save and Restart button to implement your new setting.
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.
Choose one of the following options from the drop-down menu:
In the input boxes provided, type a PDS name preceded by // and a Member name containing the location of the COBOL FD source. If you wish, you can filter the member name using a wildcard character (%).
In the input boxes provided, type a Directory name to specify the HFS location that contains the COBOL FD and a File name and File extension. If you wish, you can filter the file and extension using a wildcard character (%).
Synonym field name processing options
Select the Validate check box if you wish to convert all special characters to underscores and perform a name check to prevent the use of reserved names. (This is accomplished by adding numbers to the names.) This parameter ensures that names adhere to specifications. See Validation for Special Characters and Reserved Words for more information.
When the Validate option is unchecked, only the following characters are converted to underscores: '-'; ' '; ' \'; '/'; ','; '$'. No checking is performed for names.
Select the Make unique check box if you wish to set the scope for field and group names to the entire synonym. This ensures that no duplicate names are used, even in different segments of the synonym. When this option is unchecked, the scope is the segment.
Select Customize COBOL FD conversion options to customize how the COBOL FD is translated. If you do not select the check box, default translation settings are applied.
For more information, see Customization Options for COBOL File Descriptions.
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.
Extended data format attributes
This option provides data portability between servers by enabling processing of data loaded in different encoding systems.
Click the Extended data format attributes check box to display the Codepage option.
In the input box provided, enter the code page of the stored data. Your entry is added to the Master File of the generated synonym.
Note: The code page you specify here must be one for which you have requested a customized code page conversion table as part of your NLS configuration. If you have not already requested a conversion table for the designated code page, you can do so now. On the Web Console menu bar, click Workspace, then Configuration, and choose NLS under General settings. The NLS Configuration Wizard opens. Click Customize code page conversion tables and select the check box for the code page you wish to use. Click the Save and Restart button to implement your new setting.
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.
This column displays the name that will be assigned to each synonym. To assign a different name, replace the displayed value.
Select files for which you wish to create synonyms:
After choosing files, choose the corresponding data file name from the drop-down list.
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. |
How to: Reference: |
A delimited flat file is a sequential file in which fields are stored in a predefined sequence, separated (that is, delimited) by a special character or characters. (Although fields must maintain their predfined order in the file, and delimiters are required, blanks are not required to represent unoccupied positions.
The types of field delimiters are:
You can create different types of synonyms using the Adapter for Delimited Flat Files:
To create a synonym, you must have previously configured the adapter. You can create a synonym from the Web Console or the Data Management Console.
or
From the Data Management Console, right-click an application directory, then select New, and then Synonym.
The Select Data File for Delimited Flat File Synonym pane opens.
The Status pane indicates that the synonym was created successfully.
The synonym is created and added under the specified application directory.
Note: You can also create a synonym from the Adapters page by right-clicking a configured adapter connection and selecting Create Synonym.
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 Next button, ending with the Create Synonym button, which generates the synonym based on your entries.
Select this check box for Multiple Synonyms.
Is the path to multiple data files.
Defines the location of the data file.
From the drop-down menu select:
Defines an absolute path to the data file on the server or a directory relative to the initial one. It includes the name of the data file.
Enter the path and file name or click the ellipsis (...) to select the file.
Click the ellipsis (...) to select the data file to be uploaded.
Select:
Indicates the data retrieval type:
Record Specification
Defines a character or series of characters that indicate the separation between file records or data rows (for example, groups of delimited fields).
This attribute is reflected in the Access File as RDELIMITER.
Defines whether the string in the delimiter field is a printable string or a non-printable decimal character. Please note that a non-printable decimal character will appear (translated) in the Access file as a hexadecimal value. If the delimiter is entered as hexadecimal, set this attribute to No.
Field Specification
Defines a character or series of characters that indicate the separation between file fields.
To use multiple characters, enter them together. For example enter two slashes (//).
To use a tab character as a delimiter, enter the reserved word TAB.
Alternatively, you can enter hexidecimal values directly. For example, Linefeed and Carriage Return would be 0x0A and 0x0D, respectively.
If several characters form a separator, enter then as one string. For example, Linefeed and Carriage Return would be 0x0A0D.
Defines whether the string in the delimiter field is a printable string or a non-printable decimal character. Please note that the non-printable decimal character will appear (translated) in the Access file as a hexadecimal value.
If the delimiter is entered as a hexadecimal value, set this attribute to No.
If this attribute is set to Yes, then the values in the Delimiter attribute should be entered as decimals. For example, for non-printable separators such as Linefeed, use the decimal value of 10. If several non-printable characters form a separator, use a space between the decimal values. For example, to use Linefeed and Carriage Return together, enter 10 or 13.
Select this check box to request that names in the header line be used as column names in the synonym.
If character columns are enclosed in quotation marks or another symbol, enter an enclosure symbol for the character column format used in the delimited file(s) for which the synonyms are being generated. For example, for a file in which character columns are enclosed in double quotation marks, specify " in the Enclosure field.
Enter a value to indicate how many records from the DFIX data file to scan to determine the length of the columns.
If this parameter is omitted, all records from the file are processed to make this determination.
Indicates whether the original data layout, including empty records and linefeeds, will be preserved.
This attribute is reflected in the Access File as PRESERVEFRMT.
File Listener
Indicates how often the listener will check for the presence of a file in number of seconds. The default is 10 seconds.
Indicates the timeout interval for the listener in number of seconds. The default is 10 seconds.
Indicates number of files processed within one request. The default is 99,999,999.
Indicates the mechanism used by files agents to pick up files from their directories.
Note: In OpenVMS, a dot (.) cannot be a part of a file name (that is, the file name prior to the extension). If the trigger file name for a listener includes a dot, the dot will be replaced with an underscore (_). For example, if a user enters file1.ext1.trig for the trigger file name, DataMigrator will replace it with file1_ext1.trig.
Indicates the extension of the trigger file. The trigger file extension is added to the full name of the file being listened for.
Indicates how the file is handled after it has been processed by a file agent.
Archiving directory on the server where the data file will be archived. You can use an absolute path or a directory relative to the initial one.
Collection Definition
Defines the location type of the data files. It can be a physical directory for local files or a directory relative to the initial directory for remote data files. For example, if your remote initial directory is /home/user1/apps, using sales in collection definition will set the data files location to /home1/user1/apps/sales.
File Selection Mask
Type a full name or a partial name with a wildcard symbol %. A full name returns just that entry. A name with a wildcard symbol may return many entries.
Type an extension with or without the wildcard symbol %.
Synonym field names processing options
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.
This column displays the name that will be assigned to each synonym. To assign a different name, replace the displayed value.
Select the check boxes to left of Default Synonym Name to choose the files for which you want to create synonyms. The data files are highlighted when you choose the corresponding check boxes.
Click Select All Files to select all the data files in the directory path.
Extended data format attributes
This option provides data portability between servers by enabling processing of data loaded in different encoding systems.
Select the Extended data format attributes check box to display the Codepage option.
In the input box provided, enter the code page of the stored data. Your entry is added to the Master File of the generated synonym.
Note: The code page you specify here must be one for which you have requested a customized code page conversion table as part of your NLS configuration. If you have not already requested a conversion table for the designated code page, you can do so now. From the Web Console Workspace menu, select Configuration/Monitor. In the navigation pane, right-click NLS and select Configure. The NLS Configuration Wizard opens. Click Customize code page conversion tables and select the check box for the code page you wish to use. Click Save and Restart Server to implement your new setting.
This example is for a single synonym for a file on the serve.
DFIX data file (Comma-delimited):
ENGLAND,JAGUAR,V12XKE AUTO,CONVERTIBLE,2,7427,8878.0 ENGLAND,JAGUAR,XJ12L AUTO,SEDAN,5,11194,13491,12000 ENGLAND,JENSEN,INTERCEPTOR III,SEDAN,4,14940,17850,0 ENGLAND,TRIUMPH,TR7,HARDTOP,2,4292,5100,0 JAPAN,DATSUN,B210 2 DOOR AUTO,SEDAN,4,2626,3139,4300 JAPAN,TOYOTA,COROLLA 4 DOOR DIX AUTO,SEDAN,4,2886,3339,35030 ITALY,ALFA ROMEO,2000 4 DOOR BERLINA,SEDAN,4,4915,5925,4800 ITALY,ALFA ROMEO,2000 GT VELOCE,COUPE,2,5660,6820,12400 ITALY,ALFA ROMEO,2000 SPI,2,25000,31500,0,13000 ITALY,MASERATI,DORA 2 DOOR,COUPE,2,25000,31500,0 GERMANY,AUDI,100 LS 2 DOOR AUTO,SEDAN,5,5063,5970,7800 GERMANY,BMW,2002 2 DOOR,SEDAN,5,5800,5940,8950 GERMANY,BMW,2002 2 DOOR AUTO,SEDAN,4,6000,6355,8900 GERMANY,BMW,3.0 SI 4 DOOR,SEDAN,5,10000,13752,14000 GERMANY,BMW,3.0 SI 4 DOOR AUTO,SEDAN,5,11000,14123,1894 GERMANY,BMW,530I 4 DOOR,SEDAN,5,8300,9097,14000 GERMANY,BMW,530I 4 DOOR AUTO,SEDAN,5,8400,9495,1560 FRANCE,PEUGEOT,504 4 DOOR,SEDAN,5,4631,5610,0
To generate a synonym for the DFIX comma delimited data file, enter the following information on the Create Synonym panes of the Web Console or the Data Management Console:
A status window displays the message: All Synonyms Created Successfully
Generated Master File:
FILENAME=CAR_DFIX, SUFFIX=DFIX ,
DATASET=directory/car_dfix.dat, $
SEGMENT=CAR_DFIX, SEGTYPE=S0, $
FIELDNAME=FIELD_1, USAGE=A7, ACTUAL=A7BV, $
FIELDNAME=FIELD_2, USAGE=A10, ACTUAL=A10BV, $
FIELDNAME=FIELD_3, USAGE=A23, ACTUAL=A23BV, $
FIELDNAME=FIELD_4, USAGE=A11, ACTUAL=A11BV, $
FIELDNAME=FIELD_5, USAGE=I1, ACTUAL=A1, $
FIELDNAME=FIELD_6, USAGE=I5, ACTUAL=A5V, $
FIELDNAME=FIELD_7, USAGE=I5, ACTUAL=A5V, $
FIELDNAME=FIELD_8, USAGE=I5, ACTUAL=A5V, $
Note that the FILE declaration in the generated Master File includes the attribute:
SUFFIX=DFIX
Generated Access File:
SEGNAME=DFIX_CAR, DELIMITER=',', HEADER=NO,$
The delimiter consists of a single printable character.
This sample file contains a header line and uses the enclosure character ".
"COUNTRY","CAR","MODEL","BODYTYPE","SEATS","DEALER_COST","RETAIL_COST","SALES" "ENGLAND","JAGUAR","V12XKE AUTO","CONVERTIBLE",2,7427,8878,0 "ENGLAND","JAGUAR","XJ12L AUTO","SEDAN",5,11194,13491,12000 "ENGLAND","JENSEN","INTERCEPTOR III","SEDAN",4,14940,17850,0 "ENGLAND","TRIUMPH","TR7","HARDTOP",2,4292,5100,0 "FRANCE","PEUGEOT","504 4 DOOR","SEDAN",5,4631,5610,0 "ITALY","ALFA ROMEO","2000 4 DOOR BERLINA","SEDAN",4,4915,5925,4800 "ITALY","ALFA ROMEO","2000 GT VELOCE","COUPE",2,5660,6820,12400 "ITALY","ALFA ROMEO","2000 SPIDER VELOCE","ROADSTER",2,5660,6820,13000 "ITALY","MASERATI","DORA 2 DOOR","COUPE",2,25000,31500,0 "JAPAN","DATSUN","B210 2 DOOR AUTO","SEDAN",4,2626,3139,43000 "JAPAN","TOYOTA","COROLLA 4 DOOR DIX AUTO","SEDAN",4,2886,3339,3503 "GERMANY","AUDI","100 LS 2 DOOR AUTO","SEDAN",5,5063,5970,7800 "GERMANY","BMW","2002 2 DOOR","SEDAN",5,5800,5940,8950 "GERMANY","BMW","2002 2 DOOR AUTO","SEDAN",4,6000,6355,8900 "GERMANY","BMW","3.0 SI 4 DOOR","SEDAN",5,10000,13752,14000 "GERMANY","BMW","3.0 SI 4 DOOR AUTO","SEDAN",5,11000,14123,18940 "GERMANY","BMW","530I 4 DOOR","SEDAN",5,8300,9097,14000 "GERMANY","BMW","530I 4 DOOR AUTO","SEDAN",5,8400,9495,15600
On the Synonym Creation panes, specify the Delimiter character as comma (,), the Enclosure character as double quotation marks ("), and check the Header box to use the names in the header line as field names (columns) in the Master File.
Generated Master File:
FILENAME=CAR_CSV, SUFFIX=DFIX , DATASET=directory/car_csv.csv, $ SEGMENT=CAR_CSV, SEGTYPE=S0, $ FIELDNAME=COUNTRY, ALIAS=COUNTRY, USAGE=A7, ACTUAL=A7BV, $ FIELDNAME=CAR, ALIAS=CAR, USAGE=A10, ACTUAL=A10BV, $ FIELDNAME=MODEL, ALIAS=MODEL, USAGE=A23, ACTUAL=A23BV, $ FIELDNAME=BODYTYPE, ALIAS=BODYTYPE, USAGE=A11, ACTUAL=A11BV, $ FIELDNAME=SEATS, ALIAS=SEATS, USAGE=I1, ACTUAL=A1, $ FIELDNAME=DEALER_COST, ALIAS=DEALER_COST, USAGE=I5, ACTUAL=A5V, $ FIELDNAME=RETAIL_COST, ALIAS=RETAIL_COST, USAGE=I5, ACTUAL=A5V, $ FIELDNAME=SALES, ALIAS=SALES, USAGE=I5, ACTUAL=A5V, $
The Delimiter, Enclosure, and Header entries are reflected in the Access File.
Generated Access File:
SEGNAME=CAR_CSV, DELIMITER=',', ENCLOSURE=", HEADER=YES, $
Prior to Version 7 Release 6.1, server delimiter characters were identified by a field description in the Master File instead of by the DELIMITER parameter of the Access File.
Therefore, older synonyms may use this syntax with a FIELDNAME of DELIMITER, an ALIAS of the delimiter itself, and with USAGE and ACTUAL values as described in the following chart.
For example:
FIELDNAME=DELIMITER, ALIAS=',', USAGE=A1, ACTUAL=A1, $
USAGE and ACTUAL formats are determined as follows:
Type of delimiter |
USAGE |
ACTUAL |
---|---|---|
Printable characters |
An where n is the number of characters |
An where n is the number of characters |
Non-printable character such as Tab |
I4 |
I1 |
Group (combination of printable and non-printable characters, or multiple non-printable characters) |
Sum of the individual USAGE lengths |
Sum of the individual ACTUAL lengths |
You can update Delimited Flat files using the MODIFY facility. The following delimiter characters are respected:
A tab character. This is the default.
A character string, for example ~.
A hex code. For example, 0x44 (a comma), or 0x0D0A (a return and a linefeed). The hex code uses ASCII for WIndows or UNIX systems and EBCDIC for IBM Mainframes.
Delimited Flat files have been added as a target type for DataMigrator flows.
iWay Software |