To write
to an external file in a job, add a File Writer transformation to
the job. Then, specify a SAS or DBMS table as the input and an external
file as the output, as shown in the next display.
The File
Writer transformation reads information from a SAS or DBMS table and
writes the output to an external file. The input to a File Writer
transformation could be the output of a previous transformation in
the current job, or it could be output from another job. In this way,
the output of SAS Data Integration Studio jobs can be made available
to third-party applications that support external files.
Assume
that the SAS or DBMS table input to the File Writer transformation
is already registered, and that the external file output is a new
file, one that is created when the job that includes the File Writer
executes for this first time. Perform the following steps to specify
an external file as the output of the File Writer transformation.
-
-
-
Select
and drag a File Writer transformation from the Access folder of the
Transformations tree. Then, drop it in the empty job on the
Diagram tab in the
Job Editor window.
-
Select
and drag a SAS or DBMS input table from the tree view. Then, drop
it before the File Writer transformation on the
Diagram tab.
-
Drag the
cursor from the input table to the input port of the File Writer transformation.
This action connects the input to the transformation.
-
Select
and drag the external file output from the tree view. Then, drop it
after the File Writer transformation on the
Diagram tab.
-
Drag the
cursor from the output port of the File Writer transformation to the
external file. This action connects the output to the transformation.
At this point, the process flow should look similar to the preceding
process flow diagram.
The File
Writer transformation attempts to automatically map columns between
the input table and the output external file. You might want to verify
that the mappings are correct.
-
(Optional)
To verify the mappings in the File Writer transformation, right-click
the transformation in the job and select
Properties from the pop-up menu. The next display shows the
Mapping tab for the File Writer transformation.
Mapping Tab for File Writer Transformation
In the
preceding display, three columns from the input table (SAS Table)
are mapped to three identical columns in the output file (External
File 2). If the mappings are what you want, click
Cancel to close the properties window. To update the mappings, see
Maintaining Column Mappings.
-
When ready,
run the job and verify the results.