Instead of loading a target, you can also use DataMigrator to extract data from a data source and create input files for a packaged application that requires RECTYPEs indicating different record layouts.
DataMigrator can create a flat file containing the different record layouts. This requires a data flow that loads a sequential file with a previously defined layout. The synonym for the sequential file contains one segment for each RECTYPE, along with all the associated columns. The RECTYPE identifies the type of record in the ALIAS. Each segment has a unique value for RECTYPE.
The following example uses a single synonym with multiple segments to create a flat file containing two RECTYPEs. DMORD, an orders table, is the data source. Extracted records are loaded into one sequential file data target, DMORECS, which contains two segments.
The first segment contains the header information, indicated by a RECTYPE of 'H', and includes the columns ORDER_DATE, STORE_CODE, and PLANT.
The second segment contains the detail information, indicated by a RECTYPE of 'D', and includes the columns PROD_NUM, QUANTITY, and LINEPRICE.
The graphical view of the DMORECS synonym shows how the two segments are related. OINFO contains the header records; PINFO contains the detail records.
Refer to the sample data flow ORECS for the complete example.
In the DMC:
The Column Selection window opens.
The Properties dialog box opens.
The Transformation window opens.
The Transformations window opens, as shown in the following image.
Note that the RECTYPE columns remain unmapped. The RECTYPE values are assigned automatically at load time based on the value given for the RECTYPE in the synonym, in this case, H or D.
To view the output file created by the data, ensure that the No Filter button is selected in the Browser. Expand the baseapp directory and scroll down past the list of synonyms. There you will see a filename of dmorecs with a type of flat file. Double-click it to open it.
Note that the output file contains records with two different layouts.
iWay Software |