How to achieve this output?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
georgesebastian
Participant
Posts: 83
Joined: Tue Dec 19, 2006 8:38 am

How to achieve this output?

Post by georgesebastian »

Hi everyone,

I have a scenario
The input seq file is having 1000 rows

I have 3 output files.I need the output like ...

1st output file should contain (input file rows) 1-10,31-40,61-70 etc
2nd output file should contain (input file rows) 11-20,41-50,71-80 etc
3rd output file should contain (input file rows) 21-30,51-60,81-90 etc

Can we achieve this?

Thanks
George
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

Transformer with input link and 3 output links for your 3 files.

Stage Variables as follows

svCounter = If svCounter = 10 Then 1 Else svCounter + 1 (set the default value to 1)

svActiveLink = If svCounter = 1 and svActiveLink = 3 Then 1 Else If svCounter = 1 Then svActiveLink + 1 Else svActiveLink

Add contraints to the three links like

Link1 - svActiveLink =1
Link2 - svActiveLink =2
Link3 - svActiveLink =3
Regards,

Nick.
Post Reply