Posted: Fri Oct 08, 2004 12:43 pm
You can do the same thing in DataStage, but I don't know if it will be any faster:
1) Create a new server job.
2) Add a transformer and a sequential file stage.
3) Create an output link from the transformer to the sequential file stage.
4) Create a new stage variable in the transformer stage. Call it InitCount, with an initial value of 0.
5) In the derivation of the stage variable put : InitCount + 1
6) Create an output column in the output link.
7) In the derivation for the output column put the Stage Variable name: InitCount.
8) In the constraint for the output link put : InitCount < 10001
(where 10000 is the number of rows that you want in the output file.)
9) fill in the information for the sequential file : name, format, etc.
10) Compile and run.
You could probably create a Job parameter and use it in the constraint so that you could specify how many rows you want to output. (Yep, you can I tested it. Create Job Parameter RowCount and set it to 10001. Change the constraint to InitCount < RowCount.)
I know that this looks odd, because the transformer doesn't have any input links, but it should work. Works nicely in v7.1, anyway.
Good Luck,
Tony
1) Create a new server job.
2) Add a transformer and a sequential file stage.
3) Create an output link from the transformer to the sequential file stage.
4) Create a new stage variable in the transformer stage. Call it InitCount, with an initial value of 0.
5) In the derivation of the stage variable put : InitCount + 1
6) Create an output column in the output link.
7) In the derivation for the output column put the Stage Variable name: InitCount.
8) In the constraint for the output link put : InitCount < 10001
(where 10000 is the number of rows that you want in the output file.)
9) fill in the information for the sequential file : name, format, etc.
10) Compile and run.
You could probably create a Job parameter and use it in the constraint so that you could specify how many rows you want to output. (Yep, you can I tested it. Create Job Parameter RowCount and set it to 10001. Change the constraint to InitCount < RowCount.)
I know that this looks odd, because the transformer doesn't have any input links, but it should work. Works nicely in v7.1, anyway.
Good Luck,
Tony