Managing Metadata for Flat and Delimited Flat Files

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.


Top of page

x
Creating Synonyms
x

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.


Top of page

x
Creating Synonyms for Flat Files

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.



x
Procedure: How to Create a Synonym for a Flat File

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.

  1. From the Web Console menu bar, click Applications, then New, and then Synonym

    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.

  2. Click a connection for the configured adapter (or double-click in the Data Management Console).

    The first of a series of synonym creation panes opens.

  3. Enter values for the parameters required by the adapter as described in the synonym creation parameters reference.
  4. After entering the parameter values, click Create Synonym.

    The Status pane indicates that the synonym was created successfully.

The synonym is created and added under the specified application directory.

Note:



x
Reference: Synonym Creation Parameters for Flat Files on Windows, UNIX, and IBM i IFS File Systems

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.

Cobol FD

Path to the directory containing multiple COBOL files.

Customize COBOL FD conversion options

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.

Select Data Files Allocation

Choose one of two options:

  • Single File defines a single data file. This option is not applicable for remote connections.
  • Collection of files defines a collection of data files to be described by one synonym.
Select Data Processing Mode

Indicates the data retrieval type.

  • One-time retrieval retrieves data once in order to create synonym for sequential file.
  • File Listener provides continued retrieval.

File Listener attributes

Listening directory polling interval for new files

Indicates how often the listener will check for the presence of a file in number of seconds. The default is 10 seconds.

Timeout interval in listening directory for new files

Indicates the timeout interval for the listener in number of seconds. The default is 10 seconds.

Maximum number of records processed in the request

Indicates the number of records processed within one request. This option is available for single file processing.

Maximum number of data files processed in the request

Indicates number of files processed within one request. This option is available for processing collection of files. The default is 99,999,999.

Data Files Pickup Strategy

Indicates the mechanism used by files agents to pick up files from their directories.

  • IMMEDIATE processes the file as soon as it is detected.
  • TRIGGER processes the file as soon as a trigger file is detected. This option requires an additional setting for the trigger file extension.

    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.

Trigger File Extension

Indicates the extension of the trigger file. The trigger file extension is added to the full name of the file being listened for.

Processed Data Files Discard Strategy

Indicates how the file is handled after it has been processed by a file agent.

  • DELETE deletes the file.
  • ARCHIVE copies the file with the timestamp to a specified directory defined in File Listener Archiving Directory option.
  • KEEP keeps the files.
File Listener Archiving Directory

Defines the full physical path to a directory where processed files will be archived.

Collection Definition attributes

Directory or Application

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.

Name

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.

Extension

Type an extension with or without the wildcard symbol %.

Synonym field names processing options

Validate

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.

Make unique

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.

Synonym Name

Indicates the name of the synonym.

Application

Select an application directory. The default value is baseapp.

Prefix/Suffix

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.

Overwrite Existing Synonyms

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

Codepage

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.



x
Reference: Synonym Creation Parameters for Flat Files on z/OS

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.

File System Selection

Choose one of the following options from the drop-down menu:

  • Fully qualified PDS name to indicate a partitioned data set on MVS.

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

  • Absolute HFS directory pathname to indicate a hierarchical file structure on USS.

    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

Validate

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.

Make unique

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.

Customize options

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.

Application

Select an application directory. The default value is baseapp.

Prefix/Suffix

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

Codepage

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.

Overwrite Existing Synonyms

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.

Default Synonym Name

This column displays the name that will be assigned to each synonym. To assign a different name, replace the displayed value.

Select files

Select files for which you wish to create synonyms:

  • To select all files in the list, click the Select All button.
  • To select specific files, select the corresponding check boxes.
Choose Data File Name

After choosing files, choose the corresponding data file name from the drop-down list.



x
Reference: Managing Synonyms

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.

Drop Table. Drops the table so that it is removed from the DBMS.

Insert Sample Data. Inserts specified number of sample records, populating all fields with counter values.

Show/Modify Data. Opens a window that shows the data in the data source with buttons you can click to insert values, filter values, reload the data source, and customize the view.

Reorganize. Recreates the data source table preserving original data.

Note: This option is not available in the Web Console.

Impact Analysis

Generates a report showing where this synonym is stored and used, with links to the synonym instances. Impact Analysis reports enable you to evaluate changes before they are made by showing which components will be affected. See the Server Administration manual for details about Impact Analysis reports.

Dependencies Analysis

Generates a report showing information about the synonym and other synonyms and objects that are referenced within it.

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.

Privileges

Shows the security subjects on the server and the privileges they have to this synonym.

Properties

Displays the properties of the synonym, including physical location, last modified date, description, and privileges.



x
Creating Synonyms for Delimited Flat Files

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:



x
Procedure: How to Create a Synonym for a Delimited Flat File

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.

  1. From the Web Console menu bar, click Applications, then New, and then Synonym

    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.

  2. Enter values for the parameters required by the adapter as described in the synonym creation parameters reference.
  3. After entering the parameter values, click Create Synonym.

    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.



x
Reference: Synonym Creation Parameters for Delimited Flat Files

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.

Create Multiple Synonyms

Select this check box for Multiple Synonyms.

Data Files location

Is the path to multiple data files.

File location

Defines the location of the data file.

From the drop-down menu select:

  • Server side.
  • Local machine.
Data File

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.

Upload file

Click the ellipsis (...) to select the data file to be uploaded.

Select Data Files Allocation

Select:

  • Single File to define a single data file. This option is not applicable for remote connections.
  • Collection of files to define a collection of data files to be described by one synonym.
Select Data Processing Mode

Indicates the data retrieval type:

  • One-time retrieval retrieves data once, in order to create a synonym for a sequential file.
  • File Listener provides continual retrieval.

Record Specification

Record Delimiter

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.

Non-printable Record Delimiter

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

Delimiter

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.

Non-printable Delimiter

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.

Header

Select this check box to request that names in the header line be used as column names in the synonym.

Enclosure

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.

Record Scan Limit

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.

Preserve format

Indicates whether the original data layout, including empty records and linefeeds, will be preserved.

  • No. The original characters will be replaced by a printable string. This is the default.
  • Yes. The original characters, including non-printable characters and linefeeds, will be preserved.

This attribute is reflected in the Access File as PRESERVEFRMT.

File Listener

Listening directory polling interval for new files

Indicates how often the listener will check for the presence of a file in number of seconds. The default is 10 seconds.

Timeout interval in listening directory for new files

Indicates the timeout interval for the listener in number of seconds. The default is 10 seconds.

Maximum number of data files processed in the request

Indicates number of files processed within one request. The default is 99,999,999.

Data Files Pickup Strategy

Indicates the mechanism used by files agents to pick up files from their directories.

  • IMMEDIATE processes the file as soon as it is detected.
  • TRIGGER processes the file as soon as a trigger file is detected. This option requires an additional setting for the trigger file extension.

    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.

Trigger File Extension

Indicates the extension of the trigger file. The trigger file extension is added to the full name of the file being listened for.

Processed Data Files Discard Strategy

Indicates how the file is handled after it has been processed by a file agent.

  • DELETE deletes the file.
  • ARCHIVE copies the file with the timestamp to a specified directory defined in File Listener Archiving Directory option.
  • KEEP keeps the files.
File Listener Archiving Directory

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

Directory or Application

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

Name

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.

Extension

Type an extension with or without the wildcard symbol %.

Synonym field names processing options

Application

Select an application directory. The default value is baseapp.

Prefix/Suffix

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.

Overwrite Existing Synonyms

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.

Default Synonym Name

This column displays the name that will be assigned to each synonym. To assign a different name, replace the displayed value.

Select files

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

Codepage

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.



Example: Sample DFIX Data File and Generated Synonym

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:

  1. In the Directory path field, enter the directory name containing the delimited flat file.
  2. Enter the file name (for example, dfix_car).
  3. Enter the file extension field (for example, .dat.)
  4. Click Select Files.
  5. On the second Create Synonym pane, select a file from the list of displayed data files and specify comma, as the separator, in the Delimiter field.
  6. Click Create Synonym. The synonym is created and added under the specified application directory (baseapp is the default).

    A status window displays the message: All Synonyms Created Successfully

  7. From the message window, click Applications on the menu bar.
  8. Open the baseapp application folder in the navigation pane and click the synonym--in this example, dfix_car.
  9. Choose Edit as Text from the menu to view the generated Master File, then choose Edit Access File as Text to view the corresponding Access File.

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.



Example: Sample DFIX Data File With Header and Enclosure

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, $


x
Reference: Usage and Actual Formats for Delimiters

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



x
Reference: Updating Delimited Flat Files

You can update Delimited Flat files using the MODIFY facility. The following delimiter characters are respected:

TAB

A tab character. This is the default.

a

A character string, for example ~.

0xnn

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.


WebFOCUS