The copy stage in DataStage allows you to drop, rename or change the order of input columns. It could propagate records of input data set to any number of output links.This ability lets the developer perform backup and processing in the same job parallelly.
Let us assume there are six columns in source input data set, and we want first 3 column in dataset_1 and last three columns in dataset_2 and all the columns in the dataset_3.
Columns in input file
- Drag and Drop the four dataset stages and link them as defined in this post (click here for creating dataset tutorial here ).
- Go to properties of Copy stage and go to output tab and click on Mapping tab
- Select the output link as dslink 6
- Now map the first three columns
- Similarly select the output link as dslink7 and map the last columns
- Finally, choose the output link dslink8 and map all the columns to target.
- Now compile the job and run the job.
The force option in Copy Stage tells the DataStage whether to optimize job automatically by preventing copy operation if there is one input and output link.
By default, it is set to false.
Note: The data type of columns can be changed by changing the type on the output links
Related: Example including change of data type