Information icon IBM InfoSphere DataStage and InfoSphere QualityStage, Version 8.5
space Feedback

Examples

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

In this example the Column Import stage extracts data from 16-byte raw data field into four integer output fields. The input data set also contains a column which is passed straight through the stage. The example assumes that the job is running sequentially. The metadata is as follows:
Table 1. Metadata
Column name Key SQL type
keycol Yes Char
col_to_import   Binary

These are the rows from the input data set:

Keycol
col_to_import
a
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
c
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
d
03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
e
04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
f
05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
g
06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
h
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
i
08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08
j
09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09
The import table definition can either be supplied on the Output Page Columns tab or in a schema file. For the example, the definition would be:
Table 2. Import table definition
Column name Key SQL type
keycol Yes Char
col1   Integer
col2   Integer
col3   Integer
col4   Integer

You have to give InfoSphere® DataStage® information about how to treat the imported data to split it into the required columns. This is done on the Output page Format Tab. For this example, you specify a data format of binary to ensure that the contents of col_to_import are interpreted as binary integers, and that the data has a field delimiter of none

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

The output data set will be:

Table 3. Output data set
col1 col2 col3 col4 key
0 0 0 0 a
16843009 16843009 16843009 16843009 b
33686018 33686018 33686018 33686018 c
50529027 50529027 50529027 50529027 d
67372036 67372036 67372036 67372036 e
84215045 84215045 84215045 84215045 f
101058054 101058054 101058054 101058054 g
117901063 117901063 117901063 117901063 h
134744072 134744072 134744072 134744072 i
151587081 151587081 151587081 151587081 j

PDFThis topic is also in the IBM InfoSphere DataStage and QualityStage Parallel Job Developer's Guide.

Update timestamp Last updated: 2012-10-8