Sequential processing of Files

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Sequential processing of Files

Post by pravin1581 »

Hi ,

I have a requirement where i need to process the files in the job sequentially. By sequentially I mean that there will be an output file which in turn will be the input to another file.

File-----> Transformer-----> File------->Transformer------> File

I am unable to attach the third file after the transformer . The second file is giving a error like the file (3rd) cannot be attached as it is not allowed due to the current setting or lack of the reject mode property. Some settings need to be changed. Please provide some solution.

Thanx in advance.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

The second file can only support a reject mode and not an input stream to your second transformer. What exactly are you trying to achieve. From your design and explanation it is clear that you are reading from a sequential file and writing to another which inturn is writing to another. Why do you need another link from your second file?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:The second file can only support a reject mode and not an input stream to your second transformer. What exactly are you trying to achieve. From your design and explanation it is clear that you are reading from a sequential file and writing to another which inturn is writing to another. Why do you need another link from your second file?
The reuirement is such that the 3rd file needs to be generated from the 2nd file in the same job or otherwise we have to design another job to generate the 3rd file which will increase the number of jobs tremendously.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

It wont let you do that. The sequential file stage supports only a reject link as the second link. What transformations are involved? Cant you do all in just one transformer stage?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:It wont let you do that. The sequential file stage supports only a reject link as the second link. What transformations are involved? Cant you do all in just one transformer stage?
Both the transformations are doing different thing, and the second transformation stage needs to work on the file produced after the first transformation. Can you suggest some other way to achieve it. This is a great bottleneck in parallel job as the same can be done very easily in server job . Please suggest some other alternative.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Please advise the different transformations you are doing. Maybe both can be incorporated into one and the same shall be advised. Help us to help you.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

Try using containers.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:Please advise the different transformations you are doing. Maybe both can be incorporated into one and the same shall be advised. Help us to help you.
The second transformation will work only on the second output file generated. The transformation is for hierarchy.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Two options:
1) Do it in a server job.
2) Do it in two seperate px jobs.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
prnath78
Charter Member
Charter Member
Posts: 3
Joined: Wed Aug 24, 2005 11:39 pm

Post by prnath78 »

how about this

File-----> Transformer-----> Copy--o/plink1----->Transformer------> File
--------------------------------Copy--o/plink2-----> File

Thanks & Regards,
Ranga
The greatest religion is to be true to your own nature. Have faith in yourselves!. ..swami vivekanandha
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Parallel jobs do not permit "passive" stages to have both input and output link (reject link is a special case).

You need two jobs, possibly run under control of a job sequence. It's the only way. Ranga's solution does not achieve the dependency of the third file upon the output from the second.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

ray.wurlod wrote:Parallel jobs do not permit "passive" stages to have both input and output link (reject link is a special case).

You need two jobs, possibly run under control of a job sequence. It's the only way. Ranga's solution does not achieve the dependency of the third file upon the output from the second.
Can I do it like this :

File(1)------> Transformer--------> File(2)

File(2))------> Transformer--------> File(3)

At least it reduces the number of jobs . Please suggest whether it is feasible.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

It wont work. Your job will either fail, or process zero records from file2 if the file is present. Both the streams will fire off simultaneously.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:It wont work. Your job will either fail, or process zero records from file2 if the file is present. Both the streams will fire off simultaneously.
Thats true , the second file is reading 0 rows . Can something be done with the link ordering so that the second link is triggered after the completion of the first link. If this fails then it would increase the number of jobs tremendously.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes.

You can put the second link into a second job.

Execute the two jobs consecutively from a job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply