Recognizing External File Layout
By default, USoft Batch allows you to specify how import records should be read. The external set used for the import task describes how external records are interpreted. This determines how USoft Batch recognizes fields within an import record.
Import tasks that recognize record structure automatically filter out any unwanted lines in external files, even if these are different because they are produced by different (versions of) external programs.
How to write an import task that recognizes external file layout:
Suppose that an external file contains the following lines. The import records can be recognized because they start with the letter C:
Athis is a starter record
Bthis is another type of header record
C31121996this is a true import record, containing a date value
C14051997this is another import record
Dthis is a closing record
You can import this correctly by defining an external set that looks like:
1 record_type string(1)
2 day_date string(8)
Note that the date in the C-records is read as a string, not as a date.
The import SQL statement should look something like the following, where the example of the TO_DATE Oracle-specific function is used:
INSERT INTO <app_table>
SELECT [...,] TO_DATE(day_date_string), [...]
FROM <import task set>
WHERE recordtype = 'C'