to make the Transformer Wait for the file

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
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

to make the Transformer Wait for the file

Post by sshettar »

Well i have this job where in i need to make the transformer wait for the file that is written in the same same job .
the req i have is that i need the count of the records getting into the output file and at the same time i need to extract the input record count from the input file and load both of these info into a single Oracle table .all these are done from the transfprmer stage.
the problem i'm facing is that the transformer is extraxting the input record count real quick ie much bofore all the records are loaded into the output file . so i'm not getting the right output count as the transformer loads the input count and the output count as per the number of records passed at that instant ,into the oracle table the moment it completes getting the input count .
Can somebody help me with this issue ?

Thanks
Shalini
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

I don't think you could achieve your requirement with your kind of job design.

wait_for_file has a different meaning, Usually, a process waits for a file if its not present at the source location to read from. In your case, you already have the input file.

Also, you cannot read and write into the same sequential file at the same time.

You will get a

Code: Select all


ds_seqopen() - Win32 error in CreateFile - The process cannot access the file because it is being used by another process.

error.

Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Can you share your job design with us?

As whale had suggested it is not possible to read and write to a file at the same time but i think that you are not doing this.

Sam
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Check if this post helps you.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

How are you getting to the input and output count in your job?

If you need the number of records written into the file, you would need a separate job to load this information into the table. If it is the number of records going into the file (assuming that you dont want the reject count if any) - then you can catch it with an aggregator before writing into the file.
Last edited by thebird on Thu Dec 14, 2006 4:28 pm, edited 1 time in total.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

I don't think you can achieve this in a single job. However, what you could do is capture INROWNUM and OUTROWNUM in a different file through a different link from the transformer stage and then use this file in another job to load the table.
Kris

Where's the "Any" key?-Homer Simpson
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Modularization my friend. Build the text files in one job. Cat them and load in the second job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This design will not open the file for reading until it has been written to and closed by the writer, therefore the Transformer stage will wait.

Code: Select all

----->  SeqFileStage  ----->  TransformerStage  ----->
But a modular design in which one job creates the file and another reads it, is easier to maintain. And the second job can be controlled by a WaitForFile activity in 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