Sequential File Stage ExampleThe Sequential File stage is a file stage that allows you to read data from or write data one or more flat files. The stage can have a single input link or a single output link, and a single rejects link.
Example:In below example, we are going to read Employee data from a sequential file which includes loading of table definition of ‘Employee’ table to the sequential file stage and viewing data from the stage. Follow below steps: Select the Sequential File stage from Palette under File option. Drag and drop the sequential file stage on the Designer work canvas and design the job as shown below:
Open the Properties tab of Sequential file. Select Sequential File stageàRight Clickàselect Properties. And load the Table Definition.
Under Properties Tab, provide the path and file name for the file needs to be read as shown below.
Under Optionsà set ‘First Line is Column Names’ to true if first line of the file is having column names without fail, else can expect an error thrown by Datastage while reading the file.
Under Format Tab, select the Delimiter if needed.
Under Columns Tab, Select the Table definition by Click on Load button situated at the right corner as shown below. Select the Table definition from the Repository.
Select the Columns that need to be added as shown below.
The columns selected will appear as below:
We can validate the table definition and view the data from the Sequential file stage.
Click on ‘View Data’ button located at right upper corneràSelect the no. of records needs to be readà Click OK.
Data will appear as shown below.