Examples

This section gives examples of input and output data from a Column Export stage.

This section gives examples of input and output data from a Column Export stage to give you a better idea of how the stage works.

In this example the Column Export stage extracts data from three input columns and outputs two of them in a single column of type string and passes the other through. The example assumes that the job is running sequentially. The column definitions for the input data set are as follows:
Table 1. Column definitions
Column name SQL type Length Scale
value Decimal 5 2
SN SmallInt 1  
code Char 4  

The following are the rows from the input data set:

Table 2. Input data set
value SN code
000.00 0 aaaa
001.00 1 bbbb
002.00 2 cccc
003.00 3 dddd
004.00 4 eeee
005.00 5 ffff
006.00 6 gggg
007.00 7 hhhh
008.00 8 iiii
009.00 9 jjjj
The import table definition is supplied on the Output Page Columns tab. For the example, the definition would be:
Table 3. Column definitions for output
Column name SQL type Length Scale
code Char 4  
exported_col Char    

You have to give InfoSphere® DataStage® information about how to delimit the exported data when it combines it into a single column. This is done on the Input page Format Tab. For this example, you specify a data format of text, a Field Delimiter of comma, and a Quote type of double.

Figure 1. Format tab
Shows the Format tab settings for the Column Export stage in the example job
.
The Properties of the Column Export stage are set as follows:
Figure 2. Properties tab
Shows the Properties tab settings for the Column Export stage in the example job

The output data set will be:

exported_co
code
("20 0 0 0.00" , "0")
aaaa
("20 0 0 1.00" , "1")
bbbb
("20 0 0 2.00" , "2")
cccc
("20 0 0 3.00" , "3")
dddd
("20 0 0 4.00" , "4")
eeee
("20 0 0 5.00" , "5")
ffff
("20 0 0 6.00" , "6")
gggg
("20 0 0 7.00" , "7")
hhhh
("20 0 0 8.00" , "8")
iiii
("20 0 0 9.00" , "9")
jjjj