Write Data to File

Data Migration can be used to create text files with information from database objects.

Contents

Write data from a single source

Create a new data migration job in Migration Job Maintenance and enter values for Job ID, Description, Procedure Name, View Name, Group ID (optional) and File Location. The columns in the file is either separated by a separator character or each column has a starting position and a length. If the file shall have columns separators enter Column Separator.

In File Configuration it is also possible to enter other characteristics such as Date Format, String Delimiter, Decimal Point, Thousands Separator and Minus Pos.

Valid values for Minus Pos is 0 - minus sign is placed after the value, 1 - minus sign is placed before the value (when the value is left padded) and 99999 - minus sign is placed before the value (when the value is right padded).

Value in Procedure Name must be CREATE_OUTPUT_FILE.

The Rules tab is populated automatically with rules that apply to the type of job created. Other rules may be added.

The File Mapping tab is automatically populated with column names from the view specified in View Name.

Only columns with a value greater then 0 in Pos will be written to the file. Columns that is not wanted in the file can be removed.

O start the job select Start Online on the context menu in the Execute Job window.

When File Location = OnClient the output will be loaded into the Detail tab.

Data can be written to a file with RMB function Export to File... in the Detail tab.

The Export to File... dialog will take default values from File Path and File Name in File Information in the Formatting tab. The Character Set value is not used when File Location = OnClient. The file will be created in the client character set.

A file can also be created in positional format. Leave the Column Separator field empty

and specify a left (Pad Char Left) and/or right (Pad Char Right) pad characters.

Write data from several sources

Data can be selected from several sources. Add sources in Source Name and add alias if necessary. Add join condition and other conditions in the Where column.

The File Mapping tab may have to be changed. Columns that exist in more than one source must have the Column Name prefixed with the source alias. Column Name can not be changed so a new line must be added and the old one removed (use F6 to duplicate a line).

The file header will contain the alias prefix on the column names.

This can be avoided by adding alias in Column Name.

SQL expressions may also be used in Column Name.

Write data to a server file

When File Location = OnServer File Path must be a valid directory object. The column has a List-Of-Value with valid directory objects.

The File Name can contain any of the keywords &DATF, &DATE, &TIME, &USER, &SEQN and/or &GUID. &DATF will be replace with a date in the format specified in Formatting tab - File Configuration - Date Format, &DATE will be replaced with a date in the format YYYYMMDD, &TIME will be replaced with time in the format HH24MISS, &USER with the Foundation1 user id, &SEQN with a sequence number and &GUID with a hexadecimal string.

If a Character Set is specified the file will be created in that character set, if a character set is not specified the file will be created in the database character set. The Character Set column has a List-Of-Value with valid character sets.

Write data and update a table